Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.execute("title Memory Game (From Lautenschlager)")
- system = {}
- system.sleep = function(time)
- local timer = os.time() + time
- while timer > os.time() do
- end
- end
- summon = function(dif)
- system.sleep(2)
- os.execute("cls")
- local i = {"<","<",">",">","<","<","<",">",">",">"}
- local c = 8
- if dif >4 and dif < 10 then
- i = {"<",">","^","<",">","^","<",">","^","<",">","^","<",">","^"}
- c = 18
- elseif dif > 9 and dif < 15 then
- i = {"<",">","^","@","<",">","^","@","<",">","^","@","<",">","^","@","<",">","^","@"}
- c = 48
- elseif dif > 14 then
- i = {"<",">","^","@","!","<",">","^","@","!","<",">","^","@","!","<",">","^","@","!","<",">","^","@","!"}
- c = 78
- end
- dif = dif + 3
- os.execute("color "..c)
- local sequence,done = {},0
- for v = 1,dif do
- table.insert(sequence,math.random(#sequence+1),i[math.random(#i)])
- end
- while done <= #sequence do
- local sq = ""
- for i = 1,done do
- sq = sq .. " " .. sequence[i]
- end
- io.write("\t\t/!\\ Sequence (Lv. "..(dif - 2)..") /!\\\t\t\n\n "..sq)
- system.sleep(1.5)
- os.execute("cls")
- done = done + 1
- end
- io.write("Sequence: ")
- local answer = io.read()
- if answer:gsub(" ","") == table.concat(sequence) then
- os.execute("color 2")
- print("\nSuccess!")
- summon(dif - 2)
- else
- os.execute("color 4")
- print("\nFail!")
- summon(dif - 3)
- end
- end
- summon(0)
Advertisement
Add Comment
Please, Sign In to add comment