Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data
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
parent551cba16674243da3311d73f6289c8aa291f0687 (diff)
Colorize and tweak 'guess' and 'thanks' examples.
Diffstat (limited to 'data')
-rw-r--r--data/math/guess4
-rw-r--r--data/string/thanks20
2 files changed, 17 insertions, 7 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"
diff --git a/data/string/thanks b/data/string/thanks
index bcd3678..c771192 100644
--- a/data/string/thanks
+++ b/data/string/thanks
@@ -1,6 +1,3 @@
-import random
-from random import choice
-
table = {
'Hardware & Mechanicals': 'John Watlington, Mark Foster, Mary Lou Jepsen, Yves Behar, Bret Recor, Mitch Pergola, Martin Schnitzer, Kenneth Jewell, Kevin Young, Jacques Gagne, Nicholas Negroponte, Frank Lee, Victor Chau, Albert Hsu, HT Chen, Vance Ke, Ben Chuang, Johnson Huang, Sam Chang, Alex Chu, Roger Huang, and the rest of the Quanta team, the Marvell team, the AMD team, the ChiMei team...',
'Firmware': 'Ron Minnich, Richard Smith, Mitch Bradley, Tom Sylla, Lilian Walter, Bruce Wang..',
@@ -18,10 +15,19 @@ table = {
'Finance & Legal': 'Eben Moglen, Bruce Parker, William Kolb, John Sare, Sandra Lee, Richard Bernstein, Jaclyn Tsai, Jaime Cheng, Robert Fadel, Charles Kane (Grasshopper), Kathy Paur, Andriani Ferti',
'PR and Media': 'Larry Weber, Jackie Lustig, Jodi Petrie, George Snell, Kyle Austin, Hilary Meserole, Erick A. Betancourt, Michael Borosky, Sylvain Lefebvre, Martin Le Sauteur',
'Directors & Advisors': 'Howard Anderson, Rebecca Allen, Ayo Kusamotu, Jose Maria Aznar, V. Michael Bove, Jr., Rodrigo Mesquita, Seymour Papert, Ted Selker, Ethan Beard (Google); John Roese (Nortel); Dandy Hsu (Quanta); Marcelo Claure (Brightstar); Gary Dillabough (eBay); Gustavo Arenas (AMD); Mike Evans (Red Hat); Ed Horowitz (SES Astra); Jeremy Philips (NewsCorp); Scott Soong (Chi Lin); Sehat Sutardja (Marvell); Joe Jacobson (MIT Media Lab); Steve Kaufman (Riverside); Will Swope (Intel); and Tom Meredith (MFI)',
- 'Pippy': 'Chris Ball'
+ 'Pippy': 'Chris Ball, C. Scott Ananian'
}
-print "OLPC would like to take this opportunity to acknowledge the community of people and projects that have made the XO laptop possible."
+import random, time
+from pippy.console import *
+from textwrap import fill
+
+while True:
+ reset()
+ print fill("OLPC would like to take this opportunity to acknowledge the community of people and projects that have made the XO laptop possible.", 68)
+
+ subsystem = random.choice(table.keys())
+ random.choice([red, green, orange, blue, purple, cyan])()
+ print '\n', fill("%s: %s" % (subsystem, table[subsystem]), 68)
-subsystem = random.choice(table.keys());
-print '\n', subsystem, '\t',table[subsystem]
+ time.sleep(3)