English
Experimente

Kompression one Gases in principle simulate

 

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 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/11/21  
 



Zum Experiment


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

502 Views

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie