Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/math
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@laptop.org>2007-12-13 04:02:40 (GMT)
committer C. Scott Ananian <cscott@laptop.org>2007-12-13 06:59:58 (GMT)
commit8d26afc0dea107f400260c68e04b93c0fe897dfe (patch)
tree1d0dfab032d46374a9a0517718a346618f11812f /data/math
parent551cba16674243da3311d73f6289c8aa291f0687 (diff)
Colorize and tweak 'guess' and 'thanks' examples.
Diffstat (limited to 'data/math')
-rw-r--r--data/math/guess4
1 files changed, 4 insertions, 0 deletions
diff --git a/data/math/guess b/data/math/guess
index d80514c..3fa8aea 100644
--- a/data/math/guess
+++ b/data/math/guess
@@ -1,4 +1,5 @@
import random
+import pippy
R = random.randrange(1,100)
print "Guess a number between 1 and 100!"
@@ -6,9 +7,12 @@ 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"