For Loop Problem in version 5

73 views
Skip to first unread message

Mohammad Razmi

unread,
Jul 20, 2022, 2:29:37 AM7/20/22
to CupCarbon Forum
hello masters
i'm new with CupCarbon
my problem is this that i cannot use for loop correctly because this command does not increase <b> amount by 1 every time it starts the for loop to reach to its amount of iteration which is 11 in this case.
what is this problem?

set a 7
loop
for b 0 11
set x a*b
print a " X " b " = " x
delay 1000
end

Maimoona Khilji

unread,
Jul 20, 2022, 4:46:44 AM7/20/22
to CupCarbon Forum
Here You have to manually increment the number by adding set b b+1. Here, for loop works best for terminating condition not for increasing the iterating number.

set a 7
loop
for b 0 11
    set x a*b
    print a " X " b " = " x
    delay 1000
    set b b+1
end

Bear Grills

unread,
Sep 17, 2022, 2:02:41 PM9/17/22
to CupCarbon Forum
Guys,  Download CupCarbon there is 5.2 version without problem.
But you have to compile it yourself.
среда, 20 июля 2022 г. в 11:46:44 UTC+3, maimoon...@gmail.com:
Reply all
Reply to author
Forward
0 new messages