Arimaa Forum (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi)
Arimaa >> Game Analysis >> Reading archived games for analysis
(Message started by: phairland on Jan 1st, 2015, 4:54am)

Title: Reading archived games for analysis
Post by phairland on Jan 1st, 2015, 4:54am
I downloaded the archived games for analysis. Is a txt file about 65 MB.

How do I read the file?

Or how do I convert it into a database like sqlite?

Title: Re: Reading archived games for analysis
Post by Fritzlein on Jan 1st, 2015, 11:06am
The games archive text is delimited by tabs between fields and newlines between records.  Most database programs have a feature that assists in importing text files, if you specify the delimiters.

Title: Re: Reading archived games for analysis
Post by phairland on Jan 1st, 2015, 3:46pm
Thank you Fritzlein.

If anyone is interested in how to created the full sqlite database worth 4GB of arimaa archive games from 2002 until 2014, I made this batch of sqlite3 commands:

http://pastebin.com/XCPEBnfY





Title: Re: Reading archived games for analysis
Post by Agt on Jan 2nd, 2015, 9:29am
Hello,
You may also be interested in https://github.com/agt-the-walker/arimaa-utils, more specifically fetch-new-games, which will only download game archives that have changed in order to minimize network usage.

Title: Re: Reading archived games for analysis
Post by phairland on Jan 2nd, 2015, 2:03pm
Hi Agt, thank you for posting your project. My plan is to fetch a particular game with relavant data and format it into a latex => pdf file. The idea I have is to put the movelist into two columns, one for gold, one for silver and one line per plycount, so it will be much easier to read. I made a nice homemade game board made of cardboard for analysing games so I need an easier way of reading the movelist. I will do the parsing in Tcl, I don't know much about Ruby but I heard is really good for text processing as well.

This is the link to my homemade board:

http://goo.gl/n7D99B

(blu-tak used to attach pieces to board, planning to make another board with a steel sheet and magnetic pieces)


Title: Re: Reading archived games for analysis
Post by aaaa on Jan 4th, 2015, 3:08am
65 MB? The total database is more than an order of magnitude larger than that!

Title: Re: Reading archived games for analysis
Post by phairland on Jan 4th, 2015, 4:21am
Hi aaaa,

Initially I only downloaded allgames201412.txt which is worth 65MB thinking that that was the whole database until that time. Later I realised that is was only the games for that month and that I needed to download the whole bunch of txt files which is worth about 4GB.


Title: Re: Reading archived games for analysis
Post by Agt on Jan 4th, 2015, 4:38pm
Nice homemade board! Since I'm also a LaTeX user, I can't wait to see the results of your project. I prefer Ruby for text processing but Tcl should also be fine...

Title: Re: Reading archived games for analysis
Post by phairland on Jan 7th, 2015, 12:25am
I just started to format the movelist and here is a peek at the pdf, latex and tcl file:

PDF   http://goo.gl/sFS2fe

TEX   http://pastebin.com/xTziauDT

TCL   http://pastebin.com/TqusAMYw

I have an account on github, so I will probably upload it there at some point for easy sharing. The Tcl script is a mess of regular expressions but I comment each part, I checked about Ruby regex commands and surely Ruby would be more elegant and clear in that respect, I may try to convert it to Ruby to see how it looks like and how much differ from the Tcl script.

Title: Re: Reading archived games for analysis
Post by Fritzlein on Jan 7th, 2015, 9:11am
Thanks; it's nice to see another tool added to the Arimaa community toolkit.



Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.