Skip to content

Commit dae6e23

Browse files
committed
Move examples to examples directory
1 parent d1a0ae2 commit dae6e23

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cargo build --release
2424

2525
3. Run the interpreter on example Lua scripts:
2626
```bash
27-
cargo run --release -- ./example.lua
27+
cargo run --release -- ./examples/fib.lua
2828
```
2929

3030
4. Install the interpreter locally as drop-in replacement for `lua`:
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
21
function Fib(n)
3-
if n < 2 then
2+
if n <= 2 then
43
return 1
54
else
65
return Fib(n - 1) + Fib(n - 2)
76
end
87
end
98

109
-- example comment
11-
print(Fib(25))
12-
13-
num = 10
14-
15-
repeat
16-
print("Hello", num)
17-
num = num - 1
18-
until num < 0
10+
for i = 1, 20 do
11+
print(i, Fib(i))
12+
end

0 commit comments

Comments
 (0)