Skip to content

Instantly share code, notes, and snippets.

@danielcasler danielcasler/gen.go
Last active Aug 16, 2019

Embed
What would you like to do?
// Handler that calls generate
func ok(w http.ResponseWriter, r *http.Request) {
// res := make([]int64, 0, 100000)
var res [100000]int64
fibonacci.Generate(&res)
// fmt.Println(suc)
// fmt.Printf("%T", res)
// fmt.Println(res[50])
fmt.Fprintf(w, "OK")
}
// Generate
func Generate(data *[100000]int64) bool {
// var result [100000]int64
start := 1000
counter := 0
for start >= 1 {
var num = 90
var n1, n2, temp int64 = 0, 1, 0
for num >= 1 {
temp = n2
n1, n2 = temp, n1+n2
data[counter] = n2
counter++
num--
}
start--
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.