mforan Posted March 6, 2009 Share Posted March 6, 2009 okay so im using a tick based system for my game... imagine there are a total of 10 ticks. i want to make it so that, firstly the first tick (1) is an instant attack. the second tick however will change the time limiter. it will enter into the database the current time + 2 minutes. thus meaning that the person cant attack anyone for 2 minutes. player waits for limit to end, then attacks again, this time adding + 4 minutes to the limit. the general idea is a need a way to exponentially increase the time limit.... 0, 2, 4, 8, 16, 32 ...... the trouble is i need to have this work for over 90 ticks.... not just 10. any ideas hows to exponentially increase the time limit in a good fashion? Quote Link to comment https://forums.phpfreaks.com/topic/148166-exponential-problem/ Share on other sites More sharing options...
Mark Baker Posted March 6, 2009 Share Posted March 6, 2009 It isn't an exponential, it's a power. for ($i = 0; $i <= 90; $i++) { echo 'pow(2,'.$i.') = '.pow(2,$i).'<br />'; } but you're going to start hitting accuracy errors once you get over 50 or so Quote Link to comment https://forums.phpfreaks.com/topic/148166-exponential-problem/#findComment-777769 Share on other sites More sharing options...
corbin Posted March 6, 2009 Share Posted March 6, 2009 Wouldn't it be exponential since it's 2^x? Quote Link to comment https://forums.phpfreaks.com/topic/148166-exponential-problem/#findComment-777776 Share on other sites More sharing options...
Mark Baker Posted March 6, 2009 Share Posted March 6, 2009 Wouldn't it be exponential since it's 2^x?I guess that pow() is a specific case of exp(), or more properly the other way round because exp(n) = pow(e,n) Quote Link to comment https://forums.phpfreaks.com/topic/148166-exponential-problem/#findComment-777780 Share on other sites More sharing options...
sasa Posted March 6, 2009 Share Posted March 6, 2009 btw 2^30 = 1 073 741 824 min = 17 895 697 h = 745 564 d > 2000 years. Are you shure to want this? Quote Link to comment https://forums.phpfreaks.com/topic/148166-exponential-problem/#findComment-777887 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.