I use fork to fork multiple child processes, but for some reason they print over each other here is an example.
Winning Child (5): 0
Child placed peice at: 6,4
- - - - - - - -
Child placed peice at: 2,6
- - - - - - - -
Child placed peice at: 4,1
- - - - - - - -
Child placed peice at: 6,5
- - - - - - - -
Child placed peice at: 3,1
R - - - - - - -
Child placed peice at: 5,4
R - - - - - - -
Child placed peice at: 5,7
B B B B - R B R
R R B B R R B B
Child placed peice at: 2,2
This should print like this:
Winner Parent
Winning Parent (20): 26181
- - - - - - - -
- - - - - - - -
- - - - - - - -
- - - - - - - -
B - - R - - - -
B - - R B - - -
B - - R B B R R
R R - R R B B B
Is there a way to stop the other processes stop their printing when I print the winning board?