Home » Stars! Clones, Extensions, Modding » FreeStars » some questions about coding
| |
Re: some questions about coding |
Fri, 20 October 2006 21:34 |
|
|
Hey, I've ported ConstB's advantage point calculator into Flash, but I am not getting consistent results.
I've never buggered around with C++ compilers before, and the free ones seem to be a pain in the butt for a non C++ guy. Could someone please compile zz.cpp with all of the couts uncommented? I need to see where my results are diverging from his.
If anyone can suggest a good free compiler I can use to compile it myself, that would also be great. Tried Mars, but I can't figure out the STL stuff.
Thanks
The Dopelar Effect:
The tendancy for stupid ideas to seem more intelliegent when they come at you rapidly.Report message to a moderator
|
|
| | |
Re: some questions about coding |
Sat, 21 October 2006 16:24 |
|
|
I could do that, yes. But in that case, all I see is the end result, which is very unhelpful in finding out where my code is broken. ConstB's code has couts to display what it's getting at every step of the calculation, so I can put the same output in my code and see where we diverge.
I don't really need to start testing other races until I can get the default ones to come up right (they don't. not even close)
The Dopelar Effect:
The tendancy for stupid ideas to seem more intelliegent when they come at you rapidly.Report message to a moderator
|
|
| |
Re: some questions about coding |
Sat, 21 October 2006 18:26 |
|
|
I just mean the ones for each major step. The whole planet hab calculation only counts as one step.
I've gottten it very close; there was a problem because Flash 8 doesn't have a proper integer data type, so I had to go in and manually round off after every division. The remaining problem might be because rounding is needed within the context of a calculation, rather than needing to round the result.
Current results:
########## Humanoids ##########
Step 1, points = 1650
Step 2, hab points = 1649
Step 3, points = -205
Step 4, points = -205
Step 5, points = -205
Step 6, points = 5
Step 7, points = 71
Step 8, points = 71
Returning final value of 23.6666666666667
adv points: 23 must be: 25
########## Rabbitoids ##########
Step 1, points = 1650
Step 2, hab points = 945
Step 3, points = -121
Step 4, points = 47
Step 5, points = 12
Step 6, points = -28
Step 7, points = 97
Step 8, points = 97
Returning final value of 32.3333333333333
adv points: 32 must be: 32
########## Insectoids ##########
Step 1, points = 1650
Step 2, hab points = 2101
Step 3, points = 337
Step 4, points = 477
Step 5, points = 477
Step 6, points = 1272
Step 7, points = 1296
Step 8, points = 126
Returning final value of 42
adv points: 42 must be: 43
########## Nucleotids ##########
Step 1, points = 1650
Step 2, hab points = 4224
Step 3, points = -990
Step 4, points = -990
Step 5, points = -1590
Step 6, points = -530
Step 7, points = -985
Step 8, points = 25
Returning final value of 8.33333333333333
adv points: 8 must be: 11
########## Silicanoids ##########
Step 1, points = 1650
Step 2, hab points = 11979
Step 3, points = 1757
Step 4, points = 1607
Step 5, points = 185
Step 6, points = 348
Step 7, points = 158
Step 8, points = 28
Returning final value of 9.33333333333333
adv points: 9 must be: 9
########## Antetherals ##########
Step 1, points = 1650
Step 2, hab points = 626
Step 3, points = 3666
Step 4, points = 3946
Step 5, points = 1518
Step 6, points = 1592
Step 7, points = 2103
Step 8, points = 23
Returning final value of 7.66666666666667
adv points: 7 must be: 7
The Dopelar Effect:
The tendancy for stupid ideas to seem more intelliegent when they come at you rapidly.Report message to a moderator
|
|
|
Re: some questions about coding |
Sun, 22 October 2006 21:05 |
|
|
Someone got me sorted with DevC++, so I was able to debug my planet hab calculations successfully. For the default races, the results are perfect now.
Time to start comparing with the real race wizard now...
The Dopelar Effect:
The tendancy for stupid ideas to seem more intelliegent when they come at you rapidly.Report message to a moderator
|
|
| |
Goto Forum:
Current Time: Mon May 13 04:22:13 EDT 2024
|