Hello! I am coding a tic tac toe game in which the computer generates a random number and makes a move accordingly. The random numbers are being generated well the only problem is that sometimes when i execute the program it goes haywire! It ignores all the if condition i have specified. But it works just fine 80% of the times.. PLEASE CAN ANYONE HELP ME OUT. The following is the code for the functions of class Match that i made.
I didn't look through your code completely, but a few things stood out for me.
#1: Line 6... is that really the equals operator you meant to use there?
#2: You can convert between a one-digit integer and its ASCII character equivalent just by subtracting '0' from it. That might help shorten your code. ;)
#3: srand() is best called only once @ line 56. Maybe call it from main()?