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

Username:   Password: 
 RegisterRegister   
 Awesome graphs
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
Homer_simpson




PostPosted: Tue Mar 16, 2004 1:16 pm   Post subject: Awesome graphs

bored
code:

colorback (black)
cls
setscreen ("offscreenonly")
var y, x := 0.0;

color (white)
for t : 1 .. 36000
    x := (sin (t / 10) * 300) * sin (t)
    y := (cos (t / 10) * 200) * sin (t)
    drawdot (round (x) + 320, round (y) + 200, white);
end for
View.Update


code:
colorback (black)
cls
setscreen ("offscreenonly")
var y, x := 0.0;

color (white)
for t : 1 .. 36000
    x := (sin (t / 10) * 300) * cos (t)
    y := (cos (t / 10) * 200) * sin (t)
    drawdot (round (x) + 320, round (y) + 200, white);
end for
View.Update
Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: Tue Mar 16, 2004 1:26 pm   Post subject: (No subject)

code:

setscreen ("offscreenonly")
var y, x := 0.0;
colorback (black)
cls
for i : 3 .. 11
    for t : 1 .. 36000
        x := (sin (t / 10) ** i) * 200
        y := (cos (t / 10) ** i) * 100
        drawdot (round (x) + 320, round (y) + 200, white);
    end for
end for
View.Update



this one will take a while to load
code:
setscreen ("offscreenonly")
var y, x := 0.0;
colorback (black)
cls
for i : 1 .. 399 by 2
    for t : 1 .. 3600
        x := (sin (t / 100) ** 1) * 200
        y := (cos (t / 100) ** i) * 100
        drawdot (round (x) + 320, round (y) + 200, white);
    end for
end for
View.Update



code:
setscreen ("offscreenonly")
var y, x := 0.0;
colorback (black)
cls
for t : 1 .. 36000
    x := ((cos (t / 100)) * 100) + t / 100
    y := ((sin (t / 100)) * 200) + t / 100
    drawdot (round (x), round (y), white);
end for
for decreasing t : 36000 .. 1
    x := ((cos (t / 100)) * 100) + t / 100 + 360
    y := ((sin (t / 100)) * 200) + 360 - (t / 100)
    drawdot (round (x), round (y), white);
end for
View.Update

AsianSensation




PostPosted: Tue Mar 16, 2004 2:13 pm   Post subject: (No subject)

funky, I especially liked the one that took a long time to load, looked like a big giant eye.
Cervantes




PostPosted: Tue Mar 16, 2004 5:59 pm   Post subject: (No subject)

looks cool. I also like the eye one Smile

I notice you've got a bunch of semi-colons in there. Is that a habit from Java? Laughing
Those ; didn't mess up the program. Interesting... I suppose Turing uses those ; but doesn't require them?
Catalyst




PostPosted: Tue Mar 16, 2004 7:05 pm   Post subject: (No subject)

turing seems not to care whether use traditional semi-colons or its system
for example this runs fine
code:

setscreen ("offscreenonly");var y, x := 0.0;colorback (black);cls; for t : 1 .. 36000 x := ((cos (t / 100)) * 100) + t / 100; y := ((sin (t / 100)) * 200) + t / 100;
drawdot (round (x), round (y), white); end for for decreasing t : 36000 .. 1
x := ((cos (t / 100)) * 100) + t / 100 + 360; y := ((sin (t / 100)) * 200) + 360 - (t / 100);
drawdot (round (x), round (y), white); end for View.Update;
recneps




PostPosted: Tue Mar 16, 2004 9:09 pm   Post subject: (No subject)

That explains the setscreen Wink
setscreen("graphics:300;300;nobuttonbar;nocursor;offscreenonly")
is the same as
setscreen("graphics")
setscreen("300;300")
setscreen("nobuttonbar")
setscreen("nocursor")
setscreen("offscreenonly")


the list goes on. Very Happy

And Thats some cool effects homer, i still dont know what sin and cos are exactly.... oh well ill know by June in end of math ;D
SuperGenius




PostPosted: Tue Mar 16, 2004 9:33 pm   Post subject: (No subject)

Very neat.

I also liked the one that looked like an eye. It reminded me of the Eye of Barad-Ur(sp?)... ie. Sauron's tower in lord of the rings
Homer_simpson




PostPosted: Wed Mar 17, 2004 4:36 am   Post subject: (No subject)

Catalyst wrote:
turing seems not to care whether use traditional semi-colons or its system
for example this runs fine
code:

setscreen ("offscreenonly");var y, x := 0.0;colorback (black);cls; for t : 1 .. 36000 x := ((cos (t / 100)) * 100) + t / 100; y := ((sin (t / 100)) * 200) + t / 100;
drawdot (round (x), round (y), white); end for for decreasing t : 36000 .. 1
x := ((cos (t / 100)) * 100) + t / 100 + 360; y := ((sin (t / 100)) * 200) + 360 - (t / 100);
drawdot (round (x), round (y), white); end for View.Update;

lol...
yeah just use ; i dunno... i guess it's a force of habbit...
Sponsor
Sponsor
Sponsor
sponsor
Mazer




PostPosted: Wed Mar 17, 2004 8:13 am   Post subject: (No subject)

SuperGenius wrote:
Very neat.

I also liked the one that looked like an eye. It reminded me of the Eye of Barad-Ur(sp?)... ie. Sauron's tower in lord of the rings

