Differences between revisions 5 and 6
Revision 5 as of 2012-04-18 18:08:28
Size: 5566
Editor: bvarberg
Comment:
Revision 6 as of 2012-05-09 02:31:59
Size: 5504
Editor: jason
Comment:
Deletions are marked like this. Additions are marked like this.
Line 30: Line 30:
print "<html><h1 align=center>Zeros</h1></html>"
print "<html>
<h2 align=center><font color='blue'>How many zeros?</font></h2></html>"
html("<h1 align=center>Zeros</h1>")
html("<h2 align=center><font color='blue'>How many zeros?</font></h2>")
Line 34: Line 34:
def zeros(a=("",selector(buttons=True, nrows=1, values=['Reset'] + [1..B], default=1))): def zeros(a=selector(buttons=True, nrows=1, values=['Reset'] + [1..B], default=1)):
Line 37: Line 37:
    print "<html><center>"         html("<center>")
Line 41: Line 41:
           print "<font size=+3 color='red'>RIGHT</font>"            html("<font size=+3 color='red'>RIGHT</font>")
Line 54: Line 54:
        print "<font size=+2 color='blue'>Wrong. Try again...</font>"
    print "</center>"
    print "<font size=+%s color='#333'>"%random.randrange(-2,5)
        html("<font size=+2 color='blue'>Wrong. Try again...</font>")
    html("</center>")
    html("<font size=+%s color='#333'>"%random.randrange(-2,5))
Line 58: Line 58:
    print "</font>"     html("</font>")
Line 60: Line 60:
        print "<br><br><center>Score: %s rounds, Average time: %.1f seconds</center>"%(
                 round, float(tm)/round)
    print "</html>"
        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

zeros.png

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

queens.png

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

nim.png

interact/games (last edited 2020-06-02 22:07:41 by kcrisman)