Hello...
I'm trying to write a program in C (using POSIX library) where the parent process should fork up to M processes and play "connect four" or "four-in-a-row" with each-other until one of them wins, and when that happens, the process should terminate. This can be done either via pipes or message queues. The goal of the game is to be the first to place colored piece to make a sequence of 4 pieces in an NxN grid vertically, horizontally, or diagonally.
I'm sure the colors can be represented by simply putting R or B for red or blue, and I'm hoping the grid can be represented in a 2D array...
But I have no idea how to even get started with this problem...fork M processes? I made a mess of my code forking one process a few days back and that was just to write a few random lines of text into a pipe. Any ideas as soon as possible would be highly appreciated. Thanks.