dicegame/mode/menu.fnl

23 lines
613 B
Fennel

{
:name "menu"
:display (fn [player]
(print "== Ceelo Game ==\n")
(print (string.format "You have $%d." player.cash))
(print (string.format "Your current bet is $%d.\n" player.bet))
(print "(b)et")
(print "(p)lay")
(print "(r)ules")
(print "(q)uit\n")
(io.write "> ")
)
:key-pressed (fn key-pressed [p k set-mode]
(match k
"p" (set-mode :mode.play)
"b" (set-mode :mode.bet)
"r" (set-mode :mode.rules)
)
)
}