Dark Bit Factory & Gravity

PROGRAMMING => Other languages => Yabasic => Topic started by: bikemadness on November 24, 2021

Title: Matrix 3Letter Redux
Post by: bikemadness on November 24, 2021
Simplified revision of a previous post.

Faster because of it.

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

tails=21
tail=12

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

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

for b=1 to tail
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)+gap(a)
en(a)=en(a)+.1
if en(a)>10 en(a)=0

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

if y(a)>520+(tail*12) then
y(a)=0

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

endif

for b=1 to tail
setrgb 1,0,255+tail-(b*(255/tail)),0
text x(a),y(a)-(b*12),word$(z(b,a))
next b

next a

until (1=0)


label words
data 118
data "aid","ail","aim","air"
data "all","and","any","are"
data "arm","art","ask","ate"
data "awe","bad","ban","bar"
data "beg","bet","bid","big"
data "bit","but","buy","bye"
data "can","cap","cob","con"
data "cop","coy","cry","cue"
data "day","did","due","dye"
data "eat","end","era","far"
data "few","fit","for","gap"
data "get","got","had","has"
data "her","hid","him","his"
data "how","its","job","joy"
data "lag","lap","lay","led"
data "let","lie","lot","low"
data "may","new","nod","nor"
data "not","now","odd","off"
data "old","one","opt","our"
data "out","owe","own","pat"
data "pry","put","ran","raw"
data "ray","red","rid","rot"
data "row","rub","run","sad"
data "sag","sat","say","sea"
data "see","set","she","sit"
data "six","ten","the","too"
data "try","two","use","vow"
data "was","way","who","why"
data "win","woe","won","yes"
data "yet","you