Computer Science Canada

Cool Trippy Effect

Author:  s_climax [ Sun Apr 25, 2004 7:28 pm ]
Post subject:  Cool Trippy Effect

code:
setscreen ("graphics:512;512")
var col, bbb, ccc, ttt, font, zzz, xxx : int
var cc, tt : int
col := 0
ttt := 1
ccc := 256
bbb := 1
zzz := 0
xxx := 0
tt := 0
cc := 0


loop
    delay (10)

    loop
        delay (10)
        bbb := bbb + 1
        if zzz = 255 then
            xxx := 1
        elsif zzz = 1 then
            xxx := 0
        end if

        col := col + 1

        if xxx = 0 then
            zzz := zzz + 1
            ccc := ccc + 1
            ttt := ttt - 1
        elsif xxx = 1 then
            cc := ccc div 2
            tt := ttt div 2
            zzz := zzz - 1
            ttt := ttt + 2
            ccc := ccc - 2
        end if


        cc := ccc div 2
        tt := ttt div 2

        if col = 1023 then
            drawfilloval (256, 256, 256, 256, 55)
        end if


        drawoval (256, 256, ttt, ttt, 255)
        drawfilloval (256, 256, ccc, ttt, zzz)
        drawfilloval (256, 256, ttt, ccc, zzz)
        exit when col = 1280 or hasch

    end loop
    col := 0
    ttt := 1
    ccc := 256
    bbb := 1
    zzz := 0
    xxx := 0
    tt := 0
    cc := 0
    exit when hasch
end loop


Author:  gamer [ Sun Apr 25, 2004 9:08 pm ]
Post subject: 

true pretty cool, yet simple codes

Author:  s_climax [ Mon Apr 26, 2004 5:32 pm ]
Post subject: 

What's most impressive with this program is that it was one of the first things I made with turing.

Author:  s_climax [ Sun May 02, 2004 8:43 pm ]
Post subject: 

Here are three I made while experimenting with sin/cos. I think the 1st is my best.

code:

setscreen ("graphics:200,200")
var timer, x1, y1, x2, y2, r : int
var pi : real
r := maxx div 2
timer := 0
pi := 3.1415926535897932384626433832795
%drawfilloval (maxx div 2, maxy div 2, maxx div 2, maxy div 2, 7)
for i : 25 .. 25500 by 1
    timer += 1
    x1 := round (r * (sin (timer)))
    y1 := round (r * (cos (timer)))
    x2 := round (r * (sin (timer * pi)))
    y2 := round (r * (cos (timer * pi)))
    drawline ((x1 + r), y1 + r, (x2 + r), y2 + r, i div 100)
    drawline ((y1 + r), x1 + r, (y2 + r), x2 + r, i div 100)
    delay (1)
    exit when hasch
end for




code:

setscreen ("graphics:400,400")
var i, x1, x2, y1, y2, r : int
var pi : real
pi := 3.1415926535897932384626433832795
r := -1 * (maxcol * 21)
i := -1 * (maxcol * 21)
loop
    i += 1
    r += 1
    x1 := abs (round (r * sin (i * pi)))
    y1 := abs (round (r * cos (i * pi)))
    x2 := abs (round (r * sin (i * pi + 1)))
    y2 := abs (round (r * cos (i * pi + 1)))
    drawline (x1, y1, x2, y2, abs (i div 21))
    drawline (maxx - x1, maxy - y1, maxx - x2, maxy - y2, abs (i div 21))
    drawline (maxx - x1, y1, maxx - x2, y2, abs (i div 21))
    drawline (x1, maxy - y1, x2, maxy - y2, abs (i div 21))
    delay (1)
    exit when i > (maxcol * 10)
end loop



code:

