Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.35 KB | None | 0 0
  1. type Player = { x : int; y : int; }
  2.  
  3. let player = {
  4.   x = 0;
  5.   y = 0;
  6. }
  7.  
  8. let run player =
  9.   match keyboard with
  10.   | 'u' -> run { player with y = player.y - 1 }
  11.   | 'd' -> run { player with y = player.y + 1 }
  12.   | 'l' -> run { player with x = player.x - 1 }
  13.   | 'r' -> run { player with x = player.x + 1 }
  14.  
  15. let main argv =
  16.   run player
  17.   0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement