aboutsummaryrefslogtreecommitdiff
path: root/challenge-119/abigail/lua/ch-1.lua
blob: b31105ea9a634f178fa616a23db21cc0dbc728f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/opt/local/bin/lua

--
-- See ../README.md
--

--
-- Run as: lua ch-1.lua < input-file
--

for line in io . lines () do
    num = tonumber (line)
    print (                (num - (num   % 0x100))
           +              ((num % 0x010) * 0x010)
           + math . floor ((num % 0x100) / 0x010))
end