Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- USER HOMO TUTORIAL!!!!!!!!!!!!!!!!!!!!
- ]]
- --Eli, tehään tälläne pieni user input game!
- --Ensimmäisenä, tehään "Table", muissa koodauskielissä tunnettu nimellä "Array".
- --Jos muistat mikä on variable, niin Tablet voi sisältää 0-2147483647 variablea (max. luku on integer value, nvm that)
- Possible_gay_answers = {
- "Stupid name.",
- "Gay name.",
- "Sounds like my grandma."
- }
- --Huom, viimeisessä variablessa EI OLE PILKKUA lopussa
- game = true --varmistaa että loop alkaa
- function clear() --funktio clearaamisen nopeuttamiseksi
- term.clear()
- term.setCursorPos(1,1)
- end
- while game do --loop
- clear()
- print("This is a user-input -based game!")
- print("")
- print("")
- print("What is your name?")
- print("")
- write("Your name: ")
- user_in = read()
- if user_in == "shutdown" then
- os.shutdown()
- else
- game = false
- clear()
- print(user_in.."? "..Possible_gay_answers[math.random(1,#Possible_gay_answers)])
- -- ^input nimi ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ random vastaus listasta(copy-pastee ja vaiha tablejen nimet jos haluat)
- game = true
- end
- sleep(1)
- end
Add Comment
Please, Sign In to add comment