Guest User

Untitled

a guest
Oct 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. struct vec2 (x, y);
  2.  
  3. def vec2_add(a, b) {
  4. vec2(a.x + b.x, a.y + b.y);
  5. }
  6.  
  7. def main() {
  8. x = [1, 2, 3];
  9. print("hi! length of x is #{len(x)}");
  10.  
  11. z = lambda(n) { n*2 };
  12.  
  13. y = vec2(1, 5);
  14. print(vec2_add(vec2(1, 1), y)); // prints <vec2 x=2 y=6>
  15. }
  16.  
  17. main();
Add Comment
Please, Sign In to add comment