.. I had some bugs when I compressed the code... I looked each lines two time, so now it should work..
if you write a cls in the same line than a line ( cls:line x,y,x,y" ), the cls doesn't work, and if you use loop and sync in the same line, the sync do as the cls when it's in the same line than ....
set display mode 800,600,16 : sync on:sync rate 50:randomize timer():set text size 16
type info:x:y:movx:movy:endtype
dim p(200) as info
for t=1 to 200: p(t).x = rnd(349)+1: p(t).y = 32+ rnd(576): p(t).movx = rnd(4)+1: p(t).movy = rnd(4)+1
next t:do:cls
line 395,30,395,280:line 405,30,405,280:line 395,280,405,280
line 395,600,395,320:line 405,600,405,320:line 395,320,405,320:line 1,30,799,30:line 1,599,799,599
line 1,30,1,599:line 799,30,799,599:left = 0:right = 0:for t=1 to 200
for u = 0 to abs(p(t).movx): if p(t).movx > 0 then mx = 1 else mx = -1
if rgbr(point(p(t).x + mx,p(t).y))>0 then p(t).movx = p(t).movx * (-1)
if p(t).movx > 0 then mx = 1 else mx = -1
p(t).x = p(t).x + mx
next u
for u = 0 to abs(p(t).movy)
if p(t).movy > 0 then my = 1 else my = -1
if rgbr(point(p(t).x,p(t).y + my))>0 then p(t).movy = p(t).movy * (-1): if p(t).movy > 0 then my = 1 else my = -1
p(t).y = p(t).y + my : next u : dot p(t).x,p(t).y : if p(t).x < 400 then left = left+1 else right = right + 1
next t
center text 400,10,"Nombre de particules à gauche : "+str$(left)+" -- Nombre de particules à droite : "+str$(right): center text 100,10,"Pourcentage : " + str$(0.5*left): center text 700,10,"Pourcentage : " + str$(0.5*right):sync
loop
not very compressed, but 20 lines, and often less than the maximum commands autorised
I'm following John, but I'm not john.
Lol, it is funnier in french