Skip to content

Commit

Permalink
clean comments etc
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertShippey committed Sep 11, 2011
1 parent 4eaf652 commit be5bd6e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
6 changes: 2 additions & 4 deletions connect4/connect4.cpp
Expand Up @@ -20,7 +20,7 @@ int main ()
connect4 game;
game.setup(Gwin);

int yText=30; //30
int yText=30;

//beginning of game loop
for(int x=0;x<25;x++)
Expand All @@ -34,9 +34,7 @@ int main ()
yText+=10;


if(game.won(Gwin)
||
tehAnswer==42)
if(game.won(Gwin) || tehAnswer==42)
{
break;
}
Expand Down
10 changes: 2 additions & 8 deletions connect4/connect4Class.cpp
Expand Up @@ -38,7 +38,6 @@ void connect4::setup(GWindow &Gwin)
player[1].writeName(Gwin);

//Draws the boxes for each 'coin' to sit inside.
//A loop in a loop to allow me to easily draw different rows.
Gwin.setPenColour(BLACK);

int xleft=(Gwin.getWidth()-(gridSize*size)-20);
Expand Down Expand Up @@ -83,8 +82,7 @@ void connect4::setup(GWindow &Gwin)
int connect4::makeSelection(GWindow &Gwin)
{
int column=-1;
//column = Gwin.readInt();
//column--;

int x;
int y;
GMouseEvent c;
Expand All @@ -95,8 +93,7 @@ int connect4::makeSelection(GWindow &Gwin)
y = c.y;
if(c.isLeftDown())
{
if(x>board[0].xLeft && x<board[0].xRight && y>board[0].yTop && y<board[0].yBottom)//store coords in class?
//can work them out in the setup drawing the board loop
if(x>board[0].xLeft && x<board[0].xRight && y>board[0].yTop && y<board[0].yBottom)
{
column = 0;
break;
Expand All @@ -121,9 +118,6 @@ int connect4::makeSelection(GWindow &Gwin)
column = 4;
break;
}

//no else because the user NEEDS to pick a column, if they don't click a column
//then a)they're a moron, and b)it should loop back round until they do.
}
}

Expand Down
1 change: 0 additions & 1 deletion connect4/leaderboardClass.cpp
Expand Up @@ -51,7 +51,6 @@ void leaderboard::writeFile(GWindow &Gwin)
{
std::ofstream writeBoard;
writeBoard.open("scores.txt");
//put the scoreboard out to the file
for(int j=0;j<10;j++)
{
writeBoard << leader[j].name << " " << leader[j].moves << "\n";
Expand Down
2 changes: 1 addition & 1 deletion connect4/personClass.h
Expand Up @@ -7,7 +7,7 @@ class person
public:
std::string name;
GColour myColour;
int moves;
int moves;//unneeded?
bool myGo;
void writeName(GWindow &Gwin);
void fixName();
Expand Down

0 comments on commit be5bd6e

Please sign in to comment.