Created
June 5, 2015 18:32
-
-
Save arturaz/73f15ab552ad602b5d63 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
def rec(world: World): IO[Unit] = | |
if (world.resourcesLeft > 4) extract(world).flatMap(rec) | |
else for { | |
_ <- IO.putLn("!!! Removing asteroid !!!") | |
w = world.remove(asteroidId) | |
} yield extract(w) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment