Page 1 of 2 12>
Topic Options
#76853 - 2003-09-23 10:26 PM Matrix code...
rogierg Offline
Fresh Scripter

Registered: 2003-01-16
Posts: 10
I had nothing better to do so I made a little script that displays matrix code:

code:
:init
;Enter the Matrix by Terminator
;Phear my 1337 kix skills ;-)
;rogierg@hotmail.com
srnd(@MSECS)
$fill=0
:key
cls
color b+
at (12,22) "[b]lue pill"
color r+
at (12,44) "[r]ed pill"
get $k
if $k=b goto "end" endif
if $k<>r goto "key" endif
cls
:loop1
$color="n+"
if $fill="60" goto "clear" endif
$fill=$fill + "1"
$xpos=rnd(24)
$ypos=rnd(79)
$length=rnd(10) + "3"
$xposend=$xpos + $length
$colorend=$length / "3"
$colorstep=1
:loop2
if kbhit() goto "end" endif
if $xpos>"24" goto "loop1" endif
$chr=rnd(100) + "150"
color w+
at ($xpos,$ypos) chr($chr)
sleep 0.01
color $color
at ($xpos,$ypos) chr($chr)
sleep 0.01
$colorstep=$colorstep + "1"
if $colorstep=$colorend $colorstep=1 if $color="g" $color="g+" endif if $color="n+" $color="g" endif endif
$xpos=$xpos + "1"
if $xpos=$xposend goto "loop1" else goto "loop2" endif
:clear
cls
$fill=0
goto "loop1"
:end
cls
color g
at (0,0) "The matrix has you..."
color w/b



[ 23. September 2003, 22:36: Message edited by: rogierg ]

Top
#76854 - 2003-09-23 10:34 PM Re: Matrix code...
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
If you have nothing better to do then you should perform a BBS search beforehand! See for example Its Coming! .

Oh, and please spell-check your subject line!

Oh oh, and I do fear your skills as you are using GOTOs [Eek!] Sorry, but you've now landed on the very bottom of the KiXtart-coding foodchain.

[ 23. September 2003, 22:39: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#76855 - 2003-09-23 10:39 PM Re: Matrix code...
rogierg Offline
Fresh Scripter

Registered: 2003-01-16
Posts: 10
Ok,

Sorry 'bout that... Don't take this post to seriously, I certainly don't. Anyway it was fun!

I know goto's are bad, this was just Q&D.

[ 23. September 2003, 22:43: Message edited by: rogierg ]

Top
#76856 - 2003-09-23 11:49 PM Re: Matrix code...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Having said that, it looks pretty darn good. Especially like the color gradient from grey to light-green to bright-green. Think you need more $fill though, or maybe let it run continuosly. I love scripts like this, nice change from the old NET USE and INGROUP scripts [Wink]

Well done.

-Shawn

Top
#76857 - 2003-09-24 01:18 AM Re: Matrix code...
Paul_Berquam Offline
Hey THIS is FUN

Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
Sheesh, talk about harsh.

Looks good Roger.
_________________________
He was a good little monkey and always very curious...

Top
#76858 - 2003-09-24 01:21 AM Re: Matrix code...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
harsh?
is that slang for gotoish? [Confused]
_________________________
!

download KiXnet

Top
#76859 - 2003-09-24 01:31 AM Re: Matrix code...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Too bad we can't represent Kanji with KiX. The original looks like it uses Kanji in it.

Thanks Rog... please look into using PostPrep next time you post. Makes it much easier to copy/paste code from the board for testing.

[ 24. September 2003, 01:35: Message edited by: NTDOC ]

Top
#76860 - 2003-09-24 01:41 AM Re: Matrix code...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Kanji ?
Top
#76861 - 2003-09-24 01:47 AM Re: Matrix code...
Paul_Berquam Offline
Hey THIS is FUN

Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
One of the many character sets used by Japanese and Chinese.
_________________________
He was a good little monkey and always very curious...

Top
#76862 - 2003-09-24 01:55 AM Re: Matrix code...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hmmm, Japanese and Chinese eh ? How about my favorite language - Egyptian ! Anyone want to see Kixtart in Ancient Egyptian ? Here it is:

 -

Top
#76863 - 2003-09-24 02:03 AM Re: Matrix code...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Translation:

Man who put hand up birds backside fill cup, make next bird weary of man

Top
#76864 - 2003-09-24 02:22 AM Re: Matrix code...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
ROFL
Top
#76865 - 2003-09-24 05:04 AM Re: Matrix code...
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
ok.... i must be bored [Smile]

code:
break on
loadmatrix
$loadnumber = 4
$date = join(split(@date,"/"),"-")
? $date
del "Temp$date.kix"
$ = open(1,"temp$date.kix",5)
for each $line in $Thematrixcode
$ = writeline(1,"$line@crlf")
next
$ = close(1)

cls
for $i = 1 to $loadnumber
if $i = 1
run "kix32 temp$date.kix $c=1"
endif
run "kix32 temp$date.kix"
next

sleep(30)
del "Temp$date.kix"


function LoadMatrix

$Thematrixcode = '98,114,101,97,107,32,111,110,<cr>',
'58,105,110,105,116,<cr>',
'59,69,110,116,101,114,32,116,104,101,32,77,97,116,114,105,120,32,98,121,32,84,101,114,109,105,110,97,116,111,114,<cr>',
'59,80,104,101,97,114,32,109,121,32,49,51,51,55,32,107,105,120,32,115,107,105,108,108,115,32,59,45,41,<cr>',
'59,114,111,103,105,101,114,103,64,104,111,116,109,97,105,108,46,99,111,109,<cr>',
'115,114,110,100,40,64,77,83,69,67,83,41,<cr>',
'36,102,105,108,108,61,48,<cr>',
'58,107,101,121,<cr>',
'105,102,32,36,99,32,99,108,115,32,101,110,100,105,102,<cr>',
'99,111,108,111,114,32,98,43,<cr>',
'97,116,32,40,49,50,44,50,50,41,32,34,91,98,93,108,117,101,32,112,105,108,108,34,<cr>',
'99,111,108,111,114,32,114,43,<cr>',
'97,116,32,40,49,50,44,52,52,41,32,34,91,114,93,101,100,32,112,105,108,108,34,<cr>',
'59,103,101,116,32,36,107,<cr>',
'36,107,32,61,32,34,114,34,<cr>',
'105,102,32,36,107,61,98,32,103,111,116,111,32,34,101,110,100,34,32,101,110,100,105,102,<cr>',
'105,102,32,36,107,60,62,114,32,103,111,116,111,32,34,107,101,121,34,32,101,110,100,105,102,<cr>',
'105,102,32,36,99,32,99,108,115,32,101,110,100,105,102,<cr>',
'58,108,111,111,112,49,<cr>',
'36,99,111,108,111,114,61,34,110,43,34,<cr>',
'105,102,32,36,102,105,108,108,61,34,54,48,34,32,103,111,116,111,32,34,99,108,101,97,114,34,32,101,110,100,105,102,<cr>',
'36,102,105,108,108,61,36,102,105,108,108,32,43,32,34,49,34,<cr>',
'36,120,112,111,115,61,114,110,100,40,50,52,41,<cr>',
'36,121,112,111,115,61,114,110,100,40,55,57,41,<cr>',
'36,108,101,110,103,116,104,61,114,110,100,40,49,48,41,32,43,32,34,51,34,<cr>',
'36,120,112,111,115,101,110,100,61,36,120,112,111,115,32,43,32,36,108,101,110,103,116,104,<cr>',
'36,99,111,108,111,114,101,110,100,61,36,108,101,110,103,116,104,32,47,32,34,51,34,<cr>',
'36,99,111,108,111,114,115,116,101,112,61,49,<cr>',
'58,108,111,111,112,50,<cr>',
'105,102,32,107,98,104,105,116,40,41,32,103,111,116,111,32,34,101,110,100,34,32,101,110,100,105,102,<cr>',
'105,102,32,36,120,112,111,115,62,34,50,52,34,32,103,111,116,111,32,34,108,111,111,112,49,34,32,101,110,100,105,102,<cr>',
'36,99,104,114,61,114,110,100,40,49,48,48,41,32,43,32,34,49,53,48,34,<cr>',
'99,111,108,111,114,32,119,43,<cr>',
'97,116,32,40,36,120,112,111,115,44,36,121,112,111,115,41,32,99,104,114,40,36,99,104,114,41,<cr>',
'115,108,101,101,112,32,48,46,48,49,<cr>',
'99,111,108,111,114,32,36,99,111,108,111,114,<cr>',
'97,116,32,40,36,120,112,111,115,44,36,121,112,111,115,41,32,99,104,114,40,36,99,104,114,41,<cr>',
'115,108,101,101,112,32,48,46,48,49,<cr>',
'36,99,111,108,111,114,115,116,101,112,61,36,99,111,108,111,114,115,116,101,112,32,43,32,34,49,34,<cr>',
'105,102,32,36,99,111,108,111,114,115,116,101,112,61,36,99,111,108,111,114,101,110,100,32,36,99,111,108,111,114,115,116,101,112,61,49,32,105,102,32,36,99,111,108,111,114,61,34,103,34,32,36,99,111,108,111,114,61,34,103,43,34,32,101,110,100,105,102,32,105,102,32,36,99,111,108,111,114,61,34,110,43,34,32,36,99,111,108,111,114,61,34,103,34,32,101,110,100,105,102,32,101,110,100,105,102,<cr>',
'36,120,112,111,115,61,36,120,112,111,115,32,43,32,34,49,34,<cr>',
'105,102,32,36,120,112,111,115,61,36,120,112,111,115,101,110,100,32,103,111,116,111,32,34,108,111,111,112,49,34,32,101,108,115,101,32,103,111,116,111,32,34,108,111,111,112,50,34,32,101,110,100,105,102,<cr>',
'58,99,108,101,97,114,<cr>',
'105,102,32,36,99,32,99,108,115,32,101,110,100,105,102,<cr>',
'36,102,105,108,108,61,48,<cr>',
'103,111,116,111,32,34,108,111,111,112,49,34,<cr>',
'58,101,110,100,<cr>',
'105,102,32,36,99,32,99,108,115,32,101,110,100,105,102,<cr>',
'99,111,108,111,114,32,103,<cr>',
'97,116,32,40,48,44,48,41,32,34,84,104,101,32,109,97,116,114,105,120,32,104,97,115,32,121,111,117,46,46,46,34,<cr>',
'99,111,108,111,114,32,119,47,98,<cr>'

? "decompressing inbeded scripts"
? "."
for $arraypointer = 0 to ubound($Thematrixcode)
$line = split($Thematrixcode[$arraypointer],",")
$temp = ""
for each $thing in $line
if $thing = "<cr>"
;
"."
else
$temp = $temp + chr($thing)
endif
next
$Thematrixcode[$arraypointer] = $temp
next
endfunction


Top
#76866 - 2003-09-24 08:43 AM Re: Matrix code...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
bryce, you basta.
about 2000 posts finally.

not sure I follow your code though.
you write lot of numbers in a file, then run kix with that file as script [Confused]

I might need to test run it to really get it.
_________________________
!

download KiXnet

Top
#76867 - 2003-09-24 11:45 AM Re: Matrix code...
rogierg Offline
Fresh Scripter

Registered: 2003-01-16
Posts: 10
Glad you guys like it.
Top
#76868 - 2003-09-24 02:02 PM Re: Matrix code...
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
rogierg's original script was nice... but kind of slow.

those numbers are rogierg's original script that gets pushed to a file. then $loadnumber determines how many processes to kick off for a faster screen fill effect.

i changed rogierg's script a little so that only 1 of the programs actually clears the screen.

Like i said.... i was bored [Big Grin]
Bryce

Top
#76869 - 2003-09-24 04:34 PM Re: Matrix code...
rogierg Offline
Fresh Scripter

Registered: 2003-01-16
Posts: 10
Bryce, LOL

It's alive...

Top
#76870 - 2003-09-24 08:03 PM Re: Matrix code...
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Okay, couldn't resist. Try this one...

Break ON CLS
$gNull=SetOption("Explicit","ON")
$gNull=SetOption("Ascii","ON")

Dim $iThreadMax ; Maximum threads.
Dim $iThread ; Thread number being acrivated.
Dim $sKeyPress ; Key pressed.
$iThreadMax=60
Dim $aStates[$iThreadMax] ; An array of thread states
Global $gasBitMap[24,80] ; For colour change

Global $gasColours_Standard $gasColours_Standard=Split("g+/n g/n n+/n n/n")
Global $gasColours_Highlight $gasColours_Highlight=Split("r+/n r/n y/n y/n")
; Seed random number
SRND(@MSECS*10000+@MSECS*1000+@MSECS*100+@MSECS*10+@MSECS)

LoadBitMap()

$iThreadMax=$iThreadMax-1

While $sKeyPress <> "q"
; Step each thread.
$iThread=0
For $iThread=0 To $iThreadMax $aStates[$iThread]=StepThread($aStates[$iThread]) Next
If KBHit() Get $sKeyPress EndIf
Loop

Cls

Exit 0

Function StepThread($aState)
Dim $i
Dim $x,$y

; Initialise state if the process is being called the first time.
If Not VarType($aState) Redim Preserve $aState[7] EndIf

If $aState[2] ; Thread no-op mode (thread brake)
$aState[2]=$aState[2]-1
Else
Select
Case $aState[5] ; Lengthening
$aState[5]=$aState[5]-1
$aState[6]=$aState[6]+1
$aState[0]=$aState[0]+Chr(150+Rnd(100))
For $i=1 To $aState[6]
$x=$aState[4]+$i
$y=$aState[3]
If $gasBitMap[$x,$y]
Color $gasColours_HighLight[CInt(CDbl($aState[6]-$i))/$aState[7]]
Else
Color $gasColours_Standard[CInt(CDbl($aState[6]-$i))/$aState[7]]
EndIf
At($x,$y) SubStr($aState[0],$i,1)
Next
Case $aState[6] ; Shortening
$x=$aState[4]+1
$y=$aState[3]
If Not $gasBitMap[$x,$y] At($x,$y) " " EndIf
$aState[6]=$aState[6]-1
$aState[4]=$aState[4]+1
$aState[0]=SubStr($aState[0],2)
For $i=1 To $aState[6]
$x=$aState[4]+$i
$y=$aState[3]
If $gasBitMap[$x,$y]
Color $gasColours_Highlight[3-(CInt(CDbl($i)/$aState[7]))]
Else
Color $gasColours_Standard[3-(CInt(CDbl($i)/$aState[7]))]
EndIf
At($x,$y) SubStr($aState[0],$i,1)
Next
Case "Uninitialised" ; Uninitialised
; Set thread speed, higher=slower, skew to fastest
$aState[1]=Rnd(10)
If $aState[1]>6 $aState[1]=0 EndIf
; Set X and Y start
$aState[3]=Rnd(79) ; Horizontal offset
$aState[4]=Rnd(23) ; Vertical offset
$aState[5]=Rnd(10)+3 ; Maximum length
$aState[7]=Cdbl($aState[5])/3.0 ; Colour fade
If ($aState[4]+$aState[5])>23 $aState[5]=24-$aState[4] EndIf
EndSelect
$aState[2]=$aState[1] ; Set brake
EndIf
$StepThread=$aState
EndFunction

Function LoadBitMap()
Dim $iRow,$iColumn,$iValue,$RunLength,$iLen,$iCounter
For Each $RunLength In Split("@@ @@ @@ @@ @@ XBHC WCGD CEBFDACCFC DCCDECCCDC` DCBDGAECBCGBGFDGDB"
+" DHOFGCLBCFDC DHFDGCGEFGDCEE DCBDFCFEGCFBDBDCFC DCCDECECACFCBACBCCDCFCBA"
+" DCDDDCDCCCEEEDABDCFE CECFAECCDCECGBBBCEFC YCFD XB")

$iColumn=0
$iValue=0
For $iLen=1 To Len($RunLength)
For $iCounter=1 To (Asc(SubStr($RunLength,$iLen))-64)
$gasBitMap[$iRow,$iColumn]=$iValue
$iColumn=$iColumn+1
Next
If $iValue $iValue=0 Else $iValue=1 EndIf
Next
$iRow=$iRow+1
Next
EndFunction



[edit]
Reposted with syntax highlighting
[/edit]

[ 24. September 2003, 20:53: Message edited by: Richard H. ]

Top
#76871 - 2003-09-24 08:19 PM Re: Matrix code...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Very nice, very clever, even has an easter egg hidden message ! [Eek!]
Top
#76872 - 2003-09-24 08:20 PM Re: Matrix code...
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
This seems to turning into a kixgolf game. [Eek!]
_________________________
Jack

Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 569 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.17 seconds in which 0.076 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org