Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/en/math/guess
diff options
context:
space:
mode:
Diffstat (limited to 'data/en/math/guess')
-rw-r--r--data/en/math/guess19
1 files changed, 19 insertions, 0 deletions
diff --git a/data/en/math/guess b/data/en/math/guess
new file mode 100644
index 0000000..14c6539
--- /dev/null
+++ b/data/en/math/guess
@@ -0,0 +1,19 @@
+import random
+import pippy
+R = random.randrange(1, 100)
+
+print 'Guess a number between 1 and 100!'
+N = input('Enter a number: ')
+i = 1
+while (N != R):
+ if N > R:
+ pippy.console.red()
+ print 'Too big... try again'
+ else:
+ pippy.console.blue()
+ print 'Too small.. try again'
+ pippy.console.black()
+ N = input('Enter a number: ')
+ i = i + 1
+
+print 'You got it in', i, 'tries'