RosettaCodeData/Task/Kernighans-large-earthquake-problem/Lua/kernighans-large-earthquake-problem.lua

6 lines
228 B
Lua
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
-- arg[1] is the first argument provided at the command line
for line in io.lines(arg[1] or "data.txt") do -- use data.txt if arg[1] is nil
magnitude = line:match("%S+$")
if tonumber(magnitude) > 6 then print(line) end
end