setscreen ("graphics:400,400")
var i, x1, x2, y1, y2, r : int
var pi : real
pi := 3.1415926535897932384626433832795
r := -1 * (maxcol * 21)
i := -1 * (maxcol * 21)
loop
    i += 1
    r += 1
    x1 := abs (round (r * sin (i / pi)))
    y1 := abs (round (r * cos (i / pi)))
    x2 := abs (round (r * sin (i / (pi + 1))))
    y2 := abs (round (r * cos (i / (pi + 1))))
    drawline (x1, y1, x2, y2, abs (i div 21))
    drawline (maxx - x1, maxy - y1, maxx - x2, maxy - y2, abs (i div 21))
    drawline (maxx - x1, y1, maxx - x2, y2, abs (i div 21))
    drawline (x1, maxy - y1, x2, maxy - y2, abs (i div 21))
    delay (1)
    exit when i > (maxcol * 10)
end loop

Author:  the_short1 [ Tue May 04, 2004 6:04 pm ]
Post subject: 

setscreen ("graphics:500,500")

LOOKZ WAY BETTER for the first one using sine..


OMFG!!! ththat is SOOOO fucking GOOD!!!!! lookz SO DAM GOOD!!!

here is 10 BITS !!!!!!!!!!


all three look nice...
first one is AMAZING....

crazy ass shit....

im definately impressed... keep up the good work and keep on posting on compsci Smile


btw.... can i add those 3 into my compilation of cool turing visuals (its a huge zip file with tons of them from tons of ppl???) ** i have this on my site and my DL manager...

Author:  s_climax [ Tue May 04, 2004 6:09 pm ]
Post subject: 

Use them all you want. They were easy to make. I didn't even have to understand sin/cos to make them.

By the way, if you are going to make the screen bigger, it looks better to change it to this.

code:

setscreen ("graphics:500,500")
var timer, x1, y1, x2, y2, r : int
var pi : real
r := maxx div 2
timer := 0
pi := 3.1415926535897932384626433832795
drawfilloval (maxx div 2, maxy div 2, maxx div 2, maxy div 2, 7)
for i : 25 .. 25500 by 1
    timer += 1
    x1 := round (r * (sin (timer)))
    y1 := round (r * (cos (timer)))
    x2 := round (r * (sin (timer * pi)))
    y2 := round (r * (cos (timer * pi)))
    Draw.ThickLine ((x1 + r), y1 + r, (x2 + r), y2 + r, 5, i div 100)
    Draw.ThickLine ((y1 + r), x1 + r, (y2 + r), x2 + r, 5, i div 100)
    delay (1)
    exit when hasch
end for

Author:  Paul [ Tue May 04, 2004 7:01 pm ]
Post subject: 

that induces siezures, but while ur at it, make it more accurate by using this line of code
code:

pi:=3.141592653589793238462643383279502884
197169399375105820974944592307816406286208
998628034825342117067982148086513282306647093
844609550582231725359408128

Laughing

Author:  Mazer [ Tue May 04, 2004 7:10 pm ]
Post subject: 

Paul Bian wrote:
that induces siezures, but while ur at it, make it more accurate by using this line of code
code:

pi:=3.141592653589793238462643383279502884
197169399375105820974944592307816406286208
998628034825342117067982148086513282306647093
844609550582231725359408128

Laughing

No you can't. Float's only hold 6 digits after the radix, and with turing it would actually round it to 3.141593. Confused

Author:  the_short1 [ Tue May 04, 2004 7:21 pm ]
Post subject: 

... yea... doesn;t need to get taht acurate anyways... !!!



that is exactly how i had it s_climax... setscreen 500;500.

Author:  Flashkicks [ Wed May 05, 2004 10:02 am ]
Post subject: 

If ya'll want the first couple hundred digits of Pi---Just ask Delta Laughing Rolling Eyes Laughing Shocked .. Too much time on that poor boys hands.... Confused

Author:  Mazer [ Wed May 05, 2004 8:23 pm ]
Post subject: 

I've got the first 10 000 digits (on paper), and about ~80 in my head. But more to the point:
code:

