| |
|
|
p.specht
| Program shows, what The Moleküle with Verdichtung or. relaxation make (Rückwirkung on temperature and pressure). One uraltes C64-Program watts here nachempfunden.
Window Title "Kompression one Gases"
'(CL) CopyLeft 2014-04 by P. woodpecker, Wien 'No however geartete Gewähr!
Window Style 24:Randomize:var co&=rgb(rnd(41)+215,rnd(41)+215,rnd(41)+215)
Font 2:' Window 0,0-%maxx,%maxy-40 ' Vollbild
cls co&:var xx&=width(%hwnd):var yy&=height(%hwnd):var xh&=xx&\2:var yh&=yy&\2:var ri&=-1
$IFDEF Interpreter :var n&=22
$ELSE :var n&=100
$ENDIF
dec n&:Declare i&,j&,x![n&],y![n&],co&[n&],vx![n&],vy![n&]
x![]=rnd(xx&):y![]=rnd(yy&):co&[]=rgb(rnd(220),rnd(220),rnd(220))
vx![]=rnd(yy&/100)-4:vy![]=rnd(yy&/100)-4
var r&=12 :MCls %maxx,%maxy,co&
Repeat
Case xx&<(6*r&):ri&=1:Case xx&>width(%hwnd):ri&=-1:xx&=xx&+ri&
whileloop 0,n&:i&=&Loop
x![i&]=x![i&]+vx![i&]
if (x![i&]<r&) :x![i&]=r& :vx![i&]= abs(vx![i&]):endif
if (x![i&]>(xx&-r&)):x![i&]=xx&-r&:vx![i&]=-abs(vx![i&]):endif
y![i&]=y![i&]+vy![i&]
if (y![i&]<r&) :y![i&]=r& :vy![i&]= abs(vy![i&]):endif
if (y![i&]>(yy&-r&)):y![i&]=yy&-r&:vy![i&]=-abs(vy![i&]):endif
endwhile
StartPaint -1:CLS co&
usepen 0,1,0:line xh&,0 - xh&,yy&
usepen 0,2*r&,0
line xx&,yh& - width(%hwnd),yh&
line xx&,0 - xx&,yy&
whileloop 0,n&:i&=&Loop
usepen 0,2*r&,co&[i&]:line x![i&],y![i&] - x![i&]+1,y![i&]
endwhile
EndPaint
MCopyBMP 0,0-%maxx,%maxy>0,0;0
until %key=27:END
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/11/21 ▲ |
|
|
|