Computer Science Canada

Best Matrix Program EVER!!!

Author:  shoobyman [ Sat Jun 23, 2007 11:54 am ]
Post subject:  Best Matrix Program EVER!!!

code:
View.Set ("offscreenonly")
colourback (7)
Text.Colour (10)
%17
var message : string
var font1, font2, font3, font4 : int
var symbol : array 1 .. 250 of string
var sx, sy, vy : array 1 .. 250 of real
var random : int
var x : int
var mesl, symr : flexible array 1 .. 0 of string
var start : int
var timer : int

timer := 0
font1 := Font.New ("Copperplate Gothic Bold:8")
font2 := Font.New ("Copperplate Gothic Bold:12")
font3 := Font.New ("mono:9")
font4 := Font.New ("Palatino:24:Bold,Italic")

proc randomize_it
    random := Rand.Int (1, 8)
    if random = 1 then
        symbol (x) := "M"
    elsif random = 2 then
        symbol (x) := "Y"
    elsif random = 3 then
        symbol (x) := "V"
    elsif random = 4 then
        symbol (x) := "I"
    elsif random = 5 then
        symbol (x) := "T"
    elsif random = 6 then
        symbol (x) := "E"
    elsif random = 7 then
        symbol (x) := "X"
    elsif random = 8 then
        symbol (x) := "Z"
    end if
    sx (x) := Rand.Int (1, maxx)
    sy (x) := Rand.Int (maxy, maxy * 2)
    vy (x) := (Rand.Real * Rand.Int (10, 20)) + 1
end randomize_it

for i : 1 .. 250
    x := i
    randomize_it
end for

cls
put "Type in a message that will pop up in cool matrix text (not too long):"
get message : *

new mesl, length (message)
new symr, length (message)
for i : 1 .. upper (mesl)
    mesl (i) := message (i)
    symr (i) := " "
end for

start := round ((maxx div 2) - (8 * upper (mesl)))

loop
    View.Update
    delay (30)
    cls
    for i : 1 .. 250
        Font.Draw (symbol (i), round (sx (i)), round (sy (i)) + round (vy (i) * 5), font1, 119)
        Font.Draw (symbol (i), round (sx (i)), round (sy (i)) + round (vy (i) * 3), font1, 2)
        Font.Draw (symbol (i), round (sx (i)), round (sy (i)), font1, 10)
        sy (i) -= vy (i)
        if sy (i) < -100 then
            x := i
            randomize_it
        end if
    end for
    for i : 1 .. upper (mesl)
        if symr (i) = mesl (i) then
            Font.Draw (mesl (i), start + (16 * (i - 1)), maxy div 2, font2, 10)
        else
            random := Rand.Int (1, 9)
            if random = 1 then
                symr (i) := "M"
            elsif random = 2 then
                symr (i) := "Y"
            elsif random = 3 then
                symr (i) := "V"
            elsif random = 4 then
                symr (i) := "I"
            elsif random = 5 then
                symr (i) := "T"
            elsif random = 6 then
                symr (i) := "E"
            elsif random = 7 then
                symr (i) := "X"
            elsif random = 8 then
                symr (i) := "Z"
            elsif random = 9 and timer >= (50 div (length (message) div 2)) then
                symr (i) := mesl (i)
            end if
            Font.Draw (symr (i), start + (16 * (i - 1)), maxy div 2, font2, 10)
        end if
    end for
    timer += 1
end loop


I made this in about 15 minutes, it's pretty cool, but don't make your message too long or it won't show the whole thing. I know the code could be better, but i didn't really care cuz it was short enough.

Author:  Ultrahex [ Sat Jun 23, 2007 12:35 pm ]
Post subject:  Re: Best Matrix Program EVER!!!

I can probably speak of many people on compsci.ca, we have seen matrix text falling programs over and over and over again, I believe i have seen a lot better then this actually and it is just getting anying when people post the same ting over and over again, we understand that it may seem cool to you and stuff, but the fact you spent 15? min on it, doesn't show much effort or work. Many other projects on here there is about 15-100 hrs on a single project, just an idea...


: