Computer Science Canada A really simple yet cool MATRIX........

Author:  MacDaddyM [ 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

Author:  Paul [ Tue May 18, 2004 4:04 pm ]
Post 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

same results

Author:  Cervantes [ Tue May 18, 2004 6:22 pm ]
Post 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 Author: Canadian Rob [ Wed May 19, 2004 5:00 pm ] Post 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

 Author: the_short1 [ Mon May 24, 2004 9:45 pm ] Post 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 Author: Delta [ Sat Jun 05, 2004 12:37 pm ] Post subject: Quote:Cervantes : shorter still paul, uses cooler symbols What are you talking about, they are exactly the same code dude, nothing has changed!

 Author: we64 [ Sat Jun 05, 2004 3:35 pm ] Post subject: nice...good stuff...

Author:  beard0 [ Sat Jun 05, 2004 11:26 pm ]
Post 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

 Author: the_short1 [ Sat Jun 05, 2004 11:54 pm ] Post subject: nice ... thats the stuff.... i dont like the varying sizes... but i really lke the falling effect!!

Author:  beard0 [ Mon Jun 07, 2004 10:00 am ]
Post 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

 Author: this_guy [ Wed Jul 07, 2004 6:06 pm ] Post subject: go here ==> http://www.compsci.ca/v2/viewtopic.php?t=5577 so proud... but i like the other one with the falling letters, much nicer spacing. perhaps if the 2 could merge....

Author:  DanShadow [ Mon Aug 30, 2004 10:45 pm ]
Post 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 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

 Author: Cervantes [ Tue Aug 31, 2004 7:00 am ] Post subject: not bad DanShadow. @Delta: err, that's odd. Either paul edited his post to copy mine, or a mod edited either of our posts. wierd Author: Paul [ Tue Aug 31, 2004 7:18 am ] Post 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.

 Author: rollerdude [ Wed Sep 15, 2004 4:39 pm ] Post 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!

Author:  apomb [ Sun Sep 19, 2004 8:12 pm ]
Post subject:

here is one that catalyst (such a smart guy) did, i modified it a bit, made more lines and smaller characters, but the credit all goes to Catalyst

 code: % Matrix Program by Catalyst %modified by Compwiz const maxChar := 100 const maxStreak := 300 randomize var w : int := Window.Open ("position:center;center,graphics:max;max") Window.Set (w, "nocursor,noecho,nobuttonbar") var x, y, c : array 1 .. maxStreak of int var ch : array 1 .. maxStreak of string for i : 1 .. maxStreak     y (i) := maxy     ch (i) := " "     c (i) := 1 end for var z : int := 1 var font : int := Font.New ("courier:10:bold") var yspd : int := 10 var rc : int := 0 proc fillback (c : int)     colorback (c)     cls end fillback proc Streak (num : int, highlight : boolean) %% Turns a white sparkle effet on/off     for n : 1 .. num         randint (x (n), 0, maxx)         randint (y (n), maxy, maxy * 2 + 140)     end for     loop         delay (15)         for n : 1 .. num             randint (z, 1, maxChar)             ch (n) += chr (z)             c (n) += 1             y (n) -= yspd             if y (n) < -140 then                 randint (y (n), maxy, maxy * 2 + 140)                 randint (x (n), 0, maxx)                 ch (n) := " "                 c (n) := 1             end if             if c (n) > 15 then                 if highlight = true then                     Font.Draw (ch (n) (c (n) - 1), x (n), y (n), font, 31)                     Streak (300, false)                 end if                 Font.Draw (ch (n) (c (n) - 2), x (n), y (n) + 10, font, 10)                 Font.Draw (ch (n) (c (n) - 3), x (n), y (n) + 20, font, 2)                 Font.Draw (ch (n) (c (n) - 7), x (n), y (n) + 60, font, 120)                 Font.Draw (ch (n) (c (n) - 11), x (n), y (n) + 100, font, 192)                 Font.Draw (ch (n) (c (n) - 15), x (n), y (n) + 140, font, black)             end if         end for     end loop end Streak fillback (7) Streak (300, true)

 Author: the_short1 [ Thu Sep 23, 2004 9:31 am ] Post subject: THERE!!!! TAHTS PERFECT!!!!!! GOD DAM!...... thats the best oen ive seen yet... i was suggesting from the get go that someone try to make it trail the colors like that... i tried to make a matrix that did that,.... but then i forget what happened to it.,.. anyways.... GOOD JOB CATALYST!... and CompWizz for adding more lines... as that was needed....cuz right now its a very small touch too few at times...... but lookz GREAT!!!! u can make this into SCR really easy!!!! compile... and instead of typing matrix.exe .... just tyope matrix.scr... WORKS GREAT!..... granted not true fullscreen... yet lookz really great..

 :