Spring naar hoofdinhoud
Haskell-oefening

Snake move

Meld je aan om je oplossing in te dienen en feedback te krijgen.

type Coordinate = (Int,Int) type Direction = (Int,Int) type Snake = [Coordinate] extend :: Snake -> Direction -> Snake extend old@((x,y):rest) (dx,dy) = (x+dx,y+dy):old move :: Snake -> Direction -> Snake move s r = undefined