Hey there im doing a simple two up dos program for an assignment and im having some issues, we have been given a skeleton with methods and forms within it and im pretty sure were not allowed to change it. heres my code:
class TwoUp {
Coin coin1 = new Coin();
Coin coin2 = new Coin();
void Play_TwoUp() {
const int HEADS = 0;
const int TAILS = 2;
//const int ODDS = 1;
int coin_one = coin1.Flip();
int coin_two = coin2.Flip();
int score = coin_one + coin_two;
int player_score = 0;
int house_score = 0;
switch (score) {
case HEADS:
Console.WriteLine("You threw Heads - You've won!");
player_score++;
break;
case TAILS:
Console.WriteLine("You thre Tails - You loose.");
house_score++;
break;
default:
Console.WriteLine("You threw Odds - Throw again.");
//Replay();
break;
}
}
void Replay() {
Play_TwoUp();
}
public TwoUp() {
}
public void Play(int menuOption) {
Play_TwoUp();
}
} //end class TwoUp
}
My problem is that the int coin_one = coin1.Flip(); and coin2.Flip()
come up as cannot convert void to int, however i do have another game which required me to do the same and it has worked by doing it the same way. both are void methods.