the 1 way to win all typewar challenges ever

I started playing typewar in 2009 when it was brand new and I liked it a lot. After playing a few hours too much I stopped at level 25.

Now a few years later I wanted to reach level 70 with a perfect score. On some spare time on EuroPython 2014 I started coding a bot playing typewar using some Python.

Using sessions in requests the login and staying logged in was really easy. Now the next step was to choose the font of the shown glyph. If not already in the database, the font was picked randomly. On the next page the result was saved for later occurrence of this glyph. The html was parsed using lxml and beautifulsoup. The data was stored using sqlalchemy using a PostgreSQL database which was totally oversized for such a small amount of datasets. The game has 21 fonts and 1092 glyphs (21 (fonts) * 26 (characters) * 2 (upper+lower case)). Due to rate limiting it took a while to get my first bot account to level 70. At level 70 this account acquired all glyphs possible and had a flawless streak of 24770 questions. The second account now knew all possible glyphs and had a flawless streak from first question till level 70 and earned all crowns possible in the game.

Overall the code consists of 265 lines of Python code.

screenshot of win