38 posts
Posted 04 March 2012 - 02:27 AM
I know that in order to receive an input, it has to be input = read() or Input = read(), I think o.O. However, I recently saw a piece of code that used y = io.read(). I'm assuming this is the same thing as an input, but it labels that input as y or whatever the variable is?
496 posts
Location
Harlem, NY
Posted 04 March 2012 - 02:29 AM
just changes that function to a variable :unsure:/>/> which in that case was y
38 posts
Posted 04 March 2012 - 02:31 AM
just changes that function to a variable :unsure:/>/> which in that case was y
Ah, okay. Thanks!
715 posts
Posted 04 March 2012 - 02:54 AM
Also, since you talked about read() and io.read():
The former is a customized version of io.read(), created with / made for ComputerCraft (see "bios.lua" in
.minecraftmodsComputerCraftlua) and makes it possible to have an input history and/or define a replacement character.
If e.g. you'd use this…
local myInput = read( "*" )
… then it will display every entered character as an asterisk, effectively masking what you type.
38 posts
Posted 04 March 2012 - 10:48 PM
If e.g. you'd use this…
local myInput = read( "*" )
… then it will display every entered character as an asterisk, effectively masking what you type.
Right, right. I was just wondering if io.read() is the only read() function that can label an input a variable.