Computer Science Canada

Plasma

Author:  RaPsCaLLioN [ Tue Mar 22, 2005 11:59 pm ]
Post subject:  Plasma

Has anyone posted anything like this before?

code:
var iWindow : int := Window.Open ("offscreenonly, graphics:200;200, noecho, nocursor")

var iColour : int
var x, y : int
var rArb : real
var rTime : real

procedure ColourSet (R, G, B : int)
    % for i : 1 .. 64
    %     RGB.SetColor (i, R * i / 64, G * i / 64, B * i / 64)
    % end for
    % for i : 65 .. 128
    %     RGB.SetColor (128 + 65 - i, R * i / 64, G * i / 64, B * i / 64)
    % end for
    % for i : 129 .. 192
    %     RGB.SetColor (i, R * i / 64, G * i / 64, B * i / 64)
    % end for
    % for i : 193 .. 256
    %     RGB.SetColor (256 + 193 - i, R * i / 64, G * i / 64, B * i / 64)
    % end for
    for i : 129 .. 192
        RGB.SetColor (i, 0, 0, 1 + i / 64)
    end for
    for i : 193 .. 256
        RGB.SetColor (256 + 193 - i, 0, 1 + i / 64, 1)
    end for
    for i : 1 .. 64
        RGB.SetColor (i, 0, 1 + i / 64, 1 - i / 64)
    end for
    for i : 65 .. 128
        RGB.SetColor (128 + 65 - i, 0, 1 + i / 64, 0)
    end for
end ColourSet

ColourSet (1, 0, 0)

loop
    rTime := Time.Elapsed /75
    for i : 1 .. maxx by 2
        for j : 1 .. maxy by 2
            rArb := sin (Math.Distance (i + rTime, j, 128.0, 128.0) / 8.0)
                + sin (Math.Distance (i, j, 64.0, 64.0) / 8.0)
                + sin (Math.Distance (i, j + rTime / 7, 192.0, 64) / 7.0)
                + sin (Math.Distance (i, j, 192.0, 100.0) / 8.0)
            iColour := round ((4 + rArb)) * 32
            % iColour := round (128.0 + (128.0 * sin (sqrt ((i - maxx / 2.0) * (i - maxx / 2.0) + (j - maxy / 2.0) * (j - maxy / 2.0)) / 8.0)))
            if iColour < 2 or iColour > 256 then
                iColour := 2
            end if
            drawfillbox (i, j, i + 1, j + 1, iColour - 1)
        end for
    end for
    Window.Update (iWindow)
    exit when buttonmoved ("down")
end loop

Window.Close (iWindow)

Author:  zylum [ Wed Mar 23, 2005 12:57 am ]
Post subject: 

pretty slick Wink + 50 bits

Author:  RaPsCaLLioN [ Wed Mar 23, 2005 8:53 pm ]
Post subject: 

Thx zylum. Guess nobody else cares. People would rather reply on 2 yr old threads Sad

Author:  ssr [ Wed Mar 23, 2005 9:17 pm ]
Post subject: 

lol that is good
remind me of something ummm...

Author:  GlobeTrotter [ Wed Mar 23, 2005 11:08 pm ]
Post subject: 

How do you figure these things out? Is it just a bunch of guess and check, putting some trig statements and seeing what you get? It's really crazy good.

Author:  Naveg [ Wed Mar 23, 2005 11:25 pm ]
Post subject: 

very cool!

Author:  Mr. T [ Thu Mar 24, 2005 1:31 am ]
Post subject: 

good ol' fashion hippy psychadelic freak out

Author:  Tony [ Thu Mar 24, 2005 9:27 am ]
Post subject: 

defenatly better than random "omg, look at screen flash different colours" crap we've been getting lately. I like this one Smile
+25Bits

Author:  Mazer [ Thu Mar 24, 2005 9:35 am ]
Post subject: 

RaPsCaLLioN wrote:
Thx zylum. Guess nobody else cares. People would rather reply on 2 yr old threads Sad