ttt := 1
ccc := 256
bbb := 1
zzz := 0
xxx := 0
tt := 0
cc := 0

Omni, you don't still use variable names that way do you?

Author:  s_climax [ Wed May 05, 2004 8:56 pm ]
Post subject: 

Who's Omni?

If you are directing the question to me, the answer is no.

Author:  Mazer [ Wed May 05, 2004 9:07 pm ]
Post subject: 

Holy crap! This is why I never talk...

yeah, I was referring to you. Sorry if I offended anyone or something.

Author:  Flashkicks [ Thu May 06, 2004 7:20 pm ]
Post subject: 

Mazer--Delta has a lor more than that Rolling Eyes Shocked Rolling Eyes Shocked ..LMBO!!... Hes SUCH A DRUNK!!..lol... Anyhoo.. Yeah..Good luck with the whole thingy and getting success and COOL TRIPPY EFFECTS!.

Author:  the_short1 [ Thu May 06, 2004 9:56 pm ]
Post subject: 

yea tripple letters are kinda redunddant... <<think i spelled that rite... not sure tho...


anyways.....
due to ur 3 kick ass progies... i think i mite reupdate my visuals.zip tomorow... now that i have like 15 nes ones for it..

Author:  kit-kat-kid [ Fri May 07, 2004 12:40 pm ]
Post subject: 

hey for when you set your grpahics its not setscreen
("graphics:400,400")
its
setscreen ("graphics:400;400")

Author:  Dan [ Fri May 07, 2004 2:38 pm ]
Post subject: 

kit-kat-kid wrote:
hey for when you set your grpahics its not setscreen
("graphics:400,400")
its
setscreen ("graphics:400;400")


It is true that the way the turing doc says is to uses a ; but it dose work with a , (at least in 4.0.5).

Author:  s_climax [ Fri May 07, 2004 5:59 pm ]
Post subject: 

Here's another cool thing. What's unique about this one is that I actually understand why it works.

code:

setscreen ("graphics:500,500;offscreenonly")
colorback (black)
cls
var worms, randomness : int
worms := 8
randomness := 10
var x, y, dir : array 1 .. worms of real
var ang : array 1 .. worms of int
var ix, iy, count : int
var speed : real
speed := 1
count := 0
for i : 1 .. worms
    % randint (ix, 0, maxx)
    % randint (iy, 0, maxy)
    % x (i) := intreal (ix)
    % y (i) := intreal (iy)
    dir (i) := 180
    x (i) := maxx div 2
    y (i) := maxy div 2
    randint (ang (i), 0, 360)
end for
loop
    %cls
    for i : 1 .. worms
        dir (i) += intreal (ang (i))
        randint (ang (i), -1 * randomness, randomness)
        x (i) += cosd (dir (i)) * speed
        y (i) += sind (dir (i)) * speed
        delay (0)
        if x (i) > 0 and x (i) < maxx and y (i) > 0 and x (i) < maxy then
            count := 0
        else
            count := count + 1
        end if
        drawfilloval (round (x (i)), round (y (i)), 1, 1, i)
    end for
    exit when hasch or count >= 2
    View.Update
end loop


Author:  the_short1 [ Fri May 07, 2004 11:11 pm ]
Post subject: 

my bad.... i wrote , isntead of ;

hhahah... well u got the point of making the screen bigger...


i dont use setscreen...
i use
View.Set... acually i dont use that much these days either..

the best way in my opinion


var wind : int := Window.Open ("graphics788;540,title: Kevin's Cool Program,nobuttonbar,position:center;center,offscreenonly")


taht way i can close the window at the end.. neat eh...??
Window.Close (wind)





wow... that program is simple but complex at the same time...
i like it LOTS!!!! keep the good stuff rolling...

Author:  greenapplesodaex [ Sun May 09, 2004 7:47 am ]
Post subject:  reply

wohohohoho, trippy, man! @_@


: