Skip to content

Commit

Permalink
Update WhileRepeat.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGreatSageEqualToHeaven authored Mar 27, 2024
1 parent 4b76cd4 commit 2532beb
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions tests/Staging/WhileRepeat.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
local t = {}
local a = 1
while a ~= 10 do
a = a + 1
print(a)
table.insert(t, a)
end

print('REPEAT!')
assert(t[2] == 3)
assert(t[3] == 4)
assert(t[4] == 5)
assert(t[5] == 6)
assert(t[6] == 7)
assert(t[7] == 8)
assert(t[8] == 9)
assert(t[9] == 10)

local t = {}
local a = 1
repeat
a = a + 1
print(a)
table.insert(t, a)
until a == 10

assert(t[2] == 3)
assert(t[3] == 4)
assert(t[4] == 5)
assert(t[5] == 6)
assert(t[6] == 7)
assert(t[7] == 8)
assert(t[8] == 9)
assert(t[9] == 10)

OK()

0 comments on commit 2532beb

Please sign in to comment.