Page 5 of 8

Posted: Wed Apr 26, 2006 10:16 pm
by bryan
if anyone wants any ti programming done, i can do it.

im just finishing up on my connect-4 game. if anyone has an idea how to build a wintest (ie to test if someone has won) or an ai for it, it would be helpful.

i might give a chess game a go next, but that is a fair bit harder.

Posted: Thu Apr 27, 2006 8:10 am
by agapooka
WhiteyDude wrote:The formulas for basicly everything game related were in it :P. Thanks for the source Pooks - seems pretty basic once you know the numbers...


It wouldn't be too hard for the game administration to impliment into the game either...


Little popup window on the side with a php calc based on what you have ingame...




/Whitey


Indeed, it is simple. I have the rest of my day off, but it is bright and sunny. Maybe I'll update the scripty later, and perhaps make it intergrateable with the game.

Posted: Thu Apr 27, 2006 9:04 am
by Legoless
Well, I was thinking all kinds of formulas for stats, etc.. :) But I've gotten them all from Seijuro's calculator, thanks for that. ;)

Posted: Thu Apr 27, 2006 1:43 pm
by Legoless
Well, now that spy action formula changed, could anyone try to type it down? Thanks..

Posted: Fri Apr 28, 2006 2:45 am
by bryan
you want a ti program or a php one?


the ti one is very easy, i can give you the source, but you will need to know how to type it up.

just tell me how integrated you want it, like all in one or something, with getkeys or simple menus.

Posted: Sat Apr 29, 2006 2:21 am
by Legoless
Not doing PHP one, although updating Seijuro's calc would be good idea.

Posted: Sat Apr 29, 2006 8:19 am
by GhostyGoo
Sleipnir wrote:
Zekk wrote:dude! awsome! :D

btw, whats TI-83?

*novice programer*


Apparently, it's the new way of teaching math to kids these days. Ah, back in ye olden days, when we had such sophisticated tools as our heads, and pen n paper. No programmable calculators for me. If something comes up that a simple calculator or pen and paper can't fix, Matlab is my next stop.


I still use a system of mung beans threaded with cotton...

Posted: Sat Apr 29, 2006 9:33 am
by agapooka
Oh, so that's what became of those beans that you wouldn't eat at the table when you were young... *tisk tisk*

Well, I'm glad that they helped you become the mathemagician that you've become.

Posted: Sat Apr 29, 2006 9:51 am
by GhostyGoo
Yup yup ....i was ever so resourceful as a child; i pickled the beans and then threaded them.

Posted: Sat Apr 29, 2006 12:37 pm
by bryan
abacus are good too


good work on your locking spree too goo.

Posted: Fri May 12, 2006 12:57 pm
by agapooka
I posted it in the other thread, but this is my official calcualtor thread, so heregoes. My calculator can be found here: http://jason.streamdown.net/up.php

It can now calculate sabs.

Posted: Sat Jun 03, 2006 4:21 am
by agapooka
The calculator has been updated once more. Most of it is so that I can edit more easily, and this more frequently. :P

The calculator can still be found at http://jason.streamdown.net/up.php

If you have any suggestions, post them here. This can include idea for new calculations and you may even request for a shorter easier-to-remember URL (but it will basically just redirect to the current one, so anyone that has the page saved in their favourites doesn't have to worry :) ).

BUT, I did "add" fleet hangar cost calculations. The cost for fleet hangars is the same as mothership weapons, though, so it wasn't much of an addition.

The code, however, has changed quite a bit. I was able to reduce it to about 60% of what it used to be :).

Here is the source:

Code: Select all

<?php 
$a = $HTTP_GET_VARS['a'];
$b = $HTTP_GET_VARS['b'];
$c = $HTTP_GET_VARS['c'];
$p = $HTTP_GET_VARS['p'];

if ($a == '') { $a = '0'; }
if ($b == '') { $b = '0'; }
if ($c == '') { $c = '0'; }
if ($p == '') { $p = '0'; }

$title = "Pookie's TGW Calculator";
$fname = "up.php";
$version = "2.0.2";
$release = "3rd of June 2006";
$disclaimer = "Property of Jason Lambert (Agapooka)<br />Pookie TGW Calculator version ".$version.", released on the ".$release.".";

for ($i=0; $i<=7; $i++) {
   if ($i == $p)
    {
    $sel[$i] = " selected";
    }
    else
    {
    $sel[$i] = "";
    }
   }

$head = "<html><title>".$title."</title><head><center><h1>".$title."</h1></center></head>";
$body = "<body><center><table width=500 cellspacing=3 cellpadding=3 border=1>";
$tbl0 = "<tr><td width=100%><center><form action='".$fname."' method=get>";
$frma = "<input size=8 maxlength=22 value=".$a." name=a />";
$frmb = "<input size=8 maxlength=22 value=".$b." name=b />";
$frmc = "<input size=8 maxlength=12 value=".$c." name=c />";
$frmp = "<select name='p'>
      <option value=0".$sel[0].">Calculate:</option>
      <option value=1".$sel[1].">Unit Production Cost</option>
      <option value=2".$sel[2].">Ascended Fleet Cost</option>
      <option value=3".$sel[3].">MS Weapon Capacity and Fleet Hangar Cost</option>
      <option value=4".$sel[4].">MS Shield Capacity Cost</option>
      <option value=5".$sel[5].">Spy Levels</option>
   <option value=6".$sel[6].">Sabotage</option>
   <option value=7".$sel[7].">Planets (coming soon!)</option></select>";
$frm0 = "<input type=submit value='GO!' />"; 
$foot = "</form></center></td></tr></table><small>".$disclaimer."</small></center></body></html>";

if ($p == '0')
   {
   echo $head,$body,$tbl0,$frmp,$frm0,$foot;
   }
if ($p == '1')
   {
   $currency = "Naquadah";
   $ans = (-1*($a-$b)/3)*((15000*(($b-1)/3)+15000*(($a+2)/3))/2);
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0,$frma,$frmb,$frmp,$frm0,$answ,$foot;
   }
if ($p == '2')
   {
   $currency = "Dark Matter Units";
   $ans = (-1*($a-$b))*(((5000*($b-1)+5000*($a+4))/2));
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0,$frma,$frmb,$frmp,$frm0,$answ,$foot;
   }
if ($p == '3')
   {
   $currency = "Naquadah";
   $ans = (-1*($a-$b))*(((10000*($b-1)+10000*($a+2))/2));
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency."<br /><small>*Fleet hangars come at the same cost as weapon capacity.</small>";
   echo $head,$body,$tbl0,$frma,$frmb,$frmp,$frm0,$answ,$foot;
   }
if ($p == '4')
   {
   $currency = "Naquadah";
   $ans = (-1*($a-$b))*(((12000*($b-1)+12000*($a+(10/12)))/2));
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0,$frma,$frmb,$frmp,$frm0,$answ,$foot;
   }
if ($p == '5')
   {
   $currency = "Naquadah";
   $ans = (6000*pow(2,($c-1)));
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency."<br />Cost for Replicators:    

".number_format(0.9*$ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0,$frmc,$frmp,$frm0,$answ,$foot;
   }
if ($p == '6')
   {
   $currency = "spies must be sent";
   $ans = 1.01*($a/(($b+1)/($c+1)))+1;
   $answ = "<br />".number_format($ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0."Enemy covert action:".$frma."<br />Your covert action:".$frmb."<br />How many spies you

have:".$frmc."<br />".$frmp,$frm0,$answ,$foot;
   }
if ($p == '7')
   {
   echo $head,$body,$tbl0,$frmp,$frm0."<br /><br />Coming when they are updated and actually useful! <img src='http://www.jason.streamdown.net/icon_razz.gif' alt=':-P' />".$foot;
   }
?>

Posted: Sat Jun 03, 2006 5:13 am
by Kaitou
Awesome work, if only I understood all that code stuff :P

Posted: Sat Jun 03, 2006 12:39 pm
by -lil evil genious-
its incredable how simple the code is wen u think about it...wow...i wish i had someone that culd teach me how to program...and software obviously :D

i tried to learn from various sights but i started to forget it rly quickly....dang my memory....

kwl calcs...ill probs use em properly in the future :D :-D

tanks

Posted: Sun Jun 11, 2006 4:12 pm
by Paul-ish
I'm not great at math but in the equation you made
(-1(A-B)/3)((15000((B-1)/3)+15000((A+2)/3))/2)
the

Code: Select all

(-1(A-B)/3)
part of the equation sticks out to me. that part is meant to find one third of the difference of the two numbers (the current UP and target UP) so to be more understandable, and if you want to make it less taxing on any computer/calculators couldn't you make it easier by saying

Code: Select all

((B-A)/3)
instead. It makes it easier on the eyes mostly. Tell me, am i wrong?