Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[This program made by Max Thor (AKA. Mackan90096.) You may use this in any of your program(s) as long as
- credit is given]]--
- -- Variables --
- stringCount = 0
- oldY = 2
- newY = oldY + 1
- stringNum = 1
- -- Tables --
- local strings = { }
- -- End Tables --
- -- End Variables --
- function check()
- if stringCount == tonumber(numb) then
- randomString = strings[math.random(#strings)]
- term.clear()
- term.setCursorPos(1,1)
- print("Your random string is: "..randomString)
- error()
- else
- term.setCursorPos(1,newY)
- write("String number: "..stringNum..": ")
- inputString = read()
- table.insert(strings, inputString)
- stringCount = stringCount + 1
- stringNum = stringNum + 1
- newY = newY + 1
- check()
- end
- end
- function main()
- term.clear()
- term.setCursorPos(1,1)
- write("How many strings> ")
- numb = read()
- check()
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement