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

Username:   Password: 
 RegisterRegister   
 A really simple yet cool MATRIX........
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MacDaddyM




PostPosted: Tue May 18, 2004 7:31 am   Post subject: A really simple yet cool MATRIX........

Got bored in class one day and decided to make the simplist matrix ever

- I first used just 0's and 1's....

- Then decided to make it more realistic and use all the letters and numbers

code:

%Mitchell Malcomson
%A Simple Matrix for Newbs

setscreen ("graphics")
var x : int
var y : int

colorback (16)
cls
color (green)

loop
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "q"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "w"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "e"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "r"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "t"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "y"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "u"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "i"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "o"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "p"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "a"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "s"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "d"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "f"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "g"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "h"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "j"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "k"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "l"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "z"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "x"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "c"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "v"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "b"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "n"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "m"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "0"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "1"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "2"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "3"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "4"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "5"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "6"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "7"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "8"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "9"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "!"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "@"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "#"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "$"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "%"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "&"
    randint (x, 0, maxx)
    randint (y, 0, maxy)
    locatexy (x, y)
    put "*"
end loop
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Tue May 18, 2004 4:04 pm   Post subject: (No subject)

Confused Laughing
code:

%Mitchell Malcomson
%A Simple Matrix for Newbs
%modified by: paul bian
setscreen ("graphics")
var x : int
var y : int

colorback (16)
cls
color (green)
loop
for a: 33..57
    randint (x, 1, maxx)
    randint (y, 1, maxy)
    locatexy (x,y) put chr(a)
end for
for a: 97..122
    randint (x, 1, maxx)
    randint (y, 1, maxy)
    locatexy (x,y) put chr(a)
end for
end loop

same results
Cervantes




PostPosted: Tue May 18, 2004 6:22 pm   Post subject: (No subject)

code:

%Mitchell Malcomson
%A Simple Matrix for Newbs
%modified by: paul bian
setscreen ("graphics")
var x : int
var y : int

colorback (16)
cls
color (green)
loop
for a: 33..57
    randint (x, 1, maxx)
    randint (y, 1, maxy)
    locatexy (x,y) put chr(a)
end for
for a: 97..122
    randint (x, 1, maxx)
    randint (y, 1, maxy)
    locatexy (x,y) put chr(a)
end for
end loop

shorter still paul, uses cooler symbols Smile
Canadian Rob




PostPosted: Wed May 19, 2004 5:00 pm   Post subject: (No subject)

lol Nice nice, I made sumen like that in grd 10 when I had nutten 2 do.. I got kicked out of class for ... well thats for me 2 know lol and my classmates looool well yea.. I got moved to a class with no one in it.. and i made it lol
the_short1




PostPosted: Mon May 24, 2004 9:45 pm   Post subject: (No subject)

the true matrix one would shade the colors of green along a line going from bright to dark falling....

but anyways... i made it look better and cooler yet..

i didn;t like it how it deleted all chars on line.. so i made it scroll a better way...


anyways.!! take a look.... too bad u cant make window bigger... when i tried it gave mne tons of color and row errors Sad



matrix.t
 Description:

Download
 Filename:  matrix.t
 Filesize:  756 Bytes
 Downloaded:  246 Time(s)

Delta




PostPosted: Sat Jun 05, 2004 12:37 pm   Post subject: (No subject)

Quote:
Cervantes : shorter still paul, uses cooler symbols


What are you talking about, they are exactly the same code dude, nothing has changed!
we64




PostPosted: Sat Jun 05, 2004 3:35 pm   Post subject: (No subject)

nice...good stuff...
beard0




PostPosted: Sat Jun 05, 2004 11:26 pm   Post subject: (No subject)

I liked the idea, but wanted to make one that looked more like the original. It's much less simple, but looks good:
code:
setscreen ("nobuttonbar,graphics:max;max")
const numl := 400 % change this value until it runs at a good speed on your computer
colorback (black)
cls
var font1 := Font.New ("serif:12")
process dropletter
    var start : int
    randint (start, maxy, round (maxy * 2))
    loop
        var let : int
        randint (let, 33, 126)
        var k : char := chr (let)
        var x, col : int
        randint (x, 1, maxx)
        randint (col, 5, 20)
        col := RGB.AddColor (0, col / 20, 0)
        for decreasing y : start .. 0 by 10
            Font.Draw (k, x, y, font1, col)
            if y < start - 100 then
                drawfillbox (x, y + 100, x + Font.Width (k, font1), y + 120, black)
            end if
            exit when hasch
        end for
        for decreasing y : 100 .. 0 by 10
            drawfillbox (x, y, x + Font.Width (k, font1), y + 20, black)
            exit when hasch
        end for
        start := maxy
        exit when hasch
    end loop
end dropletter
for i : 1 .. numl
    fork dropletter
end for
Sponsor
Sponsor
Sponsor
sponsor
the_short1




PostPosted: Sat Jun 05, 2004 11:54 pm   Post subject: (No subject)

nice ... thats the stuff.... i dont like the varying sizes... but i really lke the falling effect!!
beard0




PostPosted: Mon Jun 07, 2004 10:00 am   Post subject: (No subject)

I don't actually change the size of the text - those are just differences in the actual charachter sizes. If you want them to be the same size, just change my code to limit it to alphabetic characters.

Here's a more modifiable version of the code:

code:
setscreen ("nobuttonbar,graphics:max;max")
const numl := 400 % change this value until it runs at a good speed on your computer
const linel := 300 % This changes the length of the line of charcters
const spc := 15 %This changes spacing between characters vertically - overlapped and not both work well
colorback (black)
cls
var font1 := Font.New ("serif:12")
process dropletter
    var start : int
    randint (start, maxy, round (maxy * 2))
    loop
        var let : int
        randint (let, 33, 126) % Change this line for which characters to include
        var k : char := chr (let)
        var x, col : int
        randint (x, 1, maxx)
        randint (col, 5, 20)
        col := RGB.AddColor (0, col / 20, 0)
        for decreasing y : start .. 0 by spc
            Font.Draw (k, x, y, font1, col)
            if y < start - linel then
                drawfillbox (x, y + linel, x + Font.Width (k, font1), y + linel + 10 + spc, black)
            end if
            exit when hasch
        end for
        for decreasing y : linel .. 0 by spc
            drawfillbox (x, y, x + Font.Width (k, font1), y + 10 + spc, black)
            exit when hasch
        end for
        start := maxy
        exit when hasch
    end loop
end dropletter
for i : 1 .. numl
    fork dropletter
end for
this_guy




PostPosted: Wed Jul 07, 2004 6:06 pm   Post subject: (No subject)

go here ==> http://www.compsci.ca/v2/viewtopic.php?t=5577

Very Happy so proud...



but i like the other one with the falling letters, much nicer spacing.
perhaps if the 2 could merge....
DanShadow




PostPosted: Mon Aug 30, 2004 10:45 pm   Post subject: (No subject)

lol, nice job guys. This is a matrix prog I made while in grade 11 compsci, (pretty crappy), but I thought i'd post it anyway Wink
code:

var matrixString : string := "¿ÀàÁáÂâÃãÄäÅåÆÅæÇçÐðÈèÉéÊêËëÌìÍíÎîÏïÑñÒòÓóÔôÕõÖöØøùÙÚúÛûÜüÝýÿÞþߧ¶µ¦±·¨ªº¬­¯°¢£¤¥"
var num : int := length (matrixString)
var c : array 1 .. 6 of int
var counter : int := 1
for i : 1 .. 6
    c (i) := RGB.AddColor (0.0, 0.9 - i / 10, 0.0)
end for
var maxRow : int := maxrow
var maxCol : int := maxcol - 1
var code : array 1 .. maxRow, 1 .. maxCol of char
drawfillbox (0, 0, maxx, maxy, 16)
colorback (16)
color (10)
loop
    for i : 1 .. maxRow
        for j : 1 .. maxCol
            code (i, j) := matrixString (Rand.Int (1, num))
            color (c (Rand.Int (1, 6)))
            put code (i, j), "" ..
        end for
    end for
    for i : 1 .. (maxRow - 1)
        for j : 1 .. maxCol
            code (i, j) := code (i + 1, j)
        end for
    end for
    delay (50)
end loop
Cervantes




PostPosted: Tue Aug 31, 2004 7:00 am   Post subject: (No subject)

not bad DanShadow.

@Delta:
Shocked
err, that's odd. Confused Either paul edited his post to copy mine, or a mod edited either of our posts.

wierd Laughing
Paul




PostPosted: Tue Aug 31, 2004 7:18 am   Post subject: (No subject)

...no I remeber checking every line... they were the same. I think u had a better version, u just didn't Ctrl+C it very well, so the code u copied to use to modify got posted.
rollerdude




PostPosted: Wed Sep 15, 2004 4:39 pm   Post subject: (No subject)

very interesting, although i made the same effect as the first code using only eight lines!

as soon as i get back to school, i'll post it for u!
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 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: