Skip to content

Instantly share code, notes, and snippets.

@gvx
Created November 16, 2008 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gvx/25436 to your computer and use it in GitHub Desktop.
Save gvx/25436 to your computer and use it in GitHub Desktop.
A simple number guessing game.
#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]
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