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

Username:   Password: 
 RegisterRegister   
 Matrix
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2, 3, 4  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Solo




PostPosted: 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



screenshot2.txt
 Description:

Download
 Filename:  screenshot2.txt
 Filesize:  14.35 KB
 Downloaded:  992 Time(s)


screenshot1.txt
 Description:

Download
 Filename:  screenshot1.txt
 Filesize:  14.55 KB
 Downloaded:  778 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Mazer




PostPosted: Thu May 22, 2003 11:19 am   Post subject: (No subject)

good shit, +51 bits
Catalyst




PostPosted: Thu May 22, 2003 2:38 pm   Post subject: (No subject)

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




PostPosted: Thu May 22, 2003 3:16 pm   Post subject: (No subject)

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




PostPosted: 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?
Catalyst




PostPosted: Thu May 22, 2003 4:23 pm   Post subject: (No subject)

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




PostPosted: Thu May 22, 2003 4:54 pm   Post subject: (No subject)

Very Happy Razz who is Na Po
HeTeRiC




PostPosted: Sat Nov 22, 2003 5:26 pm   Post subject: (No subject)

That is sick!!
I LOVE MATRIX!!!!!!!!!
NEO IS THE ULTIMATE!!!!!
Sponsor
Sponsor
Sponsor
sponsor
poly




PostPosted: Sat Nov 22, 2003 5:49 pm   Post subject: (No subject)

that kicks some royal ASS! good job
thoughtful




PostPosted: Sat Nov 22, 2003 7:04 pm   Post subject: (No subject)

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




PostPosted: Sat Nov 22, 2003 7:38 pm   Post subject: (No subject)

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




PostPosted: Sun Nov 23, 2003 3:47 pm   Post subject: (No subject)

solo, you go to massey? whats ur name?
Mazer




PostPosted: Sun Nov 23, 2003 11:02 pm   Post subject: (No subject)

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




PostPosted: Thu Dec 25, 2003 3:04 pm   Post subject: (No subject)

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




PostPosted: Thu Dec 25, 2003 5:42 pm   Post subject: (No 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!"
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 4  [ 47 Posts ]
Goto page 1, 2, 3, 4  Next
Jump to:   


Style:  
Search: