This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MrNorth's profile picture

Basic "For" loops reporting errors

Started by MrNorth, 26 July 2016 - 12:35 PM
MrNorth #1
Posted 26 July 2016 - 02:35 PM
Hello everyone. I'm totally new to forum posting, I'll do my best to make a comprehensible post.
As the title reads, I was fiddling around with CC 1.6 (btw, I'm new to programming) and I could not get a single "for" loop working.
Updated to 1.7 for Minecraft 1.7.10, nothing changed.

for i=1, 10, do
print(i)
end

The error message reads
bios:14:[string "Try"]:1: unexpected symbol

I cannot figure out what I'm doing wrong. Since I'm italian, could it be a keyboard issue? Don't know.
Lyqyd #2
Posted 26 July 2016 - 02:37 PM
If you're not going to use the "step" feature, don't put a comma after the limit. The 2 here is the step:


i = 1, 19, 2 do
The Logo Maker #3
Posted 26 July 2016 - 04:04 PM
to further on from lyqyd moderator , to fix problem simple :


for i = 1, 10 do
    print(i)
end

MrNorth #4
Posted 28 July 2016 - 10:22 AM
As I supposed, it was just me being noob :D/> . thank you everyone