Computer Science Canada

Matrix

Author:  Solo [ Thu May 22, 2003 9:27 am ]
Post subject:  Matrix

code:
var mainWindow := Window.Open ("graphics:640;400")  % Opens Main Window
var font := Font.New ("Symbol:7")                   % Font Variable
var fn : int                                        % File Number Variable
colorback (black)                                   % Setting backround color
cls

var screencolor1 : array 0 .. 90, 0 .. 56 of int    % Screen Picture 1
var screencolor2 : array 0 .. 90, 0 .. 56 of int    % Screen Picture 2


var temp1 : array 1 .. 90 of int                    % Make sure to not redraw a strand over another one
var rand2 : int                                     % Randomize the Strand Placement

/* Key Features
 - Capture Screen Procedure to quickly get the screen for later use.
 - Easy to make ur own designs
 - Has Multi-Purpose getscreen procedure that will show anything stored in a file
 - Ability to switch pictures and have different numbers of pictures show
 - Pretty much can show any picture that isnt too colorfull or full of dark shades
 */

%%%%%%%%%%%%%%% Caputre the screen for a later use. This is used to get the screen %%%%%%%%%%
proc capturescreen (num : int)
    open : fn, "screenshot" + intstr (num) + ".txt", put % Opens the file
    for i : 1 .. maxx - 7 by 7
        for x : 1 .. maxy - 7 by 7
            put : fn, whatdotcolor (i, x), " " .. % Puts in the File
        end for
        put : fn, ""
    end for
end capturescreen
/*Here is where you could put the stuff you want to capture to the file.. and you would
 uncomment the return */

%return

% This procedure gets the screen from the file and stores them into arrays for later use %
proc getscreen (var input : array 0 .. *, 0 .. * of int, num : int)
    open : fn, "screenshot" + intstr (num) + ".txt", get % Opens specified file for put
    for i : 1 .. maxx - 7 by 7
        for x : 1 .. maxy - 7 by 7
            get : fn, input (i div 7, x div 7)
        end for
    end for
end getscreen

getscreen (screencolor1, 1) % Gets the 2 picture files.
getscreen (screencolor2, 2) % Change the 2 here to a 3 to see the difference

% This is the main Part of my program. It randomizes and figures out what colors the strands and
% each symbol needs to be drawn at and where they need to be drawn
process drawstrand (y : int)
    var newp : int := 0 % Cycles thru the different pictures
    loop % Loop to keep it going
        var dela := Rand.Int (100, 500) % Random delay to start at different times
        var symbol : array 0 .. 90 of int % Keep all the symbols so i can redraw them black
        var count := 0
        delay (dela) % The random delay
        for decreasing i : maxy - 14 .. 1 by 7
            var rand1 := Rand.Int (100, 120)
            symbol (count) := rand1
            if newp mod 2 = 0 then
                Font.Draw (chr (rand1), y * 7, i, font, screencolor2 (y, i div 7)) % draws the symbol
            else
                Font.Draw (chr (rand1), y * 7, i, font, screencolor1 (y, i div 7)) % draws the symbol
            end if
            delay (50) % Delay duh..
            count += 1
        end for
        count := 0
        for decreasing i : maxy - 14 .. 1 by 7
            Font.Draw (chr (symbol (count)), y * 7, i, font, black) %clear the symbol with approprite symbol
            count += 1
            delay (50)
        end for
        newp += 1
    end loop
end drawstrand

% Temperary random number storage
for i : 1 .. 90
    temp1 (i) := 0
end for

% Main for loop
for i : 1 .. 90
    loop % Make sure that i dont get the same strand
        rand2 := Rand.Int (1, 90) % Random strand
        var safexit := true % checker to see if strand is used
        for x : 1 .. 90 % check and randomize for loop
            if temp1 (x) = rand2 then
                safexit := false
            end if
        end for
        exit when safexit = true
    end loop
    temp1 (i) := rand2
    fork drawstrand (rand2) % Fork the strand draw
end for



Just put the textfiles in the same folder Smile

Author:  Mazer [ Thu May 22, 2003 11:19 am ]
Post subject: 

good shit, +51 bits

Author:  Catalyst [ Thu May 22, 2003 2:38 pm ]
Post subject: 

Very Cool man +2 bits (gives u an even 69 Very Happy )

Author:  Martin [ Thu May 22, 2003 3:16 pm ]
Post subject: 

I think it's terrible. Have you considered suicide?

Author:  Solo [ Thu May 22, 2003 3:21 pm ]
Post subject:  Yes

Yes, i have, you have just brought up some serious subjects in my life.

Tonite i will be cutting my wrists. That is all















