Created
September 28, 2012 20:30
-
-
Save joshcough/3801923 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Command( | |
name = "fib-tower", | |
desc = "create a tower from the fib numbers", | |
body = args(int ~ material){ case (p, i ~ m) => | |
lazy val fibs: Stream[Int] = 0 #:: 1 #:: fibs.zip(fibs.tail).map{case (i,j) => i+j} | |
val xBlocks: Stream[Block] = p.world.fromX(p.loc) | |
for{ | |
(startBlock,n) <- xBlocks.zip(fibs take i) | |
towerBlock <- startBlock.andBlocksAbove take n | |
} towerBlock changeTo m | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment