mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-05-08 19:29:50 +08:00
add fibonacci calculator example
This commit is contained in:
parent
cf54af8d74
commit
984136b036
15
test/config
15
test/config
@ -35,7 +35,13 @@ color_now_playing_title = "#017702"
|
|||||||
color_playlist = "#008B8B"
|
color_playlist = "#008B8B"
|
||||||
color_popup = "#0A0F14"
|
color_popup = "#0A0F14"
|
||||||
|
|
||||||
|
func fib(x) {
|
||||||
|
if x <= 1 {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
return fib(x - 1) + fib(x - 2)
|
||||||
|
}
|
||||||
|
|
||||||
module Keybinds {
|
module Keybinds {
|
||||||
|
|
||||||
@ -54,8 +60,13 @@ module Keybinds {
|
|||||||
c = command_search
|
c = command_search
|
||||||
|
|
||||||
v = func() {
|
v = func() {
|
||||||
input_popup("text", func(result) {
|
input_popup("fib calculator", func(result) {
|
||||||
debug_popup(result)
|
x = to_int(result)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
result = fib(x)
|
||||||
|
debug_popup(to_string(result))
|
||||||
|
}()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user