# connect four modified

Page 1 of 1

## 1 Replies - 2259 Views - Last Post: 05 August 2010 - 11:02 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=184763&amp;s=b95e3ceaeaf6fe5ca12e3505e8db241d&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 magnifik

• New D.I.C Head

Reputation: 1
• Posts: 31
• Joined: 28-July 10

# connect four modified

Posted 05 August 2010 - 10:15 PM

i'm trying to write a piece of code for removing a game piece from a connect four board. in this case, all the other pieces would move down to the last row. i used the code from the Connect Four Tutorial on this website and just changed the arithmetic operators to their opposites thinking that would make sense. i'm not sure what else i should change. any suggestions would be appreciated

```int remove(int b, char player){
if(b >=0 && b<= 6)
{
if(place[0][b] == 'R' || place[0][b] == 'B'){ // indicates that a piece is in that position
int i;
for(i = NUM_ROWS;place[i][b] == ' ';i--)
if(i == 5)
{
place[i][b] = player;
return i;
}
i++;
place[i][b] =player;
return i;

}
else{
return -1;
}

}
else{
return -1;
}

}

```

This post has been edited by magnifik: 05 August 2010 - 10:16 PM

Is This A Good Question/Topic? 0

## Replies To: connect four modified

### #2 taylorc8

• B&

Reputation: 150
• Posts: 1,572
• Joined: 21-July 09

## Re: connect four modified

Posted 05 August 2010 - 11:02 PM

So... what have you tried so far? you just copied/pasted and can't fix it?

So... what have you tried so far? you just copied/pasted and can't fix it?