summaryrefslogtreecommitdiff
path: root/depre/main.scm
diff options
context:
space:
mode:
Diffstat (limited to 'depre/main.scm')
-rw-r--r--depre/main.scm21
1 files changed, 14 insertions, 7 deletions
diff --git a/depre/main.scm b/depre/main.scm
index 11b18fc..b59c5c9 100644
--- a/depre/main.scm
+++ b/depre/main.scm
@@ -30,12 +30,12 @@
;; - You are too tired for that, so you do this instead
;; - Or you actually do it
(define (f-or-tired f tired)
- #f
- )
+ (lambda ()
+ (if (< (random 100) (%tiredness)) (f) (tired))))
(define (f-or-depressed f depressed)
- #f
- )
+ (lambda ()
+ (if (< (random 100) (%depression)) (f) (depressed))))
;; Simple I/O
(define (answer message)
@@ -93,9 +93,16 @@
`(lambda () ((hash-ref %states ,name))))
(register-state
- 'begining
+ 'beginning
(state "This is the game beginning, as a test"
- (list (cons "Return to start" (to-state 'start)))))
+ (list (cons "Return to start"
+ (f-or-tired
+ (combine
+ (answer "Alright, you can do that.")
+ (to-state 'start))
+ (combine
+ (answer "You are too tired for that")
+ (to-state 'start)))))))
(register-state
'start
@@ -103,7 +110,7 @@
(list (cons "Start game"
(combine
(answer "Let's start, then.")
- (to-state 'begining)))
+ (to-state 'beginning)))
(cons "Quit game"
(answer "Good bye!")))
#:hide-status))