Merge branch 'master' of https://github.tamu.edu/brj2013/Breakthrough
This commit is contained in:
commit
b52988233c
4 changed files with 21 additions and 15 deletions
12
Client.java
12
Client.java
|
@ -272,6 +272,18 @@ public class Client {
|
|||
userInput = stdIn.readLine();
|
||||
output.println(userInput);
|
||||
|
||||
String diff = "?";
|
||||
in.read(b, 0, 256);
|
||||
temp = String.valueOf(b).trim();
|
||||
System.out.print(temp);
|
||||
while(!diff.equals("EASY") && !diff.equals("MEDIUM") && !diff.equals("HARD")) {
|
||||
diff = stdIn.readLine();
|
||||
if(!diff.equals("EASY") && !diff.equals("MEDIUM") && !diff.equals("HARD")) {
|
||||
System.out.print(diff + "\nInvalid difficulty.\n" + temp);
|
||||
}
|
||||
}
|
||||
output.println(userInput);
|
||||
|
||||
while(!end) {
|
||||
char[] buffer = new char[256];
|
||||
in.read(buffer, 0, 256);
|
||||
|
|
BIN
Resources/black_circle.png
Executable file
BIN
Resources/black_circle.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
BIN
Resources/white_circle.png
Executable file
BIN
Resources/white_circle.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
24
Server.cpp
24
Server.cpp
|
@ -118,18 +118,15 @@ int main(int argc, char *argv[])
|
|||
cout << "OK" << endl;
|
||||
bzero(info,256); //Resets info back to normal
|
||||
|
||||
/*//Becca- once your AI code is working, use this code:
|
||||
|
||||
string difficulty_select = "Choose Difficulty\n1. Easy\n2. Medium\n4. Hard\nEnter choice: \n";
|
||||
string difficulty_select = "Choose Difficulty\n1. Easy\n2. Medium\n3. Hard\nEnter choice: \n";
|
||||
write(newsockfd, difficulty_select.c_str(), difficulty_select.length());
|
||||
n = read(newsockfd,info,255);
|
||||
istringstream convert(info);
|
||||
convert >> choice_difficulty;
|
||||
istringstream con(info);
|
||||
string choice_difficulty = "EASY";
|
||||
con >> choice_difficulty;
|
||||
cout << "OK" << endl;
|
||||
bzero(info,256);
|
||||
|
||||
*/
|
||||
|
||||
while(true) {
|
||||
|
||||
while(gameOver != true)
|
||||
|
@ -162,15 +159,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
while(e.getBoard()->getTurn() == 'X' )
|
||||
{
|
||||
e.easyAI();
|
||||
/*Becca- once you finish your AI, uncomment this out and remove the line directly above this
|
||||
if(choice_difficulty == 1)
|
||||
easyAI();
|
||||
else if(choice_difficulty == 2)
|
||||
mediumAI();
|
||||
if(choice_difficulty == "EASY")
|
||||
e.AI(3);
|
||||
else if(choice_difficulty == "MEDIUM")
|
||||
e.AI(5);
|
||||
else
|
||||
hardAI();
|
||||
*/
|
||||
e.AI(7);
|
||||
}
|
||||
|
||||
gameOver = e.getBoard()->isGameOver();
|
||||
|
|
Reference in a new issue