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

Username:   Password: 
 RegisterRegister   
 Heres My Matrix Screen
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
krow789




PostPosted: Fri May 02, 2008 8:05 am   Post subject: Heres My Matrix Screen

Tell Me What I Should Do To Make It Better If You Could Thank You I No Its Not The Best But Im Workin At It lol

/*****************
By Jessy Rose *
My Matrix Screen *
******************/
loop
colour (10)
colourback (255)
delay (10)
put "1010010101001"..

end loop
Sponsor
Sponsor
Sponsor
sponsor
petree08




PostPosted: Fri May 02, 2008 8:21 am   Post subject: RE:Heres My Matrix Screen

the matrix screen has individual streams of text that "rain" down indepentantly. The matrix screen program works well with arrays.

and just to improve the effeciency of your current code try this

code:

colour (10)
colourback (255)
cls
loop

delay (10)
put "1010010101001"..

end loop


you don't need to keep setting the back color and font color every cycle, one is good enough.

also to get a black screen right away use the cls command.

also for your put "10100" you could make your ones and zeroes random by


code:

colour (10)
colourback (255)
cls
loop

delay (10)
for D : 1.. 5
if Rand.Int (1,2) = 1 then
put "1"..
else
put "0"..
end if

end for

end loop



also if you want your matrix screen to fill the whole screen put this line before your loop

code:

setscreen ("graphics:max,max,nobuttonbar")

three_red_foxes




PostPosted: Mon May 12, 2008 7:37 pm   Post subject: Re: Heres My Matrix Screen

Also, once you set that, you can have the trail of oness and zeroes choose a different location each time.

Maximum helper divs the maximum by 16 so it doesn't go off screen, just in case the aspect-ratio is not correct for 16 (normal text size.)
Vertical Helper does the same, except vertically. Very Happy

Quote:

%This program can be run in Turing.
%Color Defaults
color(brightgreen)
colorback(black)
%We need four variables for this.
var maximum_helper, vertical_helper, one_or_zero, random_horizontal_location : int
%This determines the maximum window dimensions, if changed anyway. Protects from off-screen bug.
maximum_helper := (maxx div 16) + 1
vertical_helper := (maxy div 16) + 1
% Why add 1 to vertical? Because normaly in the matrix the ones and zeroes DO run off the bottom of the screen.
loop
randint (random_location,1,maximum_helper)
for vertical_location 1 .. (vertical_helper + 1)
locate (vertical_position,random_horizontal_location)
randint (one_or_zero,0,1)
if
one_or_zero = 1
then put "1"
else put "0"
endif
end loop


That should be a nice matrix to look at.
Sur_real




PostPosted: Thu May 15, 2008 3:38 pm   Post subject: RE:Heres My Matrix Screen

or you can see mine...
Which is very simple...

code:

%The Matrix

setscreen ("graphics")
var matrix:int

loop
randint(matrix,0,1)
colourback (255)  %black
colour (120) %"matrix green"
put matrix ..
end loop

saadem3000




PostPosted: Wed Jun 11, 2008 6:23 pm   Post subject: Re: Heres My Matrix Screen

[quote="krow789 @ Fri May 02, 2008 8:05 am"]Tell Me What I Should Do To Make It Better If You Could Thank You I No Its Not The Best But Im Workin At It lol

a shorter, better version..

setscreen ("graphics: max, max")
var num: int
drawfillbox (0, 0, maxx, maxy, black)
colourback (black)
colour (brightgreen)
loop
num:= Rand.Int (0, 1)
put num..
end loop
death bringer




PostPosted: Mon Jun 16, 2008 2:43 pm   Post subject: RE:Heres My Matrix Screen

kk lol i got really bored with this dont stare to long or you will suck (trippy)

%The Matrix

setscreen ("graphics: max, max")
var matrix:int
var ran: int


process matrixd
loop
colourback (green)
randint(matrix,0,9 )
colour (120)colourback (green)
put matrix ..
colour (1)colourback (black)
put matrix ..
colour (120)colourback (green)
put matrix ..
colour (1)colourback (blue)
put matrix ..
colour (120)colourback (red)
put matrix ..
colour (red)colourback (green)
put matrix ..
color(green)colourback (blue)
put matrix ..
color(blue)colourback (red)
put matrix ..
colour (56)colourback (green)
put "Suck" ..
colour (1)colourback (red)
put matrix ..
colour (green)colourback (blue)
put matrix ..
colour (1)colourback (red)
put "YOU" ..
end loop
end matrixd
fork matrixd
syntax_error




PostPosted: Mon Jun 16, 2008 4:25 pm   Post subject: Re: RE:Heres My Matrix Screen

death bringer @ Mon Jun 16, 2008 2:43 pm wrote:
kk lol i got really bored with this dont stare to long or you will suck (trippy)

%The Matrix

setscreen ("graphics: max, max")
var matrix:int
var ran: int


process matrixd
loop
colourback (green)
randint(matrix,0,9 )
colour (120)colourback (green)
put matrix ..
colour (1)colourback (black)
put matrix ..
colour (120)colourback (green)
put matrix ..
colour (1)colourback (blue)
put matrix ..
colour (120)colourback (red)
put matrix ..
colour (red)colourback (green)
put matrix ..
color(green)colourback (blue)
put matrix ..
color(blue)colourback (red)
put matrix ..
colour (56)colourback (green)
put "Suck" ..
colour (1)colourback (red)
put matrix ..
colour (green)colourback (blue)
put matrix ..
colour (1)colourback (red)
put "YOU" ..
end loop
end matrixd
fork matrixd


never fork.

Other then that, dizzy.
Nick




PostPosted: Mon Jun 16, 2008 6:03 pm   Post subject: RE:Heres My Matrix Screen

code:

colourback (black)
colour (120)
loop
    put Rand.Int(0,1) ..
end loop

that's probably the simplest, most efficient way, but still doesn't rain
Sponsor
Sponsor
Sponsor
sponsor
Euphoracle




PostPosted: Mon Jun 16, 2008 8:33 pm   Post subject: RE:Heres My Matrix Screen

K, I just spent a couple minutes making this just because I know there was a good one on these forums, but I can't find it anymore:

Turing:
%Matrix Screen, I guess (:

View.Set ("title:Matrix")
View.Set ("graphics:max,max,nobuttonbar") %good call on filling the screen (:
View.Set ("offscreenonly")

const TOTALAMT := 200 %# of trails total
const CLRAMT := 5 %# of trails per letter

const ARANGESTR := 33 %start of ascii range
const ARANGEEND := 122 %end of ascii range

const FONT := Font.New ("mono:24")

const OFFINT := 2 %rate of offset
const OFFMAX := 10 %max offset multiplier

const VRATEMIN := 5 %min speed
const VRATEMAX := 10 %maxspeed

%color stuff
const GREENADD := 80
const GREENSTART := RGB.maxcolor + 1
var GREENEND : int

type pnt :
    record
        x : int
        y : int
    end record

type mletter :
    record
        drk : int %darkness 1-CLRAMT
        ltr : string (1) %letter
        off : int %offset
        offmax : int %max offset
    end record

type mtext :
    record
        pos : pnt
        ltrs : array 1 .. CLRAMT of mletter
        rate : int
    end record

var ch : array char of boolean %chars for exit
var m : array 1 .. TOTALAMT of mtext %array of texts

fcn point (x, y : int) : pnt
    var t : pnt
    t.x := x
    t.y := y
    result t
end point

fcn gen_letter (off : int) : mletter
    var t : mletter
    t.drk := Rand.Int (GREENSTART, GREENSTART + ((GREENEND - GREENSTART) div 2))
    t.ltr := chr (Rand.Int (ARANGESTR, ARANGEEND))
    t.off := 0
    t.offmax := 2 * (OFFMAX * (off - 1))
    result t
end gen_letter

fcn gentext : mtext
    var t : mtext
    t.pos := point (Rand.Int (-50, maxx + 50), Rand.Int (maxy, maxy * 2))
    t.rate := Rand.Int (VRATEMIN, VRATEMAX)
    for i : 1 .. CLRAMT
        t.ltrs (i) := gen_letter (i)
    end for
    result t
end gentext

proc firstrun
    for i : 1 .. TOTALAMT
        m (i) := gentext
    end for
end firstrun

proc clampadd (var val : int, step, maxv : int)
    if (val + step < maxv) then
        val += step
    end if
end clampadd
proc clampsub (var val : int, step, minv : int)
    if (val - step > minv) then
        val -= step
    end if
end clampsub

proc mkgreenrange ()
    var i := 180
    var clr : int
    var gval := GREENADD + i
    loop
        if (i < 0) then
            i := 0
        else
            i -= 2
        end if
        gval -= 2
        exit when (gval < 0)
        clr := RGB.AddColor (i / 255, gval / 255, i / 255)
        exit when clr = 1
    end loop
    GREENEND := RGB.maxcolor
end mkgreenrange
mkgreenrange

proc updatemtext (k : int)
    m (k).pos.y -= m (k).rate
    for i : 1 .. CLRAMT
        clampadd (m (k).ltrs (i).drk, Rand.Int (0, 1), GREENEND)
        clampsub (m (k).ltrs (i).off, OFFINT, -m (k).ltrs (i).offmax)
    end for
    if (m (k).pos.y < -OFFMAX * CLRAMT) then
        m (k) := gentext
    end if
end updatemtext

proc drawmtext (k : int)
    for i : 1 .. CLRAMT
        Font.Draw (m (k).ltrs (i).ltr, m (k).pos.x, m (k).pos.y + m (k).ltrs (i).off, FONT, m (k).ltrs (i).drk)
    end for
end drawmtext

firstrun
loop

    drawfillbox (0, 0, maxx, maxy, black)
    for i : 1 .. TOTALAMT
        updatemtext (i)
        drawmtext (i)
    end for
    View.Update ()

    Time.DelaySinceLast (40)
    % Exit on spacebar
    Input.KeyDown (ch)
    exit when (ch (' '))
end loop



(:
gitoxa




PostPosted: Mon Jun 16, 2008 9:00 pm   Post subject: RE:Heres My Matrix Screen

That, good sir, is quite awesome.
Euphoracle




PostPosted: Mon Jun 16, 2008 10:17 pm   Post subject: RE:Heres My Matrix Screen

Thanks (:
jinjin




PostPosted: Tue Jun 17, 2008 12:37 am   Post subject: Re: Heres My Matrix Screen

Whoa Shocked

Great job Euphoracle, that's a great, innovative matrix screen. The layer effect and technical aspect of the code is simply incredible. +BITS
jeffgreco13




PostPosted: Tue Jun 17, 2008 7:58 am   Post subject: Re: Heres My Matrix Screen

very very well done... well im glad someone got the real thing going
death bringer




PostPosted: Tue Jun 17, 2008 12:58 pm   Post subject: RE:Heres My Matrix Screen

holy shit nice Euphoracle can you make more streams and green lines rain also i watched the movie matrix recently and in the movie it has green lines and many #s and stuff Still very very good though
death bringer




PostPosted: Tue Jun 17, 2008 2:04 pm   Post subject: Re: Heres My Matrix Screen

kk so i got bored and maid lines my self but because I didnt make this program it didn't turn out the best a bit of the screen won't get the lines also the lines are super fast ;p; anyone think they can fix it? plz do so
ohh ya and this is Euphoracle's program i just got bored that's all


%Matrix Screen, I guess (:

View.Set ("title:Matrix")
View.Set ("graphics:max,max,nobuttonbar") %good call on filling the screen (:
View.Set ("offscreenonly")

const TOTALAMT := 2000 %# of trails total
const CLRAMT := 1 %# of trails per letter

const ARANGESTR := 4 %start of ascii range
const ARANGEEND := 99 %end of ascii range

const FONT := Font.New ("mono:24")

const OFFINT := 2 %rate of offset
const OFFMAX := 1 %max offset multiplier

const VRATEMIN := 0 %min speed
const VRATEMAX := 15 %maxspeed

%color stuff
const GREENADD := 80
const GREENSTART := RGB.maxcolor + 1
var GREENEND : int

type pnt :
record
x : int
y : int
end record

type mletter :
record
drk : int %darkness 1-CLRAMT
ltr : string (1) %letter
off : int %offset
offmax : int %max offset
end record

type mtext :
record
pos : pnt
ltrs : array 1 .. CLRAMT of mletter
rate : int
end record

var ch : array char of boolean %chars for exit
var m : array 1 .. TOTALAMT of mtext %array of texts

fcn point (x, y : int) : pnt
var t : pnt
t.x := x
t.y := y
result t
end point

fcn gen_letter (off : int) : mletter
var t : mletter
t.drk := Rand.Int (GREENSTART, GREENSTART + ((GREENEND - GREENSTART) div 2))
t.ltr := chr (Rand.Int (ARANGESTR, ARANGEEND))
t.off := 0
t.offmax := 2 * (OFFMAX * (off - 1))
result t
end gen_letter

fcn gentext : mtext
var t : mtext
t.pos := point (Rand.Int (-50, maxx + 50), Rand.Int (maxy, maxy * 2))
t.rate := Rand.Int (VRATEMIN, VRATEMAX)
for i : 1 .. CLRAMT
t.ltrs (i) := gen_letter (i)
end for
result t
end gentext

proc firstrun
for i : 1 .. TOTALAMT
m (i) := gentext
end for
end firstrun

proc clampadd (var val : int, step, maxv : int)
if (val + step < maxv) then
val += step
end if
end clampadd
proc clampsub (var val : int, step, minv : int)
if (val - step > minv) then
val -= step
end if
end clampsub

proc mkgreenrange ()
var i := 180
var clr : int
var gval := GREENADD + i
loop
if (i < 0) then
i := 0
else
i -= 2
end if
gval -= 2
exit when (gval < 0)
clr := RGB.AddColor (i / 255, gval / 255, i / 255)
exit when clr = 44
end loop
GREENEND := RGB.maxcolor
end mkgreenrange
mkgreenrange

proc updatemtext (k : int)
m (k).pos.y -= m (k).rate
for i : 1 .. CLRAMT
drawline (Rand.Int(0, maxy), Rand.Int (0, 150000000),Rand.Int(0, maxy),Rand.Int(0, 15000),green)
clampadd (m (k).ltrs (i).drk, Rand.Int (0, 1500000), GREENEND)
clampsub (m (k).ltrs (i).off, OFFINT, -m (k).ltrs (i).offmax)
end for
if (m (k).pos.y < -OFFMAX * CLRAMT) then
m (k) := gentext
end if
end updatemtext

proc drawmtext (k : int)
for i : 1 .. CLRAMT
Font.Draw (m (k).ltrs (i).ltr, m (k).pos.x, m (k).pos.y + m (k).ltrs (i).off, FONT, m (k).ltrs (i).drk)
end for
end drawmtext

firstrun
loop

drawfillbox (0, 0, maxx, maxy, black)
for i : 1 .. TOTALAMT
updatemtext (i)
drawmtext (i)
end for
View.Update ()

Time.DelaySinceLast (40)
% Exit on spacebar
Input.KeyDown (ch)
exit when (ch (' '))
end loop
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  [ 24 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: