5539
Comment: py3 print
|
← Revision 10 as of 2020-06-02 22:07:41 ⇥
5629
|
Deletions are marked like this. | Additions are marked like this. |
Line 30: | Line 30: |
html("<h1 align=center>Zeros</h1>") html("<h2 align=center><font color='blue'>How many zeros?</font></h2>") |
pretty_print(html("<h1 align=center>Zeros</h1>")) pretty_print(html("<h2 align=center><font color='blue'>How many zeros?</font></h2>")) |
Line 37: | Line 37: |
html("<center>") | |
Line 39: | Line 38: |
H = "<center>" | |
Line 41: | Line 41: |
html("<font size=+3 color='red'>RIGHT</font>") | H += "<font size=+3 color='red'>RIGHT</font>" |
Line 54: | Line 54: |
html("<font size=+2 color='blue'>Wrong. Try again...</font>") html("</center>") html("<font size=+%s color='#333'>"%random.randrange(-2,5)) print ' '*random.randrange(20) + '0'*n |
H += "<font size=+2 color='blue'>Wrong. Try again...</font>" H += "</center>" pretty_print(html(H)) H2 = "<font size=+%s color='#333'>%s</font>"%(random.randrange(-2,5),' '*random.randrange(20) + '0'*n) pretty_print(html(H2)) |
Line 60: | Line 61: |
html("<br><br><center>Score: %s rounds, Average time: %.1f seconds</center>"%( round, float(tm)/round)) |
pretty_print(html("<br><br><center>Score: %s rounds, Average time: %.1f seconds</center>"%( round, float(tm)/round))) |
Sage Interactions - Games and Diversions
goto interact main page
Zeros
Have you ever wished you could count the number of zero digits in a long number like Rainman?
by William Stein and Sequoia Lefthand
Queens on board
An interaction to play with the problem of placing eight queens on a board so that they do not threaten each other. This interaction exemplifies the use of persistent data, and the auto_update=False option coded by mhansen and included in sage 3.3. by Pablo Angulo
Nim
Play nim against a perfect opponent. This interaction exemplifies the use of persistent data, and the auto_update=False option coded by mhansen and included in sage 3.3. by Pablo Angulo