Alright, I appreciate your clarification,
basically I don't expect to take any other courses in Programming, so I'm just wanting to finish this up.. It doesn't matter if it's the most efficient method at all, just needs to work.
Here's my current code, can somebody post the remaining pieces that I need, either the code.. or a description of what I need to do.. I'm getting quite desperate, i'll admit.. so I really appreciate it.
[PHP]import java.util.Scann er;
public class StickGame
{
public static void main (String[]args)
{
Scanner scan = new Scanner(System. in);
{
int Row1 = 1;
int Row2 = 2;
int Row3 = 3;
int Row4 = 4;
int Row5 = 5;
//Initial Board
System.out.prin tln(" 1: | ");
System.out.prin tln(" 2: | |");
System.out.prin tln(" 3: | | |");
System.out.prin tln(" 4: | | | | ");
System.out.prin tln(" 5: | | | | |");
int count = 0;
String Player = ("Player A");
String PlayerA = ("Player A");
String PlayerB = ("Player B");
while (Row1 != 0 && Row2 !=0 && Row3 !=0 && Row4 != 0 && Row5 != 0)
{
//Players choose their move.
System.out.prin tln();
System.out.prin tln(Player+ " please choose a row.");
int x = scan.nextInt();
System.out.prin tln("How many sticks would you like to remove?");
int y = scan.nextInt();
Switch(x);
{
case 1:
Row1 -= y;
break;
case 2:
Row2 -= y;
break;
case 3:
Row3 -= y;
break;
case 4:
Row4 -= y;
break;
case 5:
Row5 -= y;
break;
}
if (count % 2 == 0)
{Player = PlayerB;
}
else
{Player = PlayerA;
}
count++;
}
}
}
}[/PHP]
basically I don't expect to take any other courses in Programming, so I'm just wanting to finish this up.. It doesn't matter if it's the most efficient method at all, just needs to work.
Here's my current code, can somebody post the remaining pieces that I need, either the code.. or a description of what I need to do.. I'm getting quite desperate, i'll admit.. so I really appreciate it.
[PHP]import java.util.Scann er;
public class StickGame
{
public static void main (String[]args)
{
Scanner scan = new Scanner(System. in);
{
int Row1 = 1;
int Row2 = 2;
int Row3 = 3;
int Row4 = 4;
int Row5 = 5;
//Initial Board
System.out.prin tln(" 1: | ");
System.out.prin tln(" 2: | |");
System.out.prin tln(" 3: | | |");
System.out.prin tln(" 4: | | | | ");
System.out.prin tln(" 5: | | | | |");
int count = 0;
String Player = ("Player A");
String PlayerA = ("Player A");
String PlayerB = ("Player B");
while (Row1 != 0 && Row2 !=0 && Row3 !=0 && Row4 != 0 && Row5 != 0)
{
//Players choose their move.
System.out.prin tln();
System.out.prin tln(Player+ " please choose a row.");
int x = scan.nextInt();
System.out.prin tln("How many sticks would you like to remove?");
int y = scan.nextInt();
Switch(x);
{
case 1:
Row1 -= y;
break;
case 2:
Row2 -= y;
break;
case 3:
Row3 -= y;
break;
case 4:
Row4 -= y;
break;
case 5:
Row5 -= y;
break;
}
if (count % 2 == 0)
{Player = PlayerB;
}
else
{Player = PlayerA;
}
count++;
}
}
}
}[/PHP]
Comment