Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 推測, coded in Lua, for ComputerCraft by Kaleb702 is licensed under a
- -- Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
- -- 初期化 --
- do
- numb = math.random(1,100)
- tries = 1
- triesmax = 7
- version = 1.2
- win = false
- end
- -- イントロ --
- do
- term.clear()
- textutils.slowPrint("-------------------------------")
- textutils.slowPrint("suisoku v" .. version)
- textutils.slowPrint("-------------------------------")
- print("Enter wo osite kudasai...")
- io.read()
- print("Anata ha watasi ga kakusite iru suuji wo ateru chance ga 6 kai arimasu")
- end
- -- メイン処理 --
- while true do
- if tries > triesmax then
- break
- else
- print("Watashi ga kakusite iru suuji ha 1-100 no uchi dore deshou? > ")
- guess = io.read()
- guess = tonumber(guess)
- if guess == numb then
- win = true
- break
- else
- print("Hazure desu!")
- if guess > numb then
- print("Sono suuji ha ookii desu")
- elseif guess < numb then
- print("Sono suuji ha chiisai desu")
- else
- print("Nani wo itteiruno desuka?")
- end
- tries = tries + 1
- end
- end
- end
- -- Outro --
- do
- term.clear()
- textutils.slowPrint("Game Over")
- if win == true then
- print("Shousha: Anata")
- else
- print("Shousha: Computer")
- end
- textutils.slowPrint("Thank you for choosing Kapow Creations.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement