Skip to content

Commit d7b727f

Browse files
author
梶塚太智
committed
Create guess.stk
1 parent c62f19c commit d7b727f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

examples/guess.stk

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
(数あてゲーム ~ 1から100まで) print
2+
1 101 1 range rand (answer) var
3+
0 (i) var
4+
5+
(
6+
i 1 add (i) var
7+
i (回目のチャレンジ) concat print (> ) input (guess) var
8+
(
9+
(正解!おめでとうございます) concat print
10+
0 exit
11+
) (
12+
((大き過ぎ!) print)
13+
((小さ過ぎ!) print)
14+
answer guess less answer
15+
guess equal not and if
16+
)
17+
guess answer equal if
18+
)
19+
(i 10 less) while
20+
(時間切れ。正解は) answer concat (でした) concat print

0 commit comments

Comments
 (0)