Created
November 16, 2008 08:44
-
-
Save gvx/25436 to your computer and use it in GitHub Desktop.
A simple number guessing game.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#By Robin Wellner (gvx) | |
#I hereby waive copyright and related or neighboring rights to this work | |
#See the Creative Commons Zero Waiver at <http://creativecommons.org/publicdomain/zero/1.0/> | |
from random import randint | |
D=raw_input('?') | |
A=randint(1,D) | |
B=randint(1,D) | |
C=randint(1,D) | |
print 'AB', A*B | |
print 'AC', A*C | |
print 'BC', B*C | |
raw_input() | |
print "[A,B,C]" | |
print [A, B, C] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROGRAM:RNDABC | |
:Input D:randInt | |
(1,D)→A:randInt( | |
1,D)→B:randInt(1 | |
,D)→C:Disp "AB", | |
AB,"AC",AC,"BC", | |
BC:Pause :Disp " | |
{A,B,C}",{A,B,C |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment