• Welcome to Dark Bit Factory & Gravity.
 

Lame problem with simple loop

Started by theron, November 26, 2011

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

theron

Why loop in line 26 does not work, and the program did not draw another flower?
screenres 320,240
draw "bm 160,120"
draw "c50"
draw "U50,R10,D50,L10"
draw "TA45"
draw "U50,R10,D50,L10"
draw "TA90"
draw "U50,R10,D50,L10"
draw "TA135"
draw "U50,R10,D50,L10"
draw "TA180"
draw "U50,R10,D50,L10"
draw "ta225"
draw "U50,R10,D50,L10"
draw "ta270"
draw "U50,R10,D50,L10"
draw "ta315"
draw "U50,R10,D50,L10"
sleep 500
cls
draw "bm 160,120"
draw "ta0"
draw "c100"
draw "U50,R10,D50,L10"
dim x as integer
for x=0 to 315 step 45
draw"TA x"
draw "U50,R10,D50,L10"
next x
sleep


Rbz

To work with draw command, you need to convert "x" variable into string.
QuoteTAn  =  Rotate n degrees (n ranges 0-359)

So change this line:
draw"TA x"
to
draw"TA"+str(x)

Challenge Trophies Won:

theron

Thanks for your help. I'll try your advice.

theron