.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 2: The Ascension Wars (http://forum.shrapnelgames.com/forumdisplay.php?f=55)
-   -   Arryn's PD calculator v1.01 (http://forum.shrapnelgames.com/showthread.php?t=18179)

Arryn March 6th, 2004 05:06 PM

Arryn\'s PD calculator v1.01
 
I've put up on my website a Java utility I wrote to calculate PD costs for those that are too lazy to use a calculator, or that don't wish to use a spreadsheet. http://forum.shrapnelgames.com/images/icons/icon12.gif

The direct link to the file is here.

EDIT: converted into a .jar file for your convenience. Anyone who downloaded the .rar should re-download.

If anyone finds this to be a useful tool, please let me know. Constructive comments and suggestions are also always welcome.

[ March 06, 2004, 16:54: Message edited by: Arryn ]

Nagot Gick Fel March 6th, 2004 06:13 PM

Re: Arryn\'s PD calculator v1.01
 
Is it right? It's a bit hard to read on my browser, but I think I can read "10 to 21 costs 165 gold" (?). That should be 176 if I'm not mistaken. I believe the formula is

(1 + initial + target) * (target - initial) / 2

[ March 06, 2004, 16:14: Message edited by: Nagot Gick Fel ]

alexti March 6th, 2004 06:21 PM

Re: Arryn\'s PD calculator v1.01
 
Quote:

Originally posted by Arryn:
I've put up on my website a Java utility I wrote to calculate PD costs for those that are too lazy to use a calculator, or that don't wish to use a spreadsheet. http://forum.shrapnelgames.com/images/icons/icon12.gif

Screenshot of the program showing:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Initial PD: 10
Target PD: 21
Cost to raise PD: 165</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">

<font size="2" face="sans-serif, arial, verdana">May I ask you if the image shows the real output?To my knowledge, the cost to raise PD from 10 to 21 is 176, not 165. And for extremely lazy people (like me http://forum.shrapnelgames.com/images/icons/icon12.gif ) who can't be bothered to start the program to do the calculation, the formula seems to be (n1+n0+1)*(n1-n0)/2. n0 is starting PD, n1 is target PD.

alexti March 6th, 2004 06:23 PM

Re: Arryn\'s PD calculator v1.01
 
Quote:

Originally posted by Nagot Gick Fel:
Is it right? It's a bit hard to read on my browser, but I think I can read "10 to 21 costs 165 gold" (?). That should be 176 if I'm not mistaken.
<font size="2" face="sans-serif, arial, verdana">Yeah, I've noticed it too. It must be that the marketing department was producing promotional materials before the program was completed http://forum.shrapnelgames.com/images/icons/icon12.gif

Arryn March 6th, 2004 06:50 PM

Re: Arryn\'s PD calculator v1.01
 
Fixed. A stupid error. Worked correctly for *even* numbers, and silly me forgot to test with odd ones.

Thanks to the both of you for the catch.

http://www.bl23c.com/arryn/images/PDcalc.jpg

The direct link to the file is here.

Nagot Gick Fel March 6th, 2004 07:29 PM

Re: Arryn\'s PD calculator v1.01
 
Quote:

Originally posted by Arryn:
Worked correctly for *even* numbers, and silly me forgot to test with odd ones.
<font size="2" face="sans-serif, arial, verdana">Why test? The formula applies to odd and even number just the same.

Arryn March 6th, 2004 08:59 PM

Re: Arryn\'s PD calculator v1.01
 
Quote:

Originally posted by Nagot Gick Fel:
Why test? The formula applies to odd and even number just the same.
<font size="2" face="sans-serif, arial, verdana">Forgive me for saying this, but "why test?" is a stupid question. Lesson #1 in programming: All software needs to be tested, and thoroughly. Just because the *formula* works doesn't mean that the *implementation* of the formula in code works as intended. http://forum.shrapnelgames.com/images/icons/icon12.gif

Nagot Gick Fel March 7th, 2004 01:42 AM

Re: Arryn\'s PD calculator v1.01
 
Quote:

Originally posted by Arryn:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">Originally posted by Nagot Gick Fel:
Why test? The formula applies to odd and even number just the same.

<font size="2" face="sans-serif, arial, verdana">Forgive me for saying this, but "why test?" is a stupid question. Lesson #1 in programming: All software needs to be tested, and thoroughly. Just because the *formula* works doesn't mean that the *implementation* of the formula in code works as intended. http://forum.shrapnelgames.com/images/icons/icon12.gif </font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Ah OK. And it wasn't a stupid question, only a misunderstanding: I thought you "tested" for even/odd numbers in your code, which of course has nothing to do with "testing" software.


All times are GMT -4. The time now is 01:25 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.