- ID: ***2307      Grade: 10/10
- Good program. All special cases work fine.
- It could be more efficient.
- Lets say that player1 put 'x' at row r and column c. Do you need to check all columns and rows to determine if player1 won or it is enough to check row r and column c only?
- Do you need to check if the board is full after each turn? Assuming that each player occupies one spot in each turn, what is maximum number of turns? Can you count turns instead of checking if the table is full?
- You could have used printf statements to print out a board instead of putting "-" and "|" into an array and then printing array out.
- ID: ***6716      Grade: 10/10
- Good program. All special cases work fine.
- Straight forward checking if a player won which is ok, but now you can think about an improvement.
- There is some redundancy - why do you set "turns = 9;" when checking if player won? After setting turns to 9 you break, which means that turns is not used any more.
- "printf("The game is over. x or o is the winner.\n");" repeats all over. Could you make a single if statement by using && and || and then having single printf statement for each player?
- Do you need to check all three columns and all three rows to verify if player won? Lets say that player 1 puts x at row r and column c. We need to check if we have three x in row r and column c and that's it, we do not need to check other two columns and rows.
- ID: ***4106      Grade: 8/10
- Program is ok to some extent.
- C is so dangerous when it comes to boundary checking - C doesn't actually do any boundary checking with regards to arrays. If you define an array as "char board;" then you are only allowed to access elements with indexes from 0 up to 2. Anything outside of that range causes undefined behavior. In your program you rely on comparing board[r-1][c-1] with ' ' without checking if r and c are in valid range (lines 48-52).
- Checking validity of user input is unnecessary complicated - there is no need to check it twice for each player, everything could be done in a single while loop. For example, if I enter 1 1 as player 1, then again 1 1 as player 2 program skips player 2 and says that its player's 1 turn which is not correct.
- Checking who won is ok.
- ID: ***2491      Grade: 6/10
- Program has a good structure, but it does not have full functionality.
- It is not two player game, only X is printed out. Checking if input for validity is partially correct, you do not check if the spot is already occupied.
- Determining who won is ok, it is nice that you tested that part although the input part of program did not work.
- ID: ***3176      Grade: 2/10
- Long code, but it does not compile. It is always better to submit some code that works (it does not need to have full functionality) than to submit long code that does not even compile.
- It says that some variables (like matrix) are not declared. This is hw number 11, you should be able to detect and fix such errors by now.
- ID: ***4629      Grade: 0/10
- ID: ***9570      Grade: 8/10
- Everything works fine except that you do not determine the winner. You could implement straight forward solution with bunch of if statements. Then you could work on its improvement.
- ID: ***9043      Grade: 4/10
- Program does not work correctly.
- Some interaction with the user is implemented.
- Function for printing the board out works fine.
- Does loop "while(matrix[R-1][C-1]!= '\n'|| ' Y Y Y\n'||' X X X\n')" make sense? Or this if statement "if (matrix[R-1][C-1] == 'Y Y Y'||'Y Y Y\n')"? You still have problems with understanding loops, you need to work much harder on this. If you have any problems with understanding c please stop by my office so that we can resolve it.
- ID: ***4642 Grade: 7/10
- Interaction with the user is ok. Checking who won the game is ok.
- The logic for entire game is off. Why do you have two for loops one within another both reading "for (i = 0; i < 9; i++)". The whole game is incorrect, it is not clear who plays when and how many times.
- ID: ***3451      Grade: 0/10
- ID: ***5688      Grade: 0/10
- ID: ***4006      Grade: 9/10
- Logic is ok, checking who won is also ok. Interaction with the user is fine. However, you didn't check if row and column are less than 1, and if the spot is already taken. If it is then you should print out that input is invalid and user should enter information again. In your program such spots are erased and replaced with new character that user enters.
- ID: ***7738      Grade: 10/10
- Very good program. It is nice that you implemented version where it is possible to play against a computer (although computer is random, so not that smart:).
- ID: ***7888      Grade: 8/10
- Logic is ok, but interaction with a user is not complete. When user enters row and column you do not check if that spot is already taken, so it could happen that X gets replaced with O and vice versa. Also, when user enters invalid numbers you should not count that as a turn, you need to keep asking user to enter new numbers as long as user enters valid ones.
- In your implementation indexes are from 1 to 3, so array should be declared as "char board" not as "char board".
- ID: ***8593      Grade: 2/10
- Some part of the program are ok, but the program does not compile. You should turn in code that at least compiles without errors. Function call at line 47 is incorrect, it has too many parameters (you pass two parameters while the function needs only one parameter). You missed ; at the end of line 60. This is hw 11 you should be able to detect and recover from such errors by now.
- ID: ***2709      Grade: 9/10
- Very good program.
- Most of the code is ok, except that your did not check if the spot was already taken. Your program replaces X with O or the other way around. Instead, it should keep asking user to enter valid row and column that is in between 1 and 3 and that is free.
- ID: ***6249      Grade: 8/10
- Good program. However, you did not check if the input is valid (row and column are in between 1 and 3 and spot is not already taken). Also, when using scanf make sure that you have scanf("%d%d") not scanf("%d,%d"). The later requires , between numbers. If there is no coma you may get segmentation fault error.