- Joined
- Jan 26, 2006
- Messages
- 483
- Reaction score
- 6
Hey,
So I currently finished my little gamble application.
Its all working fine except for the percentage function.
We know you can calculate the percentage by doing:
Now I put this in c# with the variables:
Now when you gamble the right number it will do good++ and show 100% win which is good.
But when you lose it will do wrong++
When this happens the trouble starts it will give both winper and loseper the value of zero.
I cant find out even with the debugger why hes giving it zero there is no logical reason for this...
Thanks
-Darkco
So I currently finished my little gamble application.
Its all working fine except for the percentage function.
We know you can calculate the percentage by doing:
Code:
times you won / amount of games * 100
Code:
double winper, loseper;
int good = 0, amountgames = 0, wrong = 0;
winper = good / amountgames * 100;
textBox5.Text = winper.ToString();
loseper = wrong / amountgames * 100;
textBox6.Text = loseper.ToString();
Now when you gamble the right number it will do good++ and show 100% win which is good.
But when you lose it will do wrong++
When this happens the trouble starts it will give both winper and loseper the value of zero.
I cant find out even with the debugger why hes giving it zero there is no logical reason for this...
Thanks
-Darkco

