Skip to content

Instantly share code, notes, and snippets.

Created June 2, 2016 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/910f6a021798a9d0629552a1aacf6d05 to your computer and use it in GitHub Desktop.
Save anonymous/910f6a021798a9d0629552a1aacf6d05 to your computer and use it in GitHub Desktop.
the description for this gist
def program(implicit M: Moves[LogoApp], P: PencilActions[LogoApp]): (Position => Free[LogoApp, Unit]) = {
import M._, P._
s: Position =>
for {
p1 <- forward(s, 10)
p2 <- right(p1, Degree(90))
_ <- pencilUp(p2)
p3 <- forward(p2, 10)
_ <- pencilDown(p3)
p4 <- backward(p3, 20)
_ <- showPosition(p4)
} yield ()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment