Created
August 24, 2017 19:36
-
-
Save scizzorz/54f9469c504885bb85d4ea885d9c5dbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return func(end) | |
inner = func() | |
if i == end | |
return | |
save [i, end] | |
i = i + 1 | |
(~inner).i = 0 | |
(~inner).end = end | |
return inner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
square = table | |
square.new = func(self, w, h) | |
return table {w=w, h=h} :: self | |
square.area = func(self) | |
return self.w * self.h | |
return square |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
square = import("square.rnc") | |
x = square:new(3, 4) | |
print(x:area()) | |
range = import("range.rnc") | |
for [i, max] in range(5) | |
print(i $ " / " $ max) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[a, b, c] = [1, 2, true] | |
print(a) | |
print(b) | |
print(c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment