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

Username:   Password: 
 RegisterRegister   
 Spiral Back & Forth
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bigone150




PostPosted: Tue May 05, 2009 8:25 pm   Post subject: Spiral Back & Forth

Quote:
var k, r, x, y : int
r := 200
loop
randint (k, 1, 255)
% randint (x, 0, maxx)
% randint (y, 0, maxy)
for i : 0 .. 320 by 40
drawarc (200, 200, r, r, i, i + 40, k)
r := r - 1
end for
delay (100)
exit when r < 5
end loop
r:=200
k:=0
loop
%randint (k, 1, 255)
for decreasing i : 340 .. 0 by 20
drawarc (200, 200, r, r, i, i + 40, k)
r := r + 1
end for
delay (100)
exit when r < 200
end loop



umm thats my coding its for a spiral.. but after it goes towards the centre i want it to come back out like a reverse...
Sponsor
Sponsor
Sponsor
sponsor
Ultrahex




PostPosted: Tue May 05, 2009 9:39 pm   Post subject: Re: Spiral Back & Forth

just start the radius at 0 or a small number, and increment instead of decrement it in a for loop.

The only difference between moving into centre and away from centre is the starting point (in terms of radius), and the direction of increment.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: