Skip to content

Commit d9b6894

Browse files
committed
Squashed README.LUA code to fit in 1 cluster (512 bytes).
1 parent 81147db commit d9b6894

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

demo/core/README.LUA

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,11 @@
22

33
-- This is a single line comment, the line above is a shebang for UNIX systems
44

5-
--[[ This is a multi-line comment. To run the script, pass it to the lua binary
6-
as an argument (`LUA16.EXE EXAMPLE.LUA` on 16-bit DOS for example).
7-
For full Lua language documentation visit https://www.lua.org/docs.html --]]
8-
9-
hour = tonumber(os.date('%H')) -- Get the hour of day from clock
10-
if hour < 4 or hour > 20 then -- Convert hour into fuzzy time of day
11-
timeOfDay = 'night'
12-
elseif hour < 9 then
13-
timeOfDay = 'morning'
14-
elseif hour > 16 then
15-
timeOfDay = 'evening'
16-
else
17-
timeOfDay = 'day'
18-
end
19-
20-
print('Good ' .. timeOfDay .. ' from ' .. _VERSION .. '.') -- Print a greeting
21-
print("Press Enter to Exit...") io.read() -- Wait for Enter to be pressed
22-
os.exit() -- Exit the script. Will also exit an interactive shell
5+
--[[ This is a multi-line comment.
6+
To run the script, pass it to a lua binary as an argument.
7+
For full Lua language documentation visit https://www.lua.org/docs.html --]]
8+
9+
H=tonumber(os.date('%H'))
10+
T=(H<4 or H>20)and'night'or H<9 and'morning'or H>16 and'evening'or'day'
11+
print('Good '..T..' from '.._VERSION..'.')
12+
print("Press Enter to Exit...")io.read()os.exit()

0 commit comments

Comments
 (0)