No, but seriously, me and Darkness go to the same school and we are really good friends, so if we make stupid jokes like this, or he makes fun of me. Its all in good fun.


Btw, thanks catalyst.. hey, could you give me some ideas on how to do that without processes?

Author:  Catalyst [ Thu May 22, 2003 4:23 pm ]
Post subject: 

make all your varibles in big arrays
use records(makes it nicer to code)

Author:  whowho [ Thu May 22, 2003 4:54 pm ]
Post subject: 

Very Happy Razz who is Na Po

Author:  HeTeRiC [ Sat Nov 22, 2003 5:26 pm ]
Post subject: 

That is sick!!
I LOVE MATRIX!!!!!!!!!
NEO IS THE ULTIMATE!!!!!

Author:  poly [ Sat Nov 22, 2003 5:49 pm ]
Post subject: 

that kicks some royal ASS! good job

Author:  thoughtful [ Sat Nov 22, 2003 7:04 pm ]
Post subject: 

you should make a screen saver out of that cause its really good.

Author:  santabruzer [ Sat Nov 22, 2003 7:38 pm ]
Post subject: 

i swear solo has too much time on his hands Razz .... Very good job .....

Author:  Andy [ Sun Nov 23, 2003 3:47 pm ]
Post subject: 

solo, you go to massey? whats ur name?

Author:  Mazer [ Sun Nov 23, 2003 11:02 pm ]
Post subject: 

it's aleks, and man this is so old... he doesn't even go to these forums any more

Author:  recneps [ Thu Dec 25, 2003 3:04 pm ]
Post subject: 

how did you get that sig pic with the spinnin name? it looks just like mazers 3d text thing..

Author:  Mazer [ Thu Dec 25, 2003 5:42 pm ]
Post subject: 

hehe, i made that for him Razz

EDIT: i actually had a better one, it was pretty much the same except it had a picture of jabba the hutt in the background and it said "Hoh hoh hoh... Solo!"

Author:  recneps [ Fri Dec 26, 2003 2:53 pm ]
Post subject: 

lolk, but howd you make it?

Author:  Mazer [ Sat Dec 27, 2003 7:52 am ]
Post subject: 

if you mean how i did the picture using the text effect, i'll post up an actual tutorial soon. if you mean how i made the picture with jabba in the background, i did it the same way except i had turing draw the picture before the dots.

Author:  recneps [ Sat Dec 27, 2003 12:18 pm ]
Post subject: 

i mean, how did you make it animated gif Smile (or whatever format it is)

Author:  Mazer [ Sat Dec 27, 2003 12:32 pm ]
Post subject: 

oh....

ok, i wrote the program to animate the spinning, then i just made it save a picture for every frame, and then i got another program (not made by me) that takes a whole bunch of seperate pictures and turns them into one animated gif. i can't remember what it was called though, which is too bad because it was a really good program. it did exactly what it needed too, and didn't have any extra junk. plus it was free, it's amazing how many shitty animated gif creator programs there are that people expect you to pay for. Rolling Eyes

Author:  recneps [ Sat Dec 27, 2003 8:53 pm ]
Post subject: 

cool Smile

Author:  Boarder16 [ Sun Dec 28, 2003 7:52 pm ]
Post subject: 

I treid running your code and i go this error message, i don't know what to do.... it is from this line in the code

get : fn, input (i div 7, x div 7)

ERROR MESSAGE : I/O attempted on unopened stream number -10. Open failed with message 'File "C:\PROGRA~1\Turing\Screenshot1.txt" not found'.

Author:  AsianSensation [ Sun Dec 28, 2003 9:50 pm ]
Post subject: 

need to have the text files also in the same folder as the source code. Then it will work

Author:  DanShadow [ Mon Dec 29, 2003 3:17 pm ]
Post subject: 

Error:
Attempt to read past eof


hmm...why does everybody elses work... Confused
And all the txt files are in the same folder...

Author:  AsianSensation [ Mon Dec 29, 2003 10:02 pm ]
Post subject: 

add this at the beginning of the loop

exit when eof (whatever he named his file)

like if I declared fin as the variable that's responsible for my input from textfile, I would do: exit when eof (fin)

Author:  drutherford [ Tue Jan 13, 2004 7:18 pm ]
Post subject:  Dammmnit i cant get it to work

hi its my first post Razz and i really want to see this matrix ptrogram but cant get it to work. i just had my first class today in grade 10 computer studies on input "Hello" yEAHHHHh FUNNN!! Twisted Evil anyhow someone hlp me and dont just say put it in folder, in what folde rare you tlaking about. Im a noob.

Author:  pink00rock [ Mon Feb 09, 2004 3:38 pm ]
Post subject: 

