Questions tagged [tic-tac-toe]
A game, also known as "Noughts and Crosses", in which players take turns placing marks on a 3 × 3 grid in an attempt to form a line of three consecutive marks. You can also use this tag for variants of the game.
636
questions
3
votes
3
answers
108
views
How can I better test whether the player won in my tic-tac-toe?
I created a tic-tac-toe using java and I would like to know if there are any practices that I can improve and make the code cleaner and more performative
...
3
votes
2
answers
159
views
Console TicTacToe in C
Would you be so kind as to review my TicTacToe implementation I wrote in C? I wrote this blind (not looking up other implementations). You can find it on Github here.
Any input and/or suggestions ...
10
votes
3
answers
5k
views
Tic-Tac-Toe code using c#
I am a beginner coder and was wondering how to improve my c# console code. It makes a tic-tac-toe game.
...
1
vote
2
answers
152
views
Determining winning line in TicTacToe game
I am trying to write code to determine a win in tic-tac-toe game. In this question, I am not focusing on the whole game, I am only interested in the question of how to determine that the game ended ...
2
votes
2
answers
175
views
Classic games selection
It is an extremely basic mini-game menu. Link to my game.
I know there are more experienced C++ programmers than me, so it would be a great help if you help make my code better.
Thank you.
PS: First ...
3
votes
1
answer
263
views
Tic-tac-toe Game Optimization (C++)
I made a Tic-tac-toe game where you can play against the program or with another player in C++ and I know the code is far too long for what it is.
I've tried to optimize it using non-void functions (...
2
votes
3
answers
507
views
Tic-Tac-Toe game in Java
I had to write a TicTacToe game as an assignment for class & the last program I wrote used a few continues here and there. When I asked for a peer code-review I was informed that I should use ...
2
votes
2
answers
177
views
Java Tic Tac Toe console
everyone!I have created a bit ugly looking Tic Tac Toe console game using Java. I'm learning how to code and I would love to hear some comments about my code. Because it's quite streatforward, I'm not ...
3
votes
3
answers
125
views
tic-tac-toe algorithm improvement in C
I 've made a tic-tac-toe game in C, I want some tips on how to improve it since the program is a little bit too long. (500 lines with comments)
How I done the game:
Mapped a 3x3 Matrix like the board ...
0
votes
2
answers
1k
views
Simplest possible Tic Tac Toe AI in Python
Last week I challenged myself to create the smallest possible code for a Tic Tac Toe game with an AI as opponent. Smallest possible in regards to say least number of characters used. The requirements ...
1
vote
1
answer
107
views
TicTacToe: If an error messages do not appear straight away
I am fairly new to Python and have tried to create a tic tac toe game that is completely automatic, where you can see if a player1 has an advantage if you let it ...
-1
votes
1
answer
56
views
python simple 2 player tic tac toe [closed]
There are 2 issues with my code:
a) If I put numbers in the following order (as my input) '1', '2', '3', '4',
'5', '6', '7' -- this where the game should end, because X (or O) would have
won now (...
5
votes
1
answer
355
views
Tic-Tac-Toe Game vanilla JS/CSS
I am practically brand new to coding and this is my first "real" project I've been attempting. It's an attempt at a vanilla JS game with selectable layout and win conditions (partially ...
4
votes
2
answers
236
views
Console-based TicTacToe game in Python
I created a console-based TicTacToe game in Python. So far, everything works as expected. I decided to keep the class static, because I figured there would be no use for multiple game states at once. ...
5
votes
1
answer
128
views
Tic Tac Toe Shared Keyboard Game
I wrote a Tic-Tac-Toe game for two players, where each player uses the same keyboard. It's not a school project or anything, I just thought this would be fun to code for practice.
I'm open to and ...
4
votes
1
answer
712
views
Noughts & Crosses UML Class Diagram
I was told I need code in order for someone to review my UML Class Diagram for my Noughts and Crosses console application. I would like to know if it's intuitive, whether you could make a program ...
1
vote
0
answers
68
views
Changing player between bot and human in python tic tac toe [closed]
As a noob I'm creating Tic Tac Toe on Python (Jupyter Notebook used). Granted my coding looks almost childish compared to some of the more advanced examples i've seen, but I am still learning the ...
4
votes
1
answer
184
views
Tic Tac Toe using the __init__ constructor
I recently learned about classes in python. I only have a brief understanding of them, but I think it's good enough for me to write a tic tac toe program (been ...
2
votes
1
answer
163
views
Noughts & Crosses (Final Version)
I've made a major update to my Noughts & Crosses program, this ISN'T a duplicate! I know it's not good to use system("pause") and system("cls"), however, I just wanted to make ...
9
votes
3
answers
5k
views
A Tic Tac Toe game in C++
I am a beginner programmer and have made a tic tac toe program in c++. I need some help with my memory management can anyone review and help me. This is my code
...
1
vote
2
answers
212
views
Noughts & Crosses (Tic Tac Toe) OOP Design
I was wondering if someone could review my object oriented design for my Noughts & Crosses program. Yesterday I posted a procedural version and now I've done an OOP version.
Can someone tell me ...
4
votes
1
answer
631
views
Noughts and Crosses (Tic Tac Toe) C++ Console Application
I was hoping someone could review my C++ console based noughts and crosses (Tic Tac Toe) application. I have not looked at any other documentation, this is purely programmed from the top of my head. ...
11
votes
3
answers
2k
views
Tic Tac Toe Game using Python
I'm brand-new (just joined today) to code review and I am super excited to share my tic tac toe game code with all of you! Please let me know what I could fix up in my program to make it more ...
2
votes
2
answers
154
views
Xs and Os game logic in Java [closed]
I am practicing programing in Java. I have started to make a Xs and Os (Tic-Tac-Toe) game and I began with baseline logic of the game. I would appreciate any advice on my programming style, what am I ...
4
votes
1
answer
418
views
Tic Tac Toe game in Python - Beginner
I'm a beginner to python and as part of my course I'm instructed to create a simple tic tac toe game.
I'd be very appreciative and interested of any insight, criticism, instructions, best practices or ...
5
votes
1
answer
69
views
Game of Noughts and Crosses Feedback
this is my 2nd project on Python. I created a game of Noughts and Crosses(Tic-Tac-Toe) that you can play against the computer. What are your thoughts on my implementation of the game? Is there ...
8
votes
1
answer
1k
views
Tic Tac Toe in React (official tutorial)
Hi everyone !
I am new to react and more of a backend developper (working with Django, Symfony, Code Igniter mostly).
But I want to get better at frontend and React seems to have a great community so ...
5
votes
2
answers
4k
views
C++ OOP Tic Tac Toe
This is a follow up to my question here. Well, it ain't exactly a follow-up, but more like my next project after the last one
I created a tic tac toe game using object-oriented programming
You all ...
10
votes
4
answers
2k
views
TicTacToe in Python OOP
I did this Tic-Tac-Toe as an exercise for OOP.
I would like to know possible improvements (the method main loop is too rock and roll, if you have suggestion to reduce it and improve readability).
Code:...
8
votes
2
answers
264
views
JavaScript Tic Tac Toe implementation
I've been trying to get into web development, so I made a quick Tic Tac Toe implementation. It feels messy to me, but I'm not sure what is really considered to be good practice and what not. Any poor ...
1
vote
1
answer
124
views
Python Tic-Tac-Toe [closed]
I made a very primitive Tic-Tac-Toe using Python and I would like a grade on how well I coded the game. What code was there that could've been simpler or more efficient? And any advice you can give me?...
-4
votes
1
answer
107
views
basic two-player tic tac toe game [closed]
Here is my code:
...
7
votes
2
answers
128
views
Managed to make Tic-Tac-Toe as someone who is new to coding
I'm trying to build up a toolset of best practices, so as this is my first complete program (if you can call it that) writen in c++, I know there's definitely better ways of doing things
...
2
votes
1
answer
571
views
Tic-tac-toe game using Pygame
I programmed a tic-tac-toe game using pygame. It's the first game I make. I'd really appreaciate any comments you have about the coding style and any improvements that could be made.
...
6
votes
2
answers
4k
views
TicTacToe with AI in C
I recently started learning C, though I have some experience in other languages. I recently wrote a TicTacToe AI using the Minimax Algorithm in C. I would like to know how I could write better C.
<...
1
vote
1
answer
103
views
A Tic-Tac-Toe AI based on two rules
I made a tic tac toe bot with the following rules (it's not unbeatable):
If bot is about to win, it will find the winning move.
If bot is about to lose, it will find a move that prevents the other ...
7
votes
1
answer
253
views
Text-based tic-tac-toe game in Python
I'm working on a text-based tic-tac-toe game, mostly for fun and because I'm learning programming. I would appreciate any comments you could give me to improve it.
Main structure:
It uses a ...
4
votes
2
answers
184
views
Tic Tac Toe, No OOP
I was looking at a code review of a Tic Tac Toe game in Python when I recalled a talk about not using classes, and I wanted to see if I could write a readable, working implementation of the game ...
9
votes
4
answers
3k
views
Python text-based Tic Tac Toe
I created a simple text-based Tic Tac Toe game in Python using OOP. Currently the computer moves are completely random - I plan to add some sort of algorithm later (no idea how to do that yet though)
...
0
votes
1
answer
59
views
Tic Tac Toe in Python practice 2
The previous code on codereview
I'm quite novice here so apologies for any silly mistake in advance
I've been writing a simple tic tac toe game which is a part of my course in udemy
Since this is my ...
1
vote
1
answer
95
views
Tic Tac Toe in Python practice
I'm quite novice here so apologies for any silly mistake in advance
I've been writing a simple tic tac toe game which is a part of my course in udemy
Since this is my first project, I want to do my ...
7
votes
1
answer
676
views
Improved Tic Tac Toe game. Made in C
For my second week of learning C, I decided to remake the Tic Tac Toe game I made last week, but in a different style (as some of you recommended me). This is my final product on the whole Tic Tac Toe ...
11
votes
5
answers
3k
views
Simple Tic Tac Toe game inside terminal
Hello fellow programmers. I started learning C last week and today I wanted to see if I can make a working program, so I made this game:
...
3
votes
1
answer
136
views
Tic-Tac-Toe in C
I have implemented a Tic-Tac-Toe game in C which can be played as two-player or with a computer player.
...
12
votes
1
answer
2k
views
I made Tic Tac Toe in C
I made this Tic Tac Toe game in C. It works but I thinks it could be programmed better. You have the option to play alone or between two players. It also lets the player select if he uses 'X' or 'O'.
...
3
votes
2
answers
323
views
Tic-Tac-Toe in Java
I am currently learning Java; I could really use some help from more experienced programmers.
How can I clean up my Tic-Tac-Toe code? What mistakes have I made? Can I use more exception handling? I ...
1
vote
1
answer
55
views
Given a Tic-Tac-Toe gamestate return all wins as text
In a game of Tic-TacToe given a gamestate:
game_board = [ [1, 0, 1],
[0, 1, 0],
[0, 1, 0] ]
I have written the following piece of ...
2
votes
1
answer
83
views
OOP Based TicTacToe - Logic Improvement/Best Practices
Looking for any feedback to improve practices on the following logic, and I have removed large chunks of documentation to reduce noise. I feel the areas that could expect heavy criticism are the win/...
4
votes
1
answer
301
views
Minimax based Tic Tac Toe
I am attempting to make an unbeatable Tic Tac Toe game using a simplified minimax algorithm. The code looks like this:
...
9
votes
1
answer
914
views
A simple tic tac toe game in Javascript/HTML/CSS
This is my first web app written in JS. I would like to know how the code can be improved in terms of style and structure, especially in terms of following JS's conventions and general heuristics. I ...