Created
September 26, 2013 15:12
-
-
Save jcchurch/6715565 to your computer and use it in GitHub Desktop.
My attempt at solving https://icpcarchive.ecs.baylor.edu/external/45/4574.pdf in Lua. This is my first Lua script.
This file contains hidden or 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
#!/usr/bin/lua | |
local values = io.read("*number") | |
while values > 0 do | |
local currentguess = 0 | |
for i = 1, values do | |
thisguess = io.read("*number") | |
if thisguess ~= currentguess then | |
io.write(string.format("%d ", thisguess)) | |
currentguess = thisguess | |
end | |
end | |
print("$") | |
-- read values for the next loop | |
values = io.read("*number") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment