Now open-source TGW calculator

Forum for all general ingame discussion.
Post Reply
Zeon
Forum Elite
Posts: 1851
Joined: Fri Nov 11, 2005 8:20 pm
Alliance: THe criminal web
ID: 0

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 agree. Its crazy my TI 84 hooks into my computer and downloads software. What ever happened to 1+1+1+=4.....oh thats probibly why I need a calculator.
Sovetski wrote:Once FRA always FRA, we are almost as addictive as this game.
Image
bryan
Forum Intermediate
Posts: 966
Joined: Mon Jun 20, 2005 7:57 pm

hmm, the formula seem to be a little different to what i was expecting.

you have a b^2, hmmmm.

these are my formula i work out quite some time ago


Total Naq need for up number x: 15000(3x+1)

Total Naq need for up giving you x untrained per day: 5000(x-1)

Total Naq needed to get UP to number x: 7500x(x+1)

Total Naq needed to get up giving you x untrained per day: 833.33(x^2+x-2)


i suppose you are using the first one, but really, shouldnt you be using the last 1?
agapooka
Semper Ubi Sub Ubi
Posts: 2607
Joined: Thu Mar 31, 2005 4:34 am
ID: 0

Honours and Awards

I'll just post the source again, since I recently updated it a bit (well, mostly so that the source is cleaner and easier to edit).

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'; }

$title = "Pookie's TGW Calculator";
$fname = "up.php";
$disclaimer = "Property of Jason Lambert (Agapooka)";

$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=8 value=".$a." name=a />";
$frmb = "<input size=8 maxlength=8 value=".$b." name=b />";
$frmc = "<input size=3 maxlength=3 value=".$c." name=c />";
$frm0 = "<input type=submit value='GO!' />"; 
$foot = "</form></center></td></tr></table><small>".$disclaimer."</small></center></body></html>";

if ($p == '' || $p == '0')
   {
   $frmp = "<select name='p'>
      <option value=0 selected>Calculate:</option>
      <option value=1>Unit Production Cost</option>
      <option value=2>Ascended Fleet Cost</option>
      <option value=3>MS Weapon Capacity Cost</option>
      <option value=4>MS Shield Capacity Cost</option>
      <option value=5>Spy Levels</option></select>";
   echo $head,$body,$tbl0,$frmp,$frm0,$foot;
   }
if ($p == '1')
   {
   $frmp = "<select name='p'>
      <option value=0>Calculate:</option>
      <option value=1 selected>Unit Production Cost</option>
      <option value=2>Ascended Fleet Cost</option>
      <option value=3>MS Weapon Capacity Cost</option>
      <option value=4>MS Shield Capacity Cost</option>
      <option value=5>Spy Levels</option></select>";
   $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')
   {
   $frmp = "<select name='p'>
      <option value=0>Calculate:</option>
      <option value=1>Unit Production Cost</option>
      <option value=2 selected>Ascended Fleet Cost</option>
      <option value=3>MS Weapon Capacity Cost</option>
      <option value=4>MS Shield Capacity Cost</option>
      <option value=5>Spy Levels</option></select>";
   $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')
   {
   $frmp = "<select name='p'>
      <option value=0>Calculate:</option>
      <option value=1>Unit Production Cost</option>
      <option value=2>Ascended Fleet Cost</option>
      <option value=3 selected>MS Weapon Capacity Cost</option>
      <option value=4>MS Shield Capacity Cost</option>
      <option value=5>Spy Levels</option></select>";
   $currency = "Naquadah";
   $ans = (-1*($a-$b))*(((10000*($b-1)+10000*($a+2))/2));
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0,$frma,$frmb,$frmp,$frm0,$answ,$foot;
   }
if ($p == '4')
   {
   $frmp = "<select name='p'>
      <option value=0>Calculate:</option>
      <option value=1>Unit Production Cost</option>
      <option value=2>Ascended Fleet Cost</option>
      <option value=3>MS Weapon Capacity Cost</option>
      <option value=4 selected>MS Shield Capacity Cost</option>
      <option value=5>Spy Levels</option></select>";
   $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')
   {
   $frmp = "<select name='p'>
      <option value=0>Calculate:</option>
      <option value=1>Unit Production Cost</option>
      <option value=2>Ascended Fleet Cost</option>
      <option value=3>MS Weapon Capacity Cost</option>
      <option value=4>MS Shield Capacity Cost</option>
      <option value=5 selected>Spy Levels</option></select>";
   $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;
   }
?>


My UP formula is

-((a-b)/3)((15000((b-1)/3)+15000((a+2)/3))/2)

Bryan's last formula is good, except that it can only calculate the cost if you're starting at 0 (or 1) UP. Mine can start from wherever and end wherever.

All the formulas are in the code. They can be seen as whatever is after a $ans = thingy.

-Jason
Last edited by agapooka on Fri Apr 21, 2006 6:40 pm, edited 1 time in total.
Agapooka wrote:The argument that because a premise cannot be proven false, it must be true, is known as a Negative Proof Fallacy in logic.
Mister Sandman wrote:Nothing at all near the negative proof fallacy in logic. If it cannot be proven false, it has to be true.
Pooka's UU Market Loyalty Card:

Rudy Pena: 1 stamp!

A Spider: 1 stamp!
User avatar
vinny d
Forum Expert
Posts: 1276
Joined: Thu Oct 13, 2005 6:29 pm
Alliance: House Stark
Race: Nano-ti
ID: 27317

{1,15000}
{ans(1)+3,ans(2)+15000}

U.P. For ti-83, though that shows all the levels, not specific amounts.

{0,6000}
{ans(1)+1,ans(2)*2}

Spy levels, none reps. For reps, just divide by 10 and times by 9.

Now, i don't know how to make these programs on my Ti-83, but if you guys know how, do it up.
Image
agapooka
Semper Ubi Sub Ubi
Posts: 2607
Joined: Thu Mar 31, 2005 4:34 am
ID: 0

Honours and Awards

Don't divide by 10 and then multiply by 9, just multiply by 0.9.

Anyways, the TI-83 (will work with TI-84 too, duh :P) program should be (type this in the program editor, of course, the ":" does not need to be typed, it just means that it is a new line. If you have a TI-whatever, you ought to know what I'm referring to):

Code: Select all

:Disp "A=CURRENT UP"
:Disp "B=DESIRED UP"
:Prompt A,B
:Disp (-1((A-B)/3)((15000((B-1)/3)+15000((B+2)/3))/2))
Agapooka wrote:The argument that because a premise cannot be proven false, it must be true, is known as a Negative Proof Fallacy in logic.
Mister Sandman wrote:Nothing at all near the negative proof fallacy in logic. If it cannot be proven false, it has to be true.
Pooka's UU Market Loyalty Card:

Rudy Pena: 1 stamp!

A Spider: 1 stamp!
bryan
Forum Intermediate
Posts: 966
Joined: Mon Jun 20, 2005 7:57 pm

ti programming is a lot of fun, im currently attempting to build a basic intergration by parts program. it will be interesting to see if i can.


thats not my problem agapooka, my formula is easy to get from a - b, just subtract a. the problem is that your formula looks completely different, not even the constants or basic fom is the same.
agapooka
Semper Ubi Sub Ubi
Posts: 2607
Joined: Thu Mar 31, 2005 4:34 am
ID: 0

Honours and Awards

Everything that I do in the matter of arithmetics is unorthodox.

I make my own theorems for my classes, and the teachers don't understand them, they just see that they work...

Oh well.
Agapooka wrote:The argument that because a premise cannot be proven false, it must be true, is known as a Negative Proof Fallacy in logic.
Mister Sandman wrote:Nothing at all near the negative proof fallacy in logic. If it cannot be proven false, it has to be true.
Pooka's UU Market Loyalty Card:

Rudy Pena: 1 stamp!

A Spider: 1 stamp!
User avatar
vinny d
Forum Expert
Posts: 1276
Joined: Thu Oct 13, 2005 6:29 pm
Alliance: House Stark
Race: Nano-ti
ID: 27317

Back to the divide by 10 times by 9. I find myself doing things like that quite often. I can never go simple, complex. Grrr oh well, and i don't know how to create calculator programs. If i did know, I probably would have a lot of the games formulas programmed.
Image
Legoless
Fledgling Forumer
Posts: 181
Joined: Sat Jan 07, 2006 3:51 am
Alliance: ArvYStaTe.net
Race: Developer

Thanks guys, this was really helpful. Does anyone have any more formulas for actions? Strike action, def, covert, got it for MS, thanks to vinny.
agapooka
Semper Ubi Sub Ubi
Posts: 2607
Joined: Thu Mar 31, 2005 4:34 am
ID: 0

Honours and Awards

I could always make some. It shouldn't be too hard, actually.
Agapooka wrote:The argument that because a premise cannot be proven false, it must be true, is known as a Negative Proof Fallacy in logic.
Mister Sandman wrote:Nothing at all near the negative proof fallacy in logic. If it cannot be proven false, it has to be true.
Pooka's UU Market Loyalty Card:

Rudy Pena: 1 stamp!

A Spider: 1 stamp!
Legoless
Fledgling Forumer
Posts: 181
Joined: Sat Jan 07, 2006 3:51 am
Alliance: ArvYStaTe.net
Race: Developer

That would be great Agapooka. :)
~mist~

not a bad calucalotro....
Legoless
Fledgling Forumer
Posts: 181
Joined: Sat Jan 07, 2006 3:51 am
Alliance: ArvYStaTe.net
Race: Developer

I've heard those formulas were on The Deity's guide, but I cant find it anymore, can someone mail me it or pm please?
agapooka
Semper Ubi Sub Ubi
Posts: 2607
Joined: Thu Mar 31, 2005 4:34 am
ID: 0

Honours and Awards

This isn't about Deity; besides, what formulas are you even referring to?
Agapooka wrote:The argument that because a premise cannot be proven false, it must be true, is known as a Negative Proof Fallacy in logic.
Mister Sandman wrote:Nothing at all near the negative proof fallacy in logic. If it cannot be proven false, it has to be true.
Pooka's UU Market Loyalty Card:

Rudy Pena: 1 stamp!

A Spider: 1 stamp!
WhiteyDude
Forum Intermediate
Posts: 845
Joined: Thu Feb 24, 2005 4:44 pm
ID: 0
Location: SGC Australia
Contact:

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
SHIFT TONE! OMG!

STFUBBQ?

SGW-irc founder

Image
It means Perseverance
Post Reply

Return to “StarGateWars General”