1
Let’s say I have something like
a = io.read()
a = tonumber(a)
if a then
print(a,a^2-1)
end
There’s another way to get in this driveway other than the io.read()
?
1
Let’s say I have something like
a = io.read()
a = tonumber(a)
if a then
print(a,a^2-1)
end
There’s another way to get in this driveway other than the io.read()
?
1
Ready in the library is that right there. Always have several ways to get the same, but if you want to read from the console is the best way. Example:
local stdin = io.stdin:lines()
for line in stdin do
print(line)
end
Behold working in the ideone. And in the repl it.. Also put on the Github for future reference.
If you want to read other fonts there are several other ways. There are documentation.
thanks for the help :D
Browser other questions tagged lua
You are not signed in. Login or sign up in order to post.
Because you need another way?
– Maniero
I was just curious if there was any other way than io.read()
– cand
Picks value from where? File, user typing, or what?
– Bacco
preferred user typing, but can be from tbm file
– cand