[Site Home] [Forum Home] [Articles] [File DB] [News Archives]

IceTeks Changes -> Added stock market!


(View original topic)


Red Squirrel - Apr-09-2004 server time
Not quite, but I happen to be the CEO so...... em320.gif

Nah for now this is the algorthm that is used for each update, it's very cheap but does the trick LOL:

CODE

1: $stockprice = (rand(0,1000)+$stockprice)/1.6;
2: if(rand(0,4)=="3")$stockprice = $stockprice /rand(1,5);
3: $stockprice = round($stockprice);


$stockprice is the value loaded from the file at startup (the current price)

This algorthm is only run if a certain time interval has passed by, at that time, it rewrites it to file and it's the new price, otherwise it just skips the processing and sticks with the same price.

line 2 is to make a mini depression once in a while because without that the stock price slowly gos up more then it goes down. Line 3 is only to make sure it stays out of the decimals.

manadren - Apr-09-2004 server time
So does that mean that I can artificially increase the stock price through creative accounting? laugh.gif

Red Squirrel - Apr-09-2004 server time
Notice the enron logo blended in the igloo for the stock market section. em321.gif

manadren - Apr-09-2004 server time
Buy! Buy! Buy!

hmmm I think I might've went overboard on that stock purchase tongue.gif

Red Squirrel - Apr-09-2004 server time
Looks like were on a depression, they went down big time. em320.gif

manadren - Apr-09-2004 server time
well I tripled my investment... I should've bought more tongue.gif Well I'll just have to wait until it goes down again and then blow all my free cash on stocks laugh.gif

sintekk - Apr-09-2004 server time
w007! 349 -> 800! I'm Rich!
I now have a maxed out defense tongue.gif

Red Squirrel - Apr-08-2004 server time
The next stock update should happen soon. I might set it so it changes more often though. Right now it changes once per 20 hours or so (just pitched an aproximate number in seconds. em320.gif)

sintekk - Apr-08-2004 server time
It all makes sense now! em320.gif
I hope the market pays off, I've invested in it big time em320.gif

Red Squirrel - Apr-08-2004 server time
Check the help file em320.gif http://www.iceteks.com/forums/cybervillage...php?topic=stock

sintekk - Apr-08-2004 server time
So, how does the system work?

Red Squirrel - Apr-07-2004 server time
The system is simple and straightfoward, check it out in the cybervillage and if you have any suggestions or questions post it here, check out the help file as well. cool.gif


(Showing 50 last posts, newest on top)