#1 · wccanard
2 Apr 2008
I have compiled a database of 322 games of dots and boxes played between "experts" (i.e. the top few people in the ratings lists both here and at jijbent.nl). It's available at
wccanard.wetpaint.com
The database is in python-readable format [python is a programming language, for those of you wondering what this means---in practice this means that you can write computer code to ask questions of the database]. The reason I restricted to games between experts was that I wanted to get some kind of idea of things like whether P1 or P2 was more likely to win, in a game between experts, and which openings were played most often between experts.
Here's a sample run.
<font face="courier"><br/><br/><br/>$ python<br/>Python 2.4.4 (#2, Apr 5 2007, 20:11:18)<br/>[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2<br/>Type "help", "copyright", "credits" or "license" for more information.<br/>>>> execfile("script4.py")<br/>>>> ## That loads the database.<br/>>>> ##<br/>>>> ## How big is the database?<br/>>>> len(database)<br/>322<br/>>>> ## Who wins more games? P1 or P2?<br/>>>> w1=[g for g in database if g.winner==1]<br/>>>> w2=[g for g in database if g.winner==2]<br/>>>> len(w1)<br/>183<br/>>>> len(w2)<br/>139<br/>>>> ## P1 has the edge!<br/>>>> ##<br/>>>> ## What are the most common openings?<br/>>>> b1=DnbGame(['b',1,'r',-1])<br/>>>> c2=DnbGame(['c',2,'r',-1])<br/>>>> d1=DnbGame(['d',1,'r',-1])<br/>>>> d3=DnbGame(['d',3,'r',-1])<br/>>>> e2=DnbGame(['e',2,'r',-1])<br/>>>> e4=DnbGame(['e',4,'r',-1])<br/>>>> f1=DnbGame(['f',1,'r',-1])<br/>>>> f3=DnbGame(['f',3,'r',-1])<br/>>>> f5=DnbGame(['f',5,'r',-1])<br/>>>> len([g for g in database if codepos(g.positions[0])==codepos(b1.positions[0])])<br/>1<br/>>>> len([g for g in database if codepos(g.positions[0])==codepos(c2.positions[0])])<br/>132<br/>>>> len([g for g in database if codepos(g.positions[0])==codepos(d1.positions[0])])<br/>1<br/>>>> len([g for g in database if codepos(g.positions[0])==codepos(d3.positions[0])])<br/>15<br/>>>> len([g for g in database if codepos(g.positions[0])==codepos(e2.positions[0])])<br/>5<br/>>>> len([g for g in database if codepos(g.positions[0])==codepos(e4.positions[0])])<br/>13<br/>>>> len([g for g in database if codepos(g.positions[0])==codepos(f1.positions[0])])<br/>2<br/>>>> len([g for g in database if codepos(g.positions[0])==codepos(f3.positions[0])])<br/>41<br/>>>> len([g for g in database if codepos(g.positions[0])==codepos(f5.positions[0])])<br/>112<br/>>>> ## c2 and f5 (and their reflections/rotations) are the most common.<br/>>>> ##<br/>>>> ## Imagine a game that starts with a "cross" in the middle of the board:<br/>>>> g=DnbGame(['e',4,'d',5,'e',6,'f',5,'r',-1])<br/>>>> ## How many games in the database end up in this position after 4 moves?<br/>>>> c=codepos(g.positions[3])<br/>>>> v=[h for h in database if codepos(h.positions[3])==c]<br/>>>> len(v)<br/>8<br/>>>> ## And who wins them?<br/>>>> [h.winner for h in v]<br/>[2, 2, 2, 1, 2, 1, 2, 2]<br/>>>> ## And who plays them?<br/>>>> [h.p1 for h in v]<br/>['rekenwonder', 'rekenwonder', 'rekenwonder', 'rekenwonder', 'rekenwonder', 'wccanard', 'wccanard', 'wccanard']<br/>>>> [h.p2 for h in v]<br/>['arno', 'wccanard', 'wccanard', 'arno', 'arno', 'flipster', 'flipster', 'Scot']<br/>>>><br/><br/> </font>