| Silvan21 (3) | |||
|
So, I'm trying to figure out the amount of money a Golf player receives according to their position. However, often we have many players who end up in the same positioning. For example, sometimes there are 2 people in 1st place, 2 people in 2nd place, and 3 people in 3rd place. In this situation, we'd give 80% of the money split to first, and 20% of the money split to second, excluding 3rd place. Situation where it's 5 people in 1st, 2 people in 2nd, and 3 in 3rd, therefore making the pot be split within the first 5 people. The Pot itself is altered every day, as every player chips in every new game. Here's my code so far, and It doesn't work :( Help?
| |||
|
Last edited on
|
|||
| Script Coder (456) | |
|
Code Tags Please use code tags, if you want any help. To insert code tags, hit edit in the post above this one, and on the right hand side you should see something like: < > click it and insert all your code in between it. also, please read this: http://www.cplusplus.com/forum/beginner/1/ | |
|
|
|
| NwN (770) | |
|
Hi there, This is actually a maths question as far as I can see. You need a "distribution algorithm" (not sure if that's the correct term) for assigning the prizemoney to the players. It may be worth asking this question in the lounge - but make sure to highlight that what you need is the mathematical formula to calculate this. In addition to what Script Coder said, adding code tags is as easy as: [code] your code here [/code] Sorry I couldn't be of more help. All the best, NwN | |
|
|
|
| Silvan21 (3) | |
|
Script Coder, Thank you for the heads up, I appreciate you taking the time to do so. NwN, I understand what you mean, and am glad that math is the issue, as it's no surprise, my math skills aren't the greatest. Other than the math part, is there anything else I could do with the code, any other functions I should use? What do you guys think? Thank you. Cheers. | |
|
Last edited on
|
|
| NwN (770) | |
|
Hi there, It's a simple enough program that this should suffice. You could, if you want put the logic asking the user for information in a separate function, as well as the logic displaying the info to the user, but for a small structured program like this I would say that's not vital. All the best, NwN | |
|
|
|