@dave1707 understood about keeping it on one thread. I’ll keep everything contained in this thread from here on forward, regarding this Lua tutorial.
Regarding io.read
When you brought up io.read my other thread - it didn’t stay in my mind after reading your response on my other thread, since at that time, I did not encounter it and never heard of it.
My attention was locked in the responses from you, that were speaking to me… about that particular issue from that thread.
My bad there, I’ll try to keep up in the future, if you bring up something I haven’t encountered yet.
Your Keyboard Code
After typing in your code, I get a bad argument. User Error (meaning me) is now officially in the building!
THOUGHT PROCESS BEHIND CODE PLACEMENT:
1) I placed your code fIrst so the keyboard can come up first when Codea runs the program.
2) I then typed the code from the course
3) I did not type in io.read, since you stated Codea does not have io.read for keyboard input.
4) When I run the code, I receive a bad argument in the console screen
BAD ARGUMENT:
Main:15: bad argument #1 to ‘text’ (string expected, got nil)
stack traceback:
[C]: in function ‘text’
Main: 15: in function ‘draw”
Main:15: bad argument #1 to ‘text’ (string expected, got nil)
stack traceback:
[C]: in function ‘text’
Main: 15: in function ‘draw”
MY CODE:
displayMode(FULLSCREEN)
function setup()
fill(255)
kbKey=""
showKeyboard()
end
function draw()
background(0)
text(kbKey,WIDTH/2,HEIGHT-300)
end
function keyboard(k)
kbKey=k
end
function setup()
print "Guess a number"
math.randomseed(os.time())
math.random()
number = math.random(100)
answer = ("*n")
print(number)
print(answer)
end