Piustitious, Lua
A superstitious program that believes in Signs and Wonders.
history = arg[1]
if history == nil then
print("Good""good")
else
local EvilSigns, GoodSigns = 0,0
local SoulSpace = ""
for i in string.gmatch(history, "%d+") do
SoulSpace = SoulSpace .. i
end
if string.match(SoulSpace, "1010011010") then -- THE NUBMER OF THE BEAST!
local r = math.random(1000)
if r <= 666 then print("Evil""evil") else print("Good""good") end
else
for i in string.gmatch(SoulSpace, "10100") do -- "I'M COMING" - DEVIL
EvilSigns = EvilSigns + 1
end
for i in string.gmatch(SoulSpace, "11010") do -- "ALL IS WELL" - GOD
GoodSigns = GoodSigns + 1
end
if EvilSigns > GoodSigns then
print("Evil""evil")
elseif GoodSigns > EvilSigns then
print("Good""good")
elseif GoodSigns == EvilSigns then
local r = math.random(1000)
if r <= 666 then print("Good""good") else print("Evil""evil") end
end
end
end
run it with:
lua Piustitious.lua
followed by the input.