This is our submission to the ICFP 2015 Programming Contest.
We realize that this is not the way that inputs were deemed to be accepted by the judges. We toyed briefly with the idea of using nodejs to take these arguments, but that never happened. To be honest, even our current implementation is not particularly fast (you'll see what we mean), and we decided that going for performance points was out of the question early on. As such, we hope that you enjoy our work for what it is: a showcase of some of the features and promise of the Elm language.
To run the application, you have two options:
elm-make
- You can use the elm compiler to build a website that you can then view. To do this, try something likeelm-make elm_main.elm --output index.html
elm-reactor
- If you start the elm reactor in this directory, then you can just point your browser atelm_main.elm
.
During running, you may notice what appear to be lock-ups. The program will eventually resume; we are still troubleshooting the cause of this behavior.
The test cases provided during the contest are all contained in Tests.elm
.
They're each a Json string bound to a variable. To add more test cases,
edit this file and add additional definitions of the form:
testN = """"
<string in full>
""""
You'll also want to add the test to the drop-down so that you can run it. To do
that, you'll need to edit Viewer.elm
. There's a big list of test tuples right
at the top, and you add your test cases there. Don't worry; all of the tests are
loaded into Viewer.elm
, so you won't have to modify the imports or anything
else.
It's that easy! ;)
The output is all conveniently printed on the left of the screen!
Here are all of the elm files in our submission.
DataStructs.elm
- all of the data structures for the programEngine.elm
- code for interacting with the game stateHex.elm
- code for dealing with hexes and grid cellsInit.elm
- initialization codeIO.elm
- Json IO toolsListDict.elm
- dictionary implementation that doesn't require comparablePowerWords.elm
- power word finder algorithmRand.elm
- random number generatorSearch.elm
- search algorithmTests.elm
- tests from the contest websiteUpdate.elm
- game model updater codeUtil.elm
- utility code and small functions for general useViewer.elm
- the code for rendering the model to the screen