forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Chaos Theory Demo...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Jan 05, 2002 5:44 am    Post subject: Chaos Theory Demo... Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group