forked from Grissess/lua-evenchur
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
24 lines (23 loc) · 721 Bytes
/
main.lua
File metadata and controls
24 lines (23 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package.path = "./?.lua;" .. package.path
local evenchur = require('evenchur')
while true do
print(evenchur.print_status())
io.write(evenchur.colors.prompt .. evenchur.state.mode .. "> ")
local line = io.read()
if line == nil then
print('\x1b[1;37;41mIn a rare turn of events, your sword decides to fall on you. Better luck next time!\x1b[m')
break
end
line = line:gsub("\n", "")
print(evenchur.colors.reset .. evenchur.exec(line:gsub("\n", "")))
local res = evenchur.game.post_tick()
if res then print(res) end
if evenchur.state.finished ~= nil then
if type(evenchur.state.finished) == "string" then
print(evenchur.state.finished)
else
print("The game is over. Goodbye!")
end
break
end
end