Hello, I am trying to write a program that resembles the Connect 4 game. One problem I'm having is finding the proper way to print the game pieces(x and o) into a pointer to pointer array. It prints an = looking sign for each point in the array, but that doesn't seem to be what it actually is. When I enter a column number into drop it places an 'o' into the entire column. I need help figuring out how to replace each point in the array as well as how to stack them. Any help would be great.
Your logic for checking where to place the dropped piece is wrong. it is currently "if there is neither an x or an o in the space, put an o there". It's probably best if you count backwards (since pieces obey gravity) and your if condition should just check for an empty space. Also, use break to leave the loop after you change the appropriate slot.