Guest User

Untitled

a guest
Jun 28th, 2017
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.21 KB | None | 0 0
  1. type Vector = tuple[x, y: int]
  2.  
  3. proc add(a, b: Vector): Vector =
  4.   (a.x + b.x, a.y + b.y)
  5.  
  6. let
  7.   v1 = (x: -1, y: 4)
  8.   v2 = (x: 5, y: -2)
  9.  
  10.   v4 = add(v1, v2)
  11.   v5 = v1.add(v2)
  12.   v6 = v1.add(v2).add(v1)
Advertisement
Add Comment
Please, Sign In to add comment