Created
September 16, 2015 16:06
-
-
Save jayfoad/5f387ede95e42e99c645 to your computer and use it in GitHub Desktop.
The Snakes and Ladders Jugalbandi from Functional Conf 2015, in APL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config←30(3 5 11 20 17 19 21 27)(22 8 26 29 4 7 9 1) | |
turn←{s f t←⍺ ⋄ n←⍵+{⍵⊣⎕←'throw ',⍕⍵}?6 ⋄ n>s:⍵ ⋄ (f⍳n)⊃t,n} | |
{}{⎕←config turn ⍵}⍣{⍺=30}1 |
@ujjwalt some materials from the workshop are here: https://github.com/Dyalog/Presentations/tree/master/FnConf2015/Workshop
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mukundmr, @shukla2009: ⎕ is quad, and I'm using it to print some output as the game progresses. Unfortunately tryapl.org does not support this sort of input/output. Sorry! I'll think about a better way of writing it.