C++ Tutorial : Connect 4

    Ahhh, another day and another tutorial. As usual, I'm kind of  too lazy to do much explaining, so I'll just give you a quick run down of what you need to get your connect 4 game running.

1

2   

3 4

5

6    7

 8

9

10 11

12

13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35

36

37 38 39

40

41 42

Winning Combinations

If we were to drop our piece on 18, how can we determine if we have a winning combination?
  First we will make a counter starting at 1 because we already have 1/4 of the combos
  If we can add up 4 in any direction, then we win
  For example, if 18+19+20+21 = 4 combos then we win
  Lets make us 'X' and the computer 'O'

If 18 = X, 19 = X, 20 = X, 21 = X, then you win. Counter = 1+1+1+1
  Suppose 21 = 0, in which case counter = 3, therefore we have to check the opposite direction to see if 17 = X

Please note, on an array 18 is actually [3][2] and 19 is [4][2]...etc

     By the way, this game doesn't have any Computer opponent so just play with a friend. If you like to add a Computer player, you can simply make the computer choose a random number for its move. Anyways, that's all for this tutorial ^_^; 

Source Code