Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,19 @@
local s = {1, 2, 2, 3, 4, 4, 5}
-- There is no output as 'prev' is created anew each time
-- around the loop and set implicitly to nil.
for i = 1, #s do
local curr = s[i]
local prev
if i > 1 and curr == prev then print(i) end
prev = curr
end
-- Now 'prev' is created only once and reassigned
-- each time around the loop producing the desired output.
local prev
for i = 1, #s do
local curr = s[i]
if i > 1 and curr == prev then print(i) end
prev = curr
end