about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xpotato.scm23
1 files changed, 18 insertions, 5 deletions
diff --git a/potato.scm b/potato.scm index 68d0f2c..74ceaa3 100755 --- a/potato.scm +++ b/potato.scm
@@ -36,6 +36,11 @@ exec csi -s $0 "$@"
36 36
37;;; UI 37;;; UI
38 38
39(define (clear-screen)
40 (display #\escape)
41 (display "[2J")
42 (newline))
43
39(define (prln . strs) 44(define (prln . strs)
40 (apply string-append 45 (apply string-append
41 (append (intersperse 46 (append (intersperse
@@ -164,6 +169,13 @@ exec csi -s $0 "$@"
164 (set! potatoes 0) 169 (set! potatoes 0)
165 (set! orcs 0) 170 (set! orcs 0)
166 (set! orc-cost 1) 171 (set! orc-cost 1)
172
173 (clear-screen)
174 (display (prln " P O T A T O "
175 " ~ story by @deathbybadger"
176 " ~ game by @caseofducks"))
177 (newline)
178
167 (display (prln "You are a halfling, just trying to exist." 179 (display (prln "You are a halfling, just trying to exist."
168 "Meanwhile, the dark lord rampages across the world." 180 "Meanwhile, the dark lord rampages across the world."
169 "You do not care about this. You are trying to farm potatoes." 181 "You do not care about this. You are trying to farm potatoes."
@@ -181,9 +193,9 @@ exec csi -s $0 "$@"
181 "wizard" 193 "wizard"
182 "bard"))) 194 "bard")))
183 (display 195 (display
184 (prln `("An interfering " interloper " turns up at your doorstep with a quest." 196 (prln `("An interfering " interloper " turns up at your doorstep with a quest.")
185 "You are whisked away against your will on an adventure, where" 197 "You are whisked away against your will on an adventure.."
186 "you will probably be eaten by orcs."))))) 198 "where you will probably be eaten by orcs."))))
187 ('orcs 199 ('orcs
188 (display 200 (display
189 (prln "Orcs have found your potato farm." 201 (prln "Orcs have found your potato farm."
@@ -195,8 +207,9 @@ exec csi -s $0 "$@"
195 ((>= potatoes 10) 'potatoes) 207 ((>= potatoes 10) 'potatoes)
196 ((>= destiny 10) 'destiny) 208 ((>= destiny 10) 'destiny)
197 ((>= orcs 10) 'orcs) 209 ((>= orcs 10) 'orcs)
198 (else (let ((desc (event))) 210 (else (clear-screen)
199 (display-columns (scores) desc)) 211 (let ((desc (event)))
212 (display-columns (scores) desc))
200 (newline) 213 (newline)
201 214
202 (when (and (> orcs 0) 215 (when (and (> orcs 0)