Guess the number/With feedback: Difference between revisions

no edit summary
No edit summary
Line 1,076:
 
ser: say; say '*** error ! ***'; say arg(1); say; return</lang>
 
=={{header|Scheme}}==
{{works with|Chicken Scheme}}
{{works with|Guile}}
<lang scheme>(define maximum 5)
(define minimum -5)
(define number (+ (random (- (+ maximum 1) minimum)) minimum))
 
(display "Pick a number from ")
(display minimum)
(display " through ")
(display maximum)
(display ".")
(do ((guess (read) (read))) ((eq? guess number))
(if (> guess number)
(display "Too high!\n> "))
(if (< guess number)
(display "Too low!\n> "))
(if (or (>= guess maximum) (< guess minimum))
(display "Out of range!\n> ")))
(display "Correct!\n")</lang>
 
=={{header|Tcl}}==
Anonymous user