Skip to content
This repository was archived by the owner on Feb 26, 2019. It is now read-only.

Commit ddca20d

Browse files
authored
More bad code which doesn't work:tm:
Still haven't defined a few functions and I'm still yet to figure out some stuff but PROGRESS:tm:(?)
1 parent 120a519 commit ddca20d

File tree

1 file changed

+52
-8
lines changed

1 file changed

+52
-8
lines changed

votes.go

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package main
66

77
import "fmt"
8+
import "database/sql"
89

910
type CountryVotingData struct {
1011
worldwide int32
@@ -89,14 +90,7 @@ func prepare() int {
8990
var national int32
9091
var worldwide int32
9192

92-
/*
93-
you know as much as I dislike python and think Go is just plain better
94-
it is now also apparent that Go can also suck a cactus with shit like this
95-
file type is an int?
96-
national is an int?
97-
IS ANYTHING NOT AN INT?
98-
THE INTS ARE TAKING OVER
99-
*/
93+
// does this even work?
10094

10195
fmt.Println("Preparing ...")
10296
if production { // todo: learn go
@@ -169,3 +163,53 @@ func automatic_questions() int {
169163
mysql_get_questions(1, nw) // todo: mysql in go
170164
questions = 1
171165
}
166+
167+
func automatic_results() int {
168+
var write_results int32
169+
var results int32
170+
var national int32
171+
var worldwide int32
172+
var questions int32
173+
var national_results int32
174+
var worldwide_results int32
175+
var nw int32
176+
177+
// sigh
178+
179+
180+
write_results = true
181+
nw = os.Args[2:]
182+
if nw == "n":
183+
days = 7
184+
else if nw == "w":
185+
days = 15
186+
results[get_poll_id()] = mysql_get_votes(days, nw, 1)
187+
delete results[None] // except keyerror pass??
188+
national = 0
189+
worldwide = 0
190+
questions = 0
191+
}
192+
193+
func automatic_votes() int {
194+
var write_questions int32
195+
var write_results int32
196+
var questions int32
197+
var results int32
198+
var national int32
199+
var worldwide int32
200+
var questions int32
201+
202+
write_questions = true
203+
write_results = true
204+
mysql_get_questions(1, "w")
205+
mysql_get_questions(3, "n")
206+
questions = national + worldwide
207+
question_count = len(question_data)
208+
printf("Loaded %s %s" % (question_count, "Questions"))
209+
for v in list(reversed(range(1, 7))) {
210+
results[get_poll_id()] = mysql_get_votes(7, "n", v)
211+
results[get_poll_id()] = mysql_get_votes(15, "w", 1)
212+
} // THIS DOESNT EVEN WORK because i don't know go
213+
delete results[None]
214+
}
215+

0 commit comments

Comments
 (0)