Posted 13 April 2013 - 02:49 AM
Hi ive got a problem with my program. this program is made for making a file with locations (it's not finished i experiment a lot in small programs)
the locations are numbers with a x (row) and an y (long) coordinate. but when it writes a line to the file he places a decimal to the line. this is the program:
and this is an examples of what it can make
the locations are numbers with a x (row) and an y (long) coordinate. but when it writes a line to the file he places a decimal to the line. this is the program:
term.clear()
term.setCursorPos(1,1)
abc = fs.exists("storevars")
print("how many rows do youve got?")
write("rows:")
row_input = io.read()
row_input = tonumber(row_input)
print("how many chest do you got in a row?")
write("this many:")
long_input = io.read()
long_input = tonumber(long_input)
starterrow_input = 1
starterlong_input = 1
storevars = fs.open("storevars", "w")
long_input = long_input+1
row_input = row_input+1
while starterrow_input < row_input do
while starterlong_input < long_input do
writing = starterrow_input*100+starterlong_input
storevars.writeLine(writing)
print("wrote "writing" to the file")
starterlong_input=starterlong_input+1
end
starterrow_input=starterrow_input+1
starterlong_input=1
end
storevars.close()
print("done")
and this is an examples of what it can make
101.0
102.0
103.0
104.0
105.0
106.0
107.0
108.0
109.0
110.0
201.0
202.0
203.0
204.0
205.0
206.0
207.0
208.0
209.0
210.0
301.0
302.0
303.0
304.0
305.0
306.0
307.0
308.0
309.0
310.0
401.0
402.0
403.0
404.0
405.0
406.0
407.0
408.0
409.0
410.0
501.0
502.0
503.0
504.0
505.0
506.0
507.0
508.0
509.0
510.0
how can you let the program write no decimals?