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

Username:   Password: 
 RegisterRegister   
 playing with turing graphics
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
nelson




PostPosted: Wed Dec 31, 2003 5:28 pm   Post subject: playing with turing graphics

heh it's pretty cool

^^
code:


var a, b, x, y : int := 1
var a1, b1, x1, y1 : int := 1
var radius, xx, yy : int
var c, cc : int := 104
var ch : string (1)
randomize

cc := 1
proc abc
    loop
        % randint (c, 20, 103)
        drawline (x, y, x1, y1, black)
        xx := floor ((x1 + x) / 2)
        yy := floor ((y1 + y) / 2)
        radius := floor (sqrt ((x1 - x) ** 2 + (y1 - y) ** 2))


        drawoval (xx, yy, radius, radius, c)     %  <---- try change colour here



        if x > maxx or 1 > x then
            a := (a1) * -1
        end if

        if x1 > maxx or 1 > x1 then
            a1 := (a1) * -1
        end if

        if y > maxy or 1 > y then
            b := (b) * -1
        end if

        if y1 > maxy or 1 > y1 then
            b1 := (b1) * -1
        end if
        delay (5)

        drawline (x, y, x1, y1, white)
        x := x + a
        x1 := x1 + a1
        y := y + b
        y1 := y1 + b1
        c := c + cc
        if c > 254 then
            cc := -1
        end if
        if c < 104 then
            cc := 1
        end if
        exit when hasch
    end loop
    getch (ch)
    return
end abc



loop
    put "press anykey to start a new one"
    delay (500)
    randint (x, 1, maxx)
    randint (y, 1, maxy)
    randint (x1, 1, maxx)
    randint (y1, 1, maxy)
    abc
    delay (500)
    cls
end loop

Sponsor
Sponsor
Sponsor
sponsor
Boarder16




PostPosted: Thu Jan 01, 2004 9:29 pm   Post subject: (No subject)

its one of teh ugliest things i've ever seen in turing Mad ..... Shocked but it's till somewhat complicated programming so its not all that bad........
MUAHAHAHAHHAHAHAHH!!! ahahahahhahahahahaa Twisted Evil

Question Question Question Question Question Question Question
DanShadow




PostPosted: Fri Jan 02, 2004 1:32 pm   Post subject: (No subject)

...lol, I think I remember myself doing the exact same thing when I got bored one day. Although the program is simple, I kind of like how when the line hit the edge, it would do this (slightly) 3D looking spin thing, heh.
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 1  [ 3 Posts ]
Jump to:   


Style:  
Search: