Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Jan 05, 2002 5:44 am Post subject: Chaos Theory Demo... |
|
|
I got this algorithm off the net and put together
a demo with it. It generates "chaotic" numbers
simply by repeating itself. It's a simple one line
formula, but I thought it was kinda interesting.
Some combinations (such as x = .5 and y = 4)
will stabilize the equation at zero.
_________________________________________________________________________________________________________________________________________________________
Code: |
OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE,Chaos Theory Demo,-1,0,240,60
DIALOG ADD,TEXT,T1,3,5,,,"Enter number between 0 and 1"
DIALOG ADD,TEXT,T2,23,5,,,"Enter number from 1 through 4"
DIALOG ADD,EDIT,E1,0,160,30,20,".1"
DIALOG ADD,EDIT,E2,20,160,30,20,"4"
DIALOG ADD,BUTTON,Start,0,195,40,20
DIALOG ADD,BUTTON,Stop,20,195,40,20
DIALOG ADD,STATUS,Stat
DIALOG SHOW
:StopBUTTON
:EVLOOP
WAIT EVENT
goto @event()
:StartBUTTON
%x = @dlgtext(E1)
%y = @dlgtext(E2)
if @not(@numeric(%x))@greater(%x, .999)@greater(.001, %x)@not(@numeric(%y))@greater(%y, 4)@greater(1, %y)
INFO Invalid entry... @tab()
goto EVLOOP
end
REPEAT
rem -- Algorithm will stabilize at some entries. --
%x = @fmul(@fmul(%y, %x), @fsub(1, %x))
DIALOG SET, STAT, %x
WAIT ".3"
%e = @event()
UNTIL %e
goto %e
:CLOSE
EXIT
|
_________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|