Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/purcell/icfpc2015
My solo entry for the 2015 ICFP Contest - http://2015.icfpcontest.org/
https://github.com/purcell/icfpc2015
Last synced: 3 months ago
JSON representation
My solo entry for the 2015 ICFP Contest - http://2015.icfpcontest.org/
- Host: GitHub
- URL: https://github.com/purcell/icfpc2015
- Owner: purcell
- License: gpl-3.0
- Created: 2015-08-10T12:27:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-08T19:44:51.000Z (over 9 years ago)
- Last Synced: 2023-04-11T05:03:08.904Z (almost 2 years ago)
- Language: Haskell
- Homepage:
- Size: 207 KB
- Stars: 6
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## My entry for ICFP Contest 2015
I logged just under 25 hours of active work on this code, which
reached 50th on the leaderboard when I retired, about 50 hours into
the contest. 22 hours of inactivity later, I was at 113th of the 194
teams which managed to submit scoring plays.The organisation of the ~450 lines of Haskell code is a bit haphazard,
with some misleading comments. If in doubt, follow the code down from
`Main`.The gameplay logic is in `GamePlay.hs`, where `playCommand` can be
given a `Command` to advance one `GameState` to a new `GameState`.The code in `AI` uses `playCommand` to explore paths taking the
current unit to all the possible locked positions, then chooses the
"best" position from which to move on to placing the next unit. "Best"
is a heuristic based on the score for that move, plus a bonus for
moves which result in more filled cells lower on the grid. Simple, but
fairly effective.Haskell was a great choice for this challenge, because the time I
spent scratching my head was more than compensated for by the ease of
expressing algorithms, and the guarantee of immutability.In due course I hope to write a full post-mortem of what was a
wonderful - if exhausting - experience.-Steve Purcell
[@sanityinc](https://twitter.com/sanityinc) // [sanityinc.com](http://www.sanityinc.com)
Get in touch if you'd like to work with me at
[powershop.co.nz](http://www.powershop.co.nz/) -- we're hiring
excellent developers.