You know damn right we would. Now where the hell did that matrix thread go...

Just kidding. Good shit, rapscallion.

Author:  Token [ Thu Mar 24, 2005 2:10 pm ]
Post subject: 

wow this is really cool, i like how they melt together and stuff, lol pwned is right, it reminds me of those hippy things off that 70's show, keep it up man

Author:  RaPsCaLLioN [ Fri Mar 25, 2005 2:44 pm ]
Post subject: 

Thx for the comments guys - I'll post some variances of the sins when i get home tonight...

Author:  post8k [ Fri Mar 25, 2005 5:05 pm ]
Post subject: 

Nice program.... !!
i liked it...

Author:  RaPsCaLLioN [ Sat Mar 26, 2005 9:57 am ]
Post subject: 

Try this variation...

code:
var iWindow : int := Window.Open ("offscreenonly, graphics:200;200, noecho, nocursor")

var iColour : int
var x, y : int
var rArb : real
var rTime : real
var iRes : int := 2
var sChar : string (1)

procedure ColourSet (R, G, B : int)
    for i : 1 .. 128
        RGB.SetColor (i, 1 + i / 128, .5, .5)
    end for
    for i : 129 .. 256
        RGB.SetColor (256 + 129 - i, 1 + i / 128, .5, .5)
    end for
end ColourSet

ColourSet (1, 0, 0)

loop
    rTime := Time.Elapsed / 100
    for i : 1 .. maxx by iRes
        for j : 1 .. maxy by iRes
            rArb := sin (Math.Distance (i + rTime, j, 128.0, 128.0) / 8.0)
                + sin (Math.Distance (i, j, 64.0, 64.0) / 8.0)
                + sin (Math.Distance (i, j + rTime / 7, 192.0, 64) / 7.0)
                + sin (Math.Distance (i, j, 192.0, 100.0) / 8.0)
            iColour := round (64 + 63 * sin (i / (37 + 15 * cos (j / 74))) * cos (j / (31 + 11 * sin (i / 57))) * +rArb)
            if iColour < 2 or iColour > 256 then
                iColour := 2
            end if
            drawfillbox (i, j, i + iRes - 1, j + iRes - 1, iColour - 1)
        end for
    end for
    if hasch then
        getch (sChar)
        if ord (sChar) = 200 then
            if iRes < 8 then
                iRes += 2
            end if
        elsif ord (sChar) = 208 then
            if iRes > 2 then
                iRes -= 2
            end if
        end if
    end if
    Window.Update (iWindow)
    exit when buttonmoved ("down")
end loop

Window.Close (iWindow)

Author:  jamonathin [ Sat Mar 26, 2005 10:00 am ]
Post subject: 

that one's much cooler than the first one, gj.

Author:  RaPsCaLLioN [ Sat Mar 26, 2005 10:18 am ]
Post subject: 

I just made an EDIT to that last post. I included a resolution switch. Use UP/DOWN to change resolution. This could also help if you want to increase screen size.

Author:  zylum [ Sat Mar 26, 2005 1:17 pm ]
Post subject: 

much better! another 20 bits awarded!

Author:  AsianSensation [ Sat Mar 26, 2005 8:45 pm ]
Post subject: 

I think I'll top that by giving double.

+40 bits.

Hell, + another 20 bits just because I like it.

Like tony said, definitely better than the "ZOMG! It's flashing!!" programs that we've been getting.

Author:  zylum [ Sun Mar 27, 2005 12:02 am ]
Post subject: 

lol, i gave 70 total (read my previous post) and you only gave 60... i guess i win Wink

Author:  RaPsCaLLioN [ Sun Mar 27, 2005 12:41 am ]
Post subject: 

lol
Nice to know ppl are fighting over who gives me the most bits Very Happy

Has anyone else played with the code and made anything of it themselves?

Author:  AsianSensation [ Sun Mar 27, 2005 1:16 am ]
Post subject: 

zylum wrote:
lol, i gave 70 total (read my previous post) and you only gave 60... i guess i win Wink


