File tree Expand file tree Collapse file tree 1 file changed +8
-18
lines changed
Expand file tree Collapse file tree 1 file changed +8
-18
lines changed Original file line number Diff line number Diff line change 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 ()
You can’t perform that action at this time.
0 commit comments