ahhhhhhhh it won't work for me! lol it gives me some error saying

"attempt to read past eof" lol anddddd i'm just a newbie! awwwww..

yeah i was just hoping it would work for me.. guess not lol

well ttyl bye

Author:  naoki [ Mon Feb 09, 2004 4:41 pm ]
Post subject: 

they're saying put the textfile in the same folder as where you're currently storing your program

Author:  Delta [ Mon Feb 09, 2004 7:32 pm ]
Post subject: 

frickin' piece of crap! Evil or Very Mad this program isn't working!
I fixed the attempt to read past file error... but I get a different one

ERROR : Process "drawstrand":Variable has no value

Highlights : Font.Draw (chr (rand1), y * 7, i, font, screencolor2 (y, i div 7)) % draws the symbol

hmmm... I couldn't get it Sad some one... anyone.... HELP!

Author:  netninja [ Wed Feb 11, 2004 10:41 am ]
Post subject: 

Hmm, why doesnt mine want to work?

it says attempt to read past eof...

lol what the HELL is that

Author:  Andy [ Wed Feb 11, 2004 10:44 am ]
Post subject: 

eof is end of file
u have to have ur exit statement as exit when eof(fid) where fid is the var u delcared to get files

Author:  netninja [ Thu Feb 12, 2004 7:42 am ]
Post subject: 

Hmm, I dont exactly know how to do what you said.

Author:  Paul [ Thu Feb 12, 2004 3:39 pm ]
Post subject: 

If Im not mistaken. He's saying you have to have an exit statement like:
code:

exit when eof(fid)

fid is the variable you declared to get files, it doesn't have to be fid, just whatevers in the program.

Author:  octopi [ Thu Feb 12, 2004 7:25 pm ]
Post subject: 

To get it to work, I had to change the 90's near the bottom to 60's to get it to work for me.

There are three 90's...all after the Main Loop comment.

Author:  GUI.GetScrollBarWidth : i [ Fri Feb 13, 2004 5:41 pm ]
Post subject: 

wow, that looks so cool. but can i make my own txt files. or does it only work with the 1's put provided

Author:  besart [ Fri Feb 13, 2004 9:34 pm ]
Post subject: 

i dont understand, i still get an error

Author:  Tony [ Fri Feb 13, 2004 10:02 pm ]
Post subject: 

besart wrote:
i dont understand, i still get an error


you still get an error? I think there's something wrong with your statement seeing as this is your first post Laughing what kind of error are you getting? Confused

Author:  Jodo Yodo [ Sat Mar 06, 2004 10:27 pm ]
Post subject: 

I'd give you bits, but I have to hoard them!

Author:  jonos [ Sat Mar 06, 2004 11:10 pm ]
Post subject: 

this is old!!!

Author:  AsianSensation [ Sat Mar 06, 2004 11:58 pm ]
Post subject: 

Jodo Yodo wrote:
I'd give you bits, but I have to hoard them!


quit spamming David.

Author:  jonos [ Sun Mar 07, 2004 12:01 am ]
Post subject: 

yes quit spamming.

and its not necessary to bring back up old topics.

Author:  gamer [ Wed Apr 14, 2004 4:42 pm ]
Post subject: 

i stil get the error of eof, where do i exactly put exit when eof (fn) ??
or wut else do i put?

Author:  gamer [ Thu Apr 15, 2004 6:42 pm ]
Post subject: 

somebody plz help....i relli wanna see the matrix thing

Author:  Prettyjnk [ Thu Apr 29, 2004 3:17 pm ]
Post subject: 

how come i can't see it, Sad

Author:  r0ssar00 [ Thu Oct 07, 2004 9:09 am ]
Post subject:  help!

i have the text files in the right spot, i put the
code:

exit when eof (fn)

in the right spot, is the arg supposed to be fn, plz take a look at the original code and let me know, also, there will probly be more errors.
Why didnt the author iron all of it out first?

Author:  Mazer [ Thu Oct 07, 2004 11:35 am ]
Post subject: 

It's been over a year since the original author posted this code. It's been over a year since he's come to this messageboard. He doesn't use turing anymore, nor does he care about this program. Could we all just drop it? It's a little annoying to see people come by every once in a while and dig up this topic to ask Solo a question about it.

EDIT: no offense to you r0ssar00

Author:  zomg [ Wed Oct 13, 2004 10:49 am ]
Post subject: 

Embarassed

Author:  apomb [ Thu Oct 14, 2004 12:25 am ]
Post subject: 

man, did you not read the last post by coutsos? ... he doesnt come here any more, he doesnt care about bits, drop it!


: