Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 exiting loop
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
person




PostPosted: Sat Feb 05, 2005 11:03 am   Post subject: exiting loop

code:

        for h : 1 .. 520 by 80
            for i : 1 .. 560 by 80
                m += m
                if c = 1 + m and whatdotcolor (40 + h, 40 + i) not= 14 and    whatdotcolor (40 + h, 40 + i) not= 1 then
                    drawfilloval (40 + h, 40 + i, 35, 35, 1)
                end if
            end for
        end for


i want this code to exit when the circle is drawn, so how do i do that
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sat Feb 05, 2005 11:41 am   Post subject: (No subject)

You could use a boolean that would be set to true after the circle is drawn, which itself would be checked at the end of each respective loop.
Viper




PostPosted: Sat Feb 05, 2005 1:15 pm   Post subject: (No subject)

couldent u jus do
"exit when h(or i)>= wut ever
mike200015




PostPosted: Sat Feb 05, 2005 1:44 pm   Post subject: (No subject)

Quote:
for h : 1 .. 520 by 80
for i : 1 .. 560 by 80
m += m
if c = 1 + m and whatdotcolor (40 + h, 40 + i) not= 14 and whatdotcolor (40 + h, 40 + i) not= 1 then
drawfilloval (40 + h, 40 + i, 35, 35, 1)
end if
end for
end for

cant you also jus write exit after drawfilloval?? i think that might work, im not totally sure tho.
cool dude




PostPosted: Sat Feb 05, 2005 2:28 pm   Post subject: (No subject)

mike200015 wrote:
Quote:
for h : 1 .. 520 by 80
for i : 1 .. 560 by 80
m += m
if c = 1 + m and whatdotcolor (40 + h, 40 + i) not= 14 and whatdotcolor (40 + h, 40 + i) not= 1 then
drawfilloval (40 + h, 40 + i, 35, 35, 1)
end if
end for
end for

cant you also jus write exit after drawfilloval?? i think that might work, im not totally sure tho.



if all of that is in a loop than u could use exit otherwise u should do it like "Delos" said use a boolean and before the loop set it to false and then after the oval is drawn set it to true
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: