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

Username:   Password: 
 RegisterRegister   
 crazy circles
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Misha




PostPosted: Tue Oct 05, 2004 5:00 pm   Post subject: crazy circles

this is my cool random circle program. the circles go crazy!

code:

% Sept 27 2004
% input: there is no input
% output: draw a random sized circle anywhere on the screen
%---------------------------------
var x,y,x2,y2,col : int

randomize
loop

randint (x,20,500)
randint (y,20,500)
randint (x2,1,100)
randint (y2,1,100)
randint (col,1,30)
drawfilloval (x,y,x2,y2,col)

end loop
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Tue Oct 05, 2004 5:37 pm   Post subject: (No subject)

ooo! we should have a poll asking how many of us has done that at one time or another, I'd be expecting a high number.
BTW, try drawfillpolygon
I had some fun with that
Dan




PostPosted: Tue Oct 05, 2004 8:58 pm   Post subject: (No subject)

i like doing it with just draw.dot (or w/e the comand for just one pixeal is) then puting it in a infitenloop and fullscreen. It looks kind of like a messed up t.v. Tho it is intresting to know that in theroy if u randomly pic a color for every pixel on the screen you could have the posbility of making any pic or even a video if it is in the loop. Just that the odds are so very very very low tho.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Paul




PostPosted: Tue Oct 05, 2004 9:59 pm   Post subject: (No subject)

something like this?
code:

var WinID:= Window.Open ('graphics: 319, 319, nobuttonbar')
Window.SetPosition (WinID,300 ,200)
var b: int
loop
for decreasing a: maxy..1
for c: 1..maxx
randint (b, 22, 30)
Draw.Dot (c, a, b)
end for
end for
end loop
djlenny_3000




PostPosted: Wed Oct 06, 2004 8:23 am   Post subject: (No subject)

hey misha #1 i recomend taking of the header for *cough* privacy #2 everyone in our compsci class made that program
gigaman




PostPosted: Wed Oct 06, 2004 8:43 am   Post subject: (No subject)

misha our whole class has a copy of that prgram. oh and paul is right drawfillpolygon is fun
Paul




PostPosted: Wed Oct 06, 2004 10:45 am   Post subject: (No subject)

gigaman wrote:
misha our whole class has a copy of that prgram. oh and paul is right drawfillpolygon is fun

no kidding, show this to ur class lol
code:

setscreen ("graphics: max;max;offscreenonly")
var number: int
put "How many sides?"
get number
colorback (black)
cls
var x : array 1 .. number of int
var y : array 1 .. number of int
var incx: array 1..number of int
var incy: array 1..number of int
for a: 1..number
randint (x(a), 100, maxx-100)
randint (y(a), 100, maxy-100)
incx(a):=Rand.Int(-5,5)
incy(a):=Rand.Int(-5,5) 
end for
loop
for a: 1..number
x(a)+=incx(a)
y(a)+=incy(a)
end for
drawfillpolygon (x, y, number, 12)
View.Update
cls
for a: 1..number
if y(a)>=maxy or y(a) <= 0 then
incy(a):=-incy(a)
end if
if x(a)<=0 or x(a)>=maxx then
incx(a):=-incx(a)
end if
end for
end loop
josh




PostPosted: Wed Oct 06, 2004 1:12 pm   Post subject: (No subject)

wow that is sik. tried to do 500 sides but it crashed turing
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Wed Oct 06, 2004 2:35 pm   Post subject: (No subject)

highest is 499
josh




PostPosted: Wed Oct 06, 2004 4:55 pm   Post subject: (No subject)

kk, I did 1000 but it just didn't start, it didn't crahs though, weird.
rollerdude




PostPosted: Thu Oct 07, 2004 3:14 pm   Post subject: (No subject)

dude ,to make it awsomer, take out the "fill" part.
also, try it with just lines, once my friend put in Draw.MapleLeaf and then did the same thing and it was pretty cool
Juxsta




PostPosted: Thu Oct 07, 2004 5:55 pm   Post subject: (No subject)

Back to the cirles, I just started Turing in class so I do not know a bunch. I was doing the circle exercise and I want to remove the circles in the opposite order in which they were placed. How do you remove a circle? I can fill the circles over in white but i cant remove them. Since you guys are experts how would i go about doing this.

My code thus far . . .
code:

var x, y, z: int
var ovalx : array 1 .. 4000 of int
var ovaly : array 1 .. 4000 of int
loop
for t : 1 .. 4000
    randint (x, 1, maxx)
    randint (y, 1, maxy)
    randint (z, 32, 103)
    ovalx(t) := x
    ovaly(t) := y
    drawfilloval (x, y, 10, 10, z)
    delay (1)
end for
for decreasing t : 4000..1
    drawfilloval (ovalx(t), ovaly(t), 10, 10, 0)
    delay(1)
end for
end loop


And those polygons are amazing, cant wait till i get to animation.
wtd




PostPosted: Thu Oct 07, 2004 5:58 pm   Post subject: (No subject)

Well, the best way I can think of to do it involves records, arrays, and procedures, and I've been yelled at before for mentioning such things, so I'll just be quiet. Smile

Oh, what the heck...

Quote:
Back to the cirles, I just started Turing in class so I do not know a bunch. I was doing the circle exercise and I want to remove the circles in the opposite order in which they were placed. How do you remove a circle? I can fill the circles over in white but i cant remove them. Since you guys are experts how would i go about doing this.


Basically, you want to have your program remember each circle. Rather than just drawing the circle and then forgetting about it, you're going to hang onto that information.

You end up with a list of circles (their location, size, and color). To remove one, remove that circle from the list, clear the screen, and draw them all out again.
apomb




PostPosted: Thu Oct 07, 2004 7:51 pm   Post subject: (No subject)

I've definately seen that polygone one before, but i forgot how amazing it looks if you use 499, it kinda looks like some sort of liqud or something, really cool!

Oh, and try using a color like 18-21, it really looks like liquid then!

Juxta: nice start, with the whole array thing and loops in the first program you submit ... quite impressive!
cool dude




PostPosted: Fri Oct 08, 2004 1:22 pm   Post subject: (No subject)

wow, that polygon animation was awsome! 8) u should make some more tutorials on animation.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 18 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: