Haskell exercise

Snake move

Sign in to hand in your solution and get feedback.

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