I think it'd be Barad-dur. Something along the lines of 'tower of darkness' or some such evil. And yeah, I totally agree, that's just what I was thinking when I saw it.
Cervantes




PostPosted: Wed Mar 17, 2004 9:14 am   Post subject: (No subject)

what's more is that, when you take the code that catalyst posted, and take iout the ;s it works fine too. You could probably condense short1's pac man into one line of code Laughing
Homer_simpson




PostPosted: Thu Mar 18, 2004 3:12 am   Post subject: (No subject)

setscreen ("offscreenonly")
var y, x := 0.0;
colorback (black)
cls
for i : 1 .. 399 by 2
for t : 1 .. 3600
x := (sin (t / 100) ** 1) * 200
y := (cos (t / 100) ** i) * 100
drawdot (round (x) + 320, round (y) + 200, 44 - ((i div 67) mod 6));
end for
end for
View.Update

makes it look like that eye thingy in lord of the rings =Þ
Mazer




PostPosted: Thu Mar 18, 2004 10:04 am   Post subject: (No subject)

Look at these, I just stumbled upon lituus spirals the other day and I've been playing around with them... who would've imagined math could not suck?

Lituus spiral: r^2 = a^2 / theta

code:

setscreen ("graphics:max;max,nobuttonbar")
var a := 800
var spacing := 1

drawfillbox (0, 0, maxx, maxy, 0)
drawline (maxx div 2, 0, maxx div 2, maxy, 23)
drawline (0, maxy div 2, maxx, maxy div 2, 23)

for i : 1 .. 1080 by spacing
    drawline (maxx div 2 + round (a / sqrt (i) * cosd (i)), maxy div 2 + round (a / sqrt (i) * sind (i)),
        maxx div 2 + round (a / sqrt (i + spacing) * cosd (i + spacing)), maxy div 2 + round (a / sqrt (i + spacing) * sind (i + spacing)), 12)
    drawline (maxx div 2 - round (a / sqrt (i) * cosd (i)), maxy div 2 - round (a / sqrt (i) * sind (i)),
        maxx div 2 - round (a / sqrt (i + spacing) * cosd (i + spacing)), maxy div 2 - round (a / sqrt (i + spacing) * sind (i + spacing)), 12)
    drawline (maxx div 2 + round (a / sqrt (i) * sind (i)), maxy div 2 - round (a / sqrt (i) * cosd (i)),
        maxx div 2 + round (a / sqrt (i + spacing) * sind (i + spacing)), maxy div 2 - round (a / sqrt (i + spacing) * cosd (i + spacing)), 12)
    drawline (maxx div 2 - round (a / sqrt (i) * sind (i)), maxy div 2 + round (a / sqrt (i) * cosd (i)),
        maxx div 2 - round (a / sqrt (i + spacing) * sind (i + spacing)), maxy div 2 + round (a / sqrt (i + spacing) * cosd (i + spacing)), 12)
end for


And this one (takes a little while to run)
code:

setscreen ("graphics:max;max,nobuttonbar")
var spacing := 2
var clr : int

drawfillbox (0, 0, maxx, maxy, 7)
drawline (maxx div 2, 0, maxx div 2, maxy, 23)
drawline (0, maxy div 2, maxx, maxy div 2, 23)

for i : 0 .. 255
    RGB.SetColour (i, i / 255, i / 255, i * 4 / 5 / 255)
end for
for a : 1 .. 800 by 5
    for theta : 1 .. 540 by spacing
        clr := round (a * 255 / 1200)
        Draw.ThickLine (maxx div 2 + round (a / sqrt (theta) * cosd (theta)), maxy div 2 + round (a / sqrt (theta) * sind (theta)),
            maxx div 2 + round (a / sqrt (theta + spacing) * cosd (theta + spacing)), maxy div 2 + round (a / sqrt (theta + spacing) * sind (theta + spacing)), 2, clr)
        Draw.ThickLine (maxx div 2 - round (a / sqrt (theta) * cosd (theta)), maxy div 2 - round (a / sqrt (theta) * sind (theta)),
            maxx div 2 - round (a / sqrt (theta + spacing) * cosd (theta + spacing)), maxy div 2 - round (a / sqrt (theta + spacing) * sind (theta + spacing)), 2, clr)
        Draw.ThickLine (maxx div 2 + round (a / sqrt (theta) * sind (theta)), maxy div 2 - round (a / sqrt (theta) * cosd (theta)),
            maxx div 2 + round (a / sqrt (theta + spacing) * sind (theta + spacing)), maxy div 2 - round (a / sqrt (theta + spacing) * cosd (theta + spacing)), 2, clr)
        Draw.ThickLine (maxx div 2 - round (a / sqrt (theta) * sind (theta)), maxy div 2 + round (a / sqrt (theta) * cosd (theta)),
            maxx div 2 - round (a / sqrt (theta + spacing) * sind (theta + spacing)), maxy div 2 + round (a / sqrt (theta + spacing) * cosd (theta + spacing)), 2, clr)
    end for
end for
AsianSensation




PostPosted: Thu Mar 18, 2004 10:39 am   Post subject: (No subject)

nice, very.
recneps




PostPosted: Thu Mar 18, 2004 1:38 pm   Post subject: (No subject)

pretty cool stuff there mazer, i agree, who thought that math could be remotely cool? Very Happy
sport




PostPosted: Thu Mar 18, 2004 7:09 pm   Post subject: Bored

It seems like the best works come out as a result of being bored, so let's get bored.
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  [ 22 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: