Posts by cand • 161 points
5 posts
-
1
votes1
answer388
viewsQ: How to read a file in the same script directory using Lua
I’m trying to make a small script, but I’m facing some difficulties local lab = nil local f = io.open("/input-lab.txt", "r") print(f) I wanted to open a file that is in the same directory as the…
-
1
votes1
answer38
viewsQ: Problem with search and insertion function
I tried to write the code below out of curiosity. For some reason, even after doing the functions of insertion and verification (checks if a value exists within the array), the return is that there…
-
1
votes1
answer192
viewsQ: Problem with C code
I have a problem to solve in C which is as follows: Read a double precision number and calculate the minimum amount of 100, 50, 20, 10, 2 and 1 real, 50 cents, 25 cents, 10 cents, 5 cents and 1 cent…
-
1
votes2
answers124
viewsQ: how do I make a table go showing tables
wanted to do a function that makes kind of something like the thing below for i in pairs(v) do if type(v[i])=="table" then for j in pairs(v[i]) do if type(v[i][j])=="table" then print("...") else…
-
1
votes1
answer225
viewsQ: How do I get a value in Lua without using io.read()?
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()?…