Guest User

Untitled

a guest
May 20th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. var range = object(
  3.     "init" => function(start, end)
  4.     {
  5.         this.start = start;
  6.         this.end = end;
  7.         return this;
  8.     },
  9.  
  10.     "count" => function()
  11.     {
  12.         return (this.end - this.start) + 1;
  13.     },
  14.  
  15.     "get" => function(n)
  16.     {
  17.         return this.start + n;
  18.     }
  19. );
  20.  
  21. for(i in range(5, 8))
  22. {
  23.     print("i: %d\n" % (i));
  24. }
Add Comment
Please, Sign In to add comment