oooooo, so that's how it's going to be. Very Happy lol.

well, check and match.

+10 bits.

Author:  Mr. T [ Sun Mar 27, 2005 11:14 pm ]
Post subject: 

its 70 - 70 now

and if you had won the battle, you would have said "checkmate," not "check." LOL

Author:  Mr. T [ Sun Mar 27, 2005 11:19 pm ]
Post subject: 

Check out this uber edit! (adjust the resolution for psychadellic squares)
It's uber!
and
It's an edit!
You cant lose!
-------------------
code:
var iWindow : int := Window.Open ("offscreenonly, graphics:200;200, noecho, nocursor")

var iColour : int
var x, y : int
var rArb : real
var rTime : real
var iRes : int := 2
var sChar : string (1)

procedure ColourSet (R, G, B : int)
    for i : 1 .. 128
        RGB.SetColor (9, 1 + 9 / 128, .5, .5)
    end for
    for i : 129 .. 256
        RGB.SetColor (256 + 129 -  9, 1 + 9 / 128, .5, .5)
    end for
end ColourSet

ColourSet (1, 0, 0)

loop
    rTime := Time.Elapsed / 100
    for i : 1 .. maxx by iRes
        for j : 1 .. maxy by iRes
            rArb := sin (Math.Distance (i + rTime, j, 128.0, 128.0) / 8.0)
                + sin (Math.Distance (0, j, 64.0, 64.0) / 8.0)
                + sin (Math.Distance (i, j + rTime / 7, 192.0, 64) / 7.0)
                + sin (Math.Distance (i, j, 192.0, 100.0) / 8.0)
            iColour := round (64 + 63 * sin (i / (37 + 15 * cos (j / 74))) * cos (j / (31 + 11 * sin (i / 57))) * +rArb)
            if iColour < 2 or iColour > 256 then
                iColour := 2
            end if
            drawfillbox (i, j, i + iRes - 1, j + iRes - 1, iColour - 1)
        end for
    end for
    if hasch then
        getch (sChar)
        if ord (sChar) = 200 then
            if iRes < 8 then
                iRes += 2
            end if
        elsif ord (sChar) = 208 then
            if iRes > 2 then
                iRes -= 2
            end if
        end if
    end if
    Window.Update (iWindow)
    exit when buttonmoved ("down")
end loop

Window.Close (iWindow)

Author:  Naveg [ Sun Mar 27, 2005 11:31 pm ]
Post subject: 

all you did was change the colours no?

Author:  Mr. T [ Sun Mar 27, 2005 11:32 pm ]
Post subject: 

see for yourself.

Author:  Naveg [ Sun Mar 27, 2005 11:34 pm ]
Post subject: 

i did, and it looks like all you did was change the colours

what do you mean by squares and changing resolution?

Author:  Mr. T [ Sun Mar 27, 2005 11:35 pm ]
Post subject: 

but it on the worst possible resolution, and it has those flashy squares.
reminds of the old snes super mario. when u laoded into a level, those blurry little squares were used as intro. Smile

Author:  RaPsCaLLioN [ Sun Mar 27, 2005 11:44 pm ]
Post subject: 

Vladimir wrote:
i did, and it looks like all you did was change the colours

what do you mean by squares and changing resolution?


i changed it so u can decrease/increase the resolution using the up/down arrow keys...

and Pwned..... i don't understand how ppl find flashing squares amusing. Ur like a moth to a porch light. Ur mis-using my code and I won't stand for that! Very Happy

Author:  Mr. T [ Sun Mar 27, 2005 11:50 pm ]
Post subject: 

ya, sorry, i took the sophistication out of it

Author:  Spartan_117 [ Sun May 29, 2005 5:03 pm ]
Post subject: 

it says Distance is not in export list of Math

Author:  Mr. T [ Sun May 29, 2005 5:59 pm ]
Post subject:  Alex's Opinion

You're probably using an older version of Turing. Wink


: