Author Topic: Matrix Encode  (Read 1262 times)

0 Members and 1 Guest are viewing this topic.

Offline bikemadness

  • Amiga 1200
  • ****
  • Posts: 312
  • Karma: 25
  • Hard players don't go home.
    • View Profile
Matrix Encode
« on: October 15, 2021 »
Yes, it's been done to death.

I never really got the rain dribbling
down the window pane effect.

Number and length of tails can be changed.
Character symbols are utilized.

Code: [Select]
restore symbol
read char
dim key$(char)
for a=1 to char
read key$(a)
next a

tails=30
tail=8

dim go(tails)
dim en(tails)
dim x(tails)
dim y(tails)
dim z(tail,tails)

for a=1 to tails
en(a)=ran(10)+1
x(a)=int(ran(64)+1)*10
y(a)=ran(50)*12

for b=1 to tail
'z(b,a)=int(ran(26))+65
z(b,a)=int(ran(26))+97
'z(b,a)=int(ran(char))+1
next b

next a

open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window

for a=1 to tails

go(a)=go(a)+1
en(a)=en(a)+.1
if en(a)>10 en(a)=1

if go(a)>en(a) go(a)=1
if go(a)>en(a)-1 y(a)=y(a)+12

if y(a)>520+(tail*10) then
y(a)=0
x(a)=int(ran(64)+1)*10

for b=1 to tail
'z(b,a)=int(ran(26))+65
z(b,a)=int(ran(26))+97
'z(b,a)=int(ran(char))+1
next b

endif

for b=1 to tail
clear fill rectangle x(a)+1,y(a)-(b*12)-8 to x(a)+11,y(a)-(b*12)+2
next b

for b=1 to tail
setrgb 1,0,255+tail-(b*(255/tail)),0
text x(a),y(a)-(b*12),chr$(z(b,a))
'text x(a),y(a)-(b*12),key$(z(b,a))
'fill rectangle x(a),y(a)-(b*12)-8 to x(a)+10,y(a)-(b*12)+2
'fill circle x(1)+5,y(1)-4,5
next b

next a

until (1=0)

label symbol
data 26
data "!","@","#","%","^","&","*","(",")","-","+","=","<"
data ">","?","/","0","1","2","3","4","5","6","7","8","9"

Have a Yahappy day.
I don't know what is wrong with the world - but I know how to fix it.