summaryrefslogtreecommitdiff
path: root/dice.orang
diff options
context:
space:
mode:
Diffstat (limited to 'dice.orang')
-rw-r--r--dice.orang6
1 files changed, 3 insertions, 3 deletions
diff --git a/dice.orang b/dice.orang
index 0fae27b..d8e52de 100644
--- a/dice.orang
+++ b/dice.orang
@@ -1,14 +1,14 @@
1def dice sides times = 1def dice sides times =
2 let once _ = randInt 1 (sides + 1) in 2 let once () = randInt 1 (sides + 1) in
3 let aux acc times = 3 let aux acc times =
4 if times ?= 0 then acc 4 if times ?= 0 then acc
5 else aux (acc + once ()) (times - 1) 5 else aux (acc + once ()) (times - 1)
6 in 6 in
7 aux 0 times 7 aux 0 times
8 8
9def guessing_game _ = 9def guessing_game () =
10 let secret = randInt 1 101 10 let secret = randInt 1 101
11 and guessOnce _ = do 11 and guessOnce () = do
12 print "Make your guess: "; 12 print "Make your guess: ";
13 let guess = readInt () in 13 let guess = readInt () in
14 if secret > guess then do 14 if secret > guess then do