Graph punting competition.
Contest site: https://icfpcontest2017.github.io/
The team: me only
Eliminated in round I (38/52)
Unfortunately submission had a bug introduced in last hour of coding, and was crashing for orgs.
[20:45] <@dhil> Segmentation fault
[21:32] <paiv> dhil: found my bug. That code can play only with options enabled.
Rush hour mess, blame me
The task was kind of a multi-player board game with partially hidden state. On your turn, you claim edges of a graph, trying to make longer roads from a few specific nodes, and preventing opponents from doing so.
Sample map:
Additional rules make it more fun:
Links:
Lightning submission was a random trails player with a preference to grab rivers attached to mines. Spent considerate time on unbuffered I/O, interprocess streams and changes to offline protocol.
Lightning was fully in Python, but then I decided to compensate my poor algorithmic skills with C/C++ performance. So there goes another day rewriting random player in C/C++, where I spent considerate time parsing JSON.
Day three started with adopting splurges extension. Then I had score tracked throughout the game, so could choose from best moves.
After a sleep brake (timezones), added support for options extension. Then a rush final stretch for monte-carlo-esque player, with final half-hour bug chase. (Have used 15 minutes into added time, thank you orgs).
After competition was over, I finally had time for visualizer.
imbotnot> I have trod the misty trails of graphviz and imagemagick, and now I'm back, a wise man
imbotnot> Though my time is nigh, and my sanity has gone
imbotnot> I can do magic
…and then I decided to build a server too.
Server runs on Node.js:
usage: puntd.js [-h] [-b HOST] [-p PORT] [-m MAP] [-n PLAYERS] [-f] [-o] [-s]
[-th HANDSHAKE] [-ts SETUP] [-tm MOVE]
I strived to make it full-featured, close to spec:
It still lacks testing though.
A ready to run server is now stored on Docker Hub. You can easily run it locally with
docker run --rm -P paiv/puntd
See README for detailed parameters.
I made a list of teams I can find on the internets here: