This code makes a trail of randomly colored, random charecters follow your mouse.
S is the ammount of charecters.
Uncompressed version:
`modify to whatever you want
s=20
`don't modify
`speed boost
sync on
`fullscreen and hide the mouse
set window off : hide mouse
`randomize timer
randomize timer()
`create arrays
dim yomamax(s-1)
dim yomamay(s-1)
dim yomama$(s-1)
`for-loop to fill arrays
for t=1 to s-1
yomamax(t)=mousex()
yomamay(t)=mousey()
next t
`main loop
do
`ink black and clear screen
ink 0,0
cls
`for loop to bump the arrays and randomize chars
for t=s-1 to 0 step -1
if t>0
yomamax(t)=yomamax(t-1)
yomamay(t)=yomamay(t-1)
else
yomamax(t)=mousex()
yomamay(t)=mousey()
endif
yomama$(t)=chr$(rnd(254)+1)
next t
`for loop to draw the chars
`the ink command is outside the loop because it is slow as CRAP and still produces the same
`resaults like this.
ink rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255))
for t=0 to s-1
text yomamax(t),yomamay(t),yomama$(t)
next t
`draw the screen
sync
loop
Compressed version:
(2 lines)
s=20 : sync on : set window off : hide mouse : randomize timer() : dim yomamax(s-1) : dim yomamay(s-1) : dim yomama$(s-1) : for t=1 to s-1 : yomamax(t)=mousex() : yomamay(t)=mousey() : next t : do : ink 0,0 : cls : for t=s-1 to 0 step -1 : if t>0 : yomamax(t)=yomamax(t-1) : yomamay(t)=yomamay(t-1) : else : yomamax(t)=mousex() : yomamay(t)=mousey() : endif : yomama$(t)=chr$(rnd(254)+1) : next t
ink rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255)) : for t=0 to s-1 : text yomamax(t),yomamay(t),yomama$(t) : next t : sync : loop
1 line version(breaks rules):
s=20 : sync on : set window off : hide mouse : randomize timer() : dim yomamax(s-1) : dim yomamay(s-1) : dim yomama$(s-1) : for t=1 to s-1 : yomamax(t)=mousex() : yomamay(t)=mousey() : next t : do : ink 0,0 : cls : for t=s-1 to 0 step -1 : if t>0 : yomamax(t)=yomamax(t-1) : yomamay(t)=yomamay(t-1) : else : yomamax(t)=mousex() : yomamay(t)=mousey() : endif : yomama$(t)=chr$(rnd(254)+1) : next t : ink rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255)) : for t=0 to s-1 : text yomamax(t),yomamay(t),yomama$(t) : next t : sync : loop
Custom version:
(Custom chars)
`modify to whatever you want
s=20
`custom chars
`should contain s strings seperated with comas.
data "I","l","y","a"," ","R","o","x","0","r","z","","Y","o","u","!","!","!","!","!"
`don't modify
`speed boost
sync on
`fullscreen and hide the mouse
set window off : hide mouse
`randomize timer
randomize timer()
`create arrays
dim yomamax(s-1)
dim yomamay(s-1)
dim yomama$(s-1)
`fill with custom chars
for t=0 to s-1
read t$
yomama$(t)=t$
next t
`for-loop to fill arrays
for t=1 to s-1
yomamax(t)=mousex()
yomamay(t)=mousey()
next t
`main loop
do
`ink black and clear screen
ink 0,0
cls
`for loop to bump the arrays and randomize chars
for t=s-1 to 0 step -1
if t>0
yomamax(t)=yomamax(t-1)
yomamay(t)=yomamay(t-1)
else
yomamax(t)=mousex()
yomamay(t)=mousey()
endif
next t
`for loop to draw the chars
`the ink command is outside the loop because it is slow as CRAP and still produces the same
`resaults like this.
ink rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255))
for t=0 to s-1
text yomamax(t),yomamay(t),yomama$(t)
next t
`draw the screen
sync
loop
The default editor is fine.
Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"