Spring 2018

May 30


competitive programmers handbook | discussion

today's xkcd : python environments

tron tourney

Each tourney has six rooms and 3 rounds with each combination of (room, player1, player2).

The test_jim tourney was just to see if things were working - my "jimbot" code from a few years back, with a min/max and a just-under-one-second thinking time, along with the wallbot and randbot. That one went pretty much as expected: jimbot did better than the other two, but wasn't perfect.

The web page game replay is a javascript thing (with a "GET" to fetch the *.tron game file) with a python/cgi script to look at a folder and generate a web page with links to the javascript replays.

The tourney engine is in several python scripts : ( tourney -> round -> (, ) with tourney managing the rooms and matchups, round doing one game, and player spawning a process to interact with one bot. The bots can be written in any language.

The 2018_1 (take 1) tourney had six bots: wallbot, randbot, jimbot, JimmyBot, nateBot, and merlbot . I didn't expect what happened: JimmyBot destroyed jimbot and merlbot. When I say "destroyed", I don't mean "beat" exactly - nateBot won that tourney - but at the end of each round the JimmyBot process wouldn't quit and wasn't shut down - some sort of bug in the referee engine which I tried but was unable to fix. The referee flags players who take too much time as losing, and due to another bug in the game engine code, only evaluates "too much time" correctly when the system is quiet - not when half a dozen JimmyBot processes are using 150% of the cpu. So most of the jimbot and merlbot processes were cut off in the first move and marked as the loser because they were taking more time than the referee allowed.

All this took more time than I expected on Sunday. I started up a "take 2" version in the evening which wasn't finished when I went to bed. This morning, the load was over 100 (!) but the tourney did finish. There are fewer timeouts, but glancing through the matches, I think that the system load may still changing the bot behavior - the lookahead bots aren't doing quite what I would expect. In this one, jimbot (most wins) and merlbot (fewest losses) did the best. If I use chess scoring (win=1, draw=0.5) then jimbot is just slightly ahead, 160 to 157.5.

I've started up a "take 3" this morning, without JimmyBot, just for fun ... which as of 11am has finished. BUT ... I also messed up and overwrote the games files in 2018_2. Oops. (So the only record of the games in take_2 are those that involved JimmyBot.)

And I've also started test_jimmy with (randbot, wallbot, JimmyBot)

Jimmy  : for destroying two other bots
Nate   : for winning the 1st iteration, in spite of the destroyer
Merlin : for the best student bot in the 2nd iteration

spreadsheet style

Barbora submitted an interesting coding style that we haven't discussed yet - spreadsheets .


For non tourney folks : discuss your project.

Reminder: submit your final project (code, write-up, references, output, docs) Friday! (Or the Monday following if you've asked for an extension.) /cours /spring2018 /workshop /notes /may30
last modified Sun October 17 2021 12:42 pm

attachments [paper clip]

  last modified size
TXT overnight.png Sun Oct 17 2021 12:42 pm 2.9M
TXT process_cpu_screenshot.png Sun Oct 17 2021 12:42 pm 1.1M