View script | License | Download script | History | Other scripts by: caridorc |
1-May 0:52 UTC
[0.031] 10.998k
[0.031] 10.998k
Archive version of: guess-the-number.r ... version: 1 ... caridorc 25-Sep-2014Amendment note: new script || Publicly available? Yes REBOL [ File: %guess-the-number.r Date: 25-9-2014 Title: "Guess the number" Purpose: { This game will ask you to enter a number and will then say if it is more or less than a predefined random number with best ability and worst luck you will need (log in base 2 of MAX) tries to guess the number (if you are interested in this google "Binary search") } Author: "Caridorc" Known-bugs: { The programme works flawlessly, there are no bugs } library: [ level: 'beginner platform: 'all type: [tutorial] domain: [game] tested-under: 'Windows support: riki100024 AT gmail DOT com license: CC 3.0 Attribution only see-also: none ] ] ] random/seed now/precise MAX: 100 view layout [ text "Number guessing game" slider 800x32 [ guess: to-integer value * MAX ] button "Start/Reset" [n: random MAX] button "Check" [alert to-string guess if (guess = n) [alert "Right!"] if (guess < n) [alert "Too small"] if (guess > n) [alert "Too big"] ] ] |