Skip to content

Commit

Permalink
Fix game command
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanbir Banipal committed Jul 26, 2022
1 parent 3507ae2 commit dfcb44e
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Empty file added design.pdf
Empty file.
6 changes: 3 additions & 3 deletions game.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void Game::play(){
int diff;
int setup = 0;
while(cin>>command){
if(command == "game" && !started){
if(started == false && command == "game"){
if(setup == 0){
std::stringstream defaultinput;
defaultinput << "+ r a8 + n b8 + b c8 + q d8 + k e8 + b f8 + n g8 + r h8 ";
Expand Down Expand Up @@ -81,7 +81,7 @@ void Game::play(){
started = true;
cout<<*b<<endl;
}
if(started){
else if(started){
if(command == "move"){
if(!side && player1->getPlayerType() == PlayerType::computer){
cout<<"White computer is making a move"<<endl;
Expand Down Expand Up @@ -161,4 +161,4 @@ Game::~Game(){
delete b;
delete player1;
delete player2;
}
}
4 changes: 2 additions & 2 deletions main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#include "game.h"
#include "sdl_wrap.h"

//SDL_Runner r;
SDL_Runner r;

int main(){
std::srand(std::time(0));
Game game{};
game.play();
return 0;
}
}
2 changes: 1 addition & 1 deletion moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ class Move{
~Move(){};
};

#endif
#endif
2 changes: 1 addition & 1 deletion player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ bool Player::checkStale(Board* b, bool side){
}
}
return true;
}
}
2 changes: 1 addition & 1 deletion tc3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ move b2 b3
move e7 e6
move b3 b4
move f8 c5
game human human
game human human
2 changes: 1 addition & 1 deletion textdisplay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::ostream &operator<<(std::ostream& out, const TextDisplay& ptd){
out << std::endl;
out << " abcdefgh" << std::endl;
return out;
}
}
2 changes: 1 addition & 1 deletion types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ locationx charToX(char src){
break;
}
return ret;
}
}

0 comments on commit dfcb44e

Please sign in to comment.