New answers tagged

0

regarding the posted code: Running it through the compiler results in: gcc -ggdb3 -Wall -Wextra -Wconversion -pedantic -std=gnu11 -c "untitled2.c" -o "untitled2.o" untitled2.c: In function ‘human_move’: untitled2.c:95:31: warning: conversion from ‘int’ to ‘char’ may change value [-Wconversion] 95 | char_choice = ...


2

I see you've absorbed many things I mentioned in my last review — well done! Coincidentally (or perhaps not, since tic-tac-toe is a common exercise for beginners), I wrote my version of tic-tac-toe last year. I still considered myself a nauplius at that time, but I hope you find certain aspects of my code worth learning from. Notably, there was a lot of ...


2

The first thing I notice is the two separate maps. Since the only actual information you're storing is X / O positions in a 3x3 grid, I think it is good practice to only store those values. Then add any additional formatting when you print. I've also used snake_case for function and variable names, which is the preferred style. The first section could be ...


Top 50 recent answers are included