Ok, as requested the version below works with all recent TSE variants for all screen sizes, though it limits its own breadth and width to 255 characters.
It does not need the special .si extension: a normal .s extension will work.
Apart from those two changes I kept its code as similar as possible, which means it is still pretty unreadable.
Carlo
integer N = 0
integer M = 0
integer O = 0
integer proc foreg(integer n)
case n
when 0 return (Color(Black))
when 2 return (Color(Green))
when 10 return (Color(Bright Green))
when 11 return (Color(Bright Cyan))
endcase
return (0)
end
integer proc backg(integer n)
case n
when 0 return (Color(Black))
when 2 return (Color(Green))
endcase
return (0)
end
proc d(integer f, integer b, integer x, integer y)
if (x in 1 .. N)
and (y in 1 .. M)
Set(Attr, foreg(f) + backg(b))
PutCharXY(x, y, Chr(33 + (x * y) mod 200))
endif
end
proc Main()
string t[255]
integer x, y
N = Min(Query(ScreenCols) , 255)
M = Min(Query(ScreenRows) , 255)
O = Min(Query(ScreenRows) + 6, 255)
PopWinOpen(1, 1, N, M, 0, "", 7)
SetCursorOff()
Set(Attr, 0)
ClrScr()
for x = 1 to N
t[x] = Chr(Random(1, M))
endfor
while not KeyPressed()
for x = 1 to N
if Asc(t[x]) >= O
t[x] = Chr(0)
endif
t[x] = Chr(Asc(t[x]) + 1)
y = Asc(t[x])
d( 0, 0, x, y - 6)
d( 2, 0, x, y - 5)
d( 2, 0, x, y - 4)
d(10, 0, x, y - 3)
d(10, 0, x, y - 2)
d(11, 0, x, y - 1)
d( 0, 2, x, y)
endfor
Delay(1)
endwhile
SetCursorOn()
GetKey()
PopWinClose()
PurgeMacro(CurrMacroFilename())
end