Skip to content
← Back to Community
Noughts and Crosses vs AI
Profile icon
henryeth

My Second Project

This is my second Python project - a step up from the previous Rock Paper Scissors in the classic games category. This time I have simplified it to minimal(-ish) lines of code and the game works flawlessly (I think). The AI is quite basic, but it is good enough for noughts and crosses.

Voters
Profile icon
Sam45165
Profile icon
CircuitSacul
Profile icon
henryeth
Comments
hotnewtop
Profile icon
CharlesGraham1

How do I play it? I've just signed up to this site

Profile icon
CircuitSacul

I think that the design could be improved (the way it displays the board). The O's look a lot like 0's (Zeros). Maybe you could have underscores for empty spaces, then the user chooses the Column and row to place there char. It would also be cool if you could choose to be first or second (but that might be problematic for your AI). You can see how I did it here

Profile icon
henryeth

@LD1 Your version is genuinely impossible to beat.

Profile icon
CircuitSacul

I beat it - On my first try -- Nice job though! I never though tictactoe could be code in 32 lines

Profile icon
henryeth

@LD1 It is very easy to beat - I could make it impossible to beat but I didn't want to.

Profile icon
henryeth

@henryeth First try though is good