Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tic-tac-toe]

A game, also known as "Naughts 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.

5
votes
1answer
81 views

Tic-Tac-Toe with changeable board size

I've created a Tic-Tac-Toe program with python which has a option to change a standard 3x3 board to NxN board. I've also created easy, hard and insane AIs. Please help me in improving the code and ...
3
votes
1answer
167 views

Tic tac toe game in a web browser

I have this tic tac toe game which is very old project of mine, though I made some changes on this to improve the script to perform better. This game is functional, Any logic improvements or other ...
3
votes
1answer
71 views

First Python program: Tic-Tac-Toe (Followup)

I am unsure if I followed the the suggestions on my previous post. I have only been working on programming for about 3 weeks so any more suggestions or insight would be more than welcomed. ...
4
votes
3answers
129 views

First Python program: Tic-Tac-Toe

This is my first program written outside of using books and tutorials. Any help on style and functionality would be helpful. ...
1
vote
1answer
51 views

Tic-Tac-Toe game in Python 3

I have written a code for a tic-tac-toe game and it works well. But, I don't know whether it is an efficient one. Any help on how to optimize it? ...
3
votes
1answer
75 views

Small terminal Tic Tac Toe game

I'm new to Python and I just finished a school assignment where I had to make a tictactoe game with focus on OOP. I would love to get some pointers on how I can clean up my code (especially my ...
2
votes
1answer
59 views

React board game app

I was told to code a board game app using React for a job interview. They told me they chose other candidates to move forward with, so I was wondering on what I could improve. The full code can be ...
2
votes
2answers
70 views
1
vote
1answer
42 views

Function-based Tic-Tac-Toe game in C

This is a tic-tac-toe game that I made in C. It works the way that I want it to but I feel like I could have done it better or shorter. Any input as to how I did would be appreciated. Include ...
3
votes
1answer
88 views

Beginner Tic Tac Toe Game for Python

I am a beginner programmer and would like some feedback on this Tic Tac Toe game I made on Python. Any feedback would be appreciated, as I really want to get better at programming and pick up good ...
2
votes
1answer
64 views

2-player Tic-Tac-Toe game

Below is my Python 3.7 code for a Tic-Tac-Toe game I made as a programming challenge. I want to know if I could make this code less janky, more readable or improve it in any way. ...
3
votes
1answer
98 views

Simple Tic Tac Toe game in C++

I am really new to programming, and I made this simple Tic Tac Toe app in C++. Please tell me what can be improved. ...
2
votes
2answers
75 views

TicTacToe game in C++ made with 2D arrays

We have been learning C++ the previous semester and I made this simple TicTacToe game at the end of it. We haven't yet covered topics of vectors, classes, objects, exception handling etc. so with this ...
1
vote
1answer
59 views

Simple Tic Tac Toe Game in Python3

I am really new to programming, and I made this simple tic tac toe app in python and C++. Please tell me what can be improved Code: ...
3
votes
3answers
111 views

Simple C++ program to check win in TicTacToe

Given a string of size 9 that represents a tic tac toe board, determine if X or O has won, or if the board is in an invalid state. Any other character aside from x, ...
3
votes
2answers
460 views

Simple text-based tic-tac-toe

I am learning C++ and I need help to review my first code and see how I could improve it in any way. Any suggestions are welcome. It was tested and it is free of bug. The code is a game called ...
4
votes
2answers
158 views

Tic Tac Toe program that includes reports

I'm working to use everything I'm learning in my reading and former code reviews to keep making this program better. I'm getting stuck on the following issue: the ...
4
votes
1answer
87 views

A command-line unbeatable Tic-Tac-Toe written in C

I'm trying to learn programming and this Tic-Tac-Toe is one of my first projects. The user gets to start first as 'x' or second as 'o'. Please give me any criticism you find on the code and give ...
2
votes
4answers
171 views

Tic Tac Toe check for win/tie in Python

In the below GameOutcome class I'm checking for wins/ties in Tic Tac Toe. I'm pretty set on breaking the checks into 5 different functions because I'm specifically practicing making functions short ...
2
votes
1answer
114 views

TicTacToe endgame feedback in C#

I'm learning C# and currently having an assignment on Tic Tac Toe. I'd love to have some feedback on where I can improve. I've managed to create the end game functions but I feel it could be improved....
0
votes
1answer
26 views

Noughts and Crosses Version 3

The code's structure has been changed to make the program more readable. I've also commented and split up the program into blocks for better readability as well. The recursion in the player and ...
2
votes
0answers
88 views

Tic-Tac-Toe with React hooks

I have found similar posts which has some optimizations on Winning-checking logic: React Tic Tac Toe My primary focus for this post is about hook setters being ...
3
votes
1answer
50 views

Noughts and Crosses Version 2

Made the game much more user-friendly than previous version - has an example grid to demonstrate input, Xs and Os are now used. Game can now detect draw. Changed the algorithm to detect winner, it'...
1
vote
1answer
35 views

Noughts and Crosses

My first program using C. I would appreciate pointers on how to improve the code. I exit just before turns reach 9 and the grid is filled because it causes all sorts of bugs. The computer is random. <...
3
votes
1answer
88 views

Design of a Tic Tac Toe program in Python

Here is a program I wrote to reproduce the known win proportions for random Tic Tac Toe games (X always moving first). It takes about a minute to play the one million random games that will be played ...
3
votes
1answer
47 views

Reproducing the known results for random tic tac toe play using Python

I'm reading "Code Complete" by McConnel and I'm practicing using object oriented programming to "reduce complexity". (By that McConnel means, among other things, that it should be very easy to read ...
0
votes
0answers
295 views

Tic Tac Toe game in Python 3.X using tkinter GUI version 2

I am completely new to programming and to python and as my first self-learning project I am creating a simple Tic-Tac-Toe game. I have already posted a version of my code here on stack: Tic Tac Toe ...
0
votes
1answer
85 views

JavaScript Tic-Tac-Toe

The first function makes 2 players ...
2
votes
1answer
433 views

Tic Tac Toe game in Python 3.X using tkinter UI

I am learning to program in Python and as my first project I decided to create a simple Tic Tac Toe game. The game is working properly now and I am wondering if there is anything I could do to improve ...
2
votes
0answers
51 views

Repetitive Tic-Tac-Toe AI game with Python 3

I have a text based Tic-Tac-Toe game with a simple AI element that will take winning moves and block losing moves. The one piece of criticism I received was that I was 'hard coding' too much. I can ...
2
votes
0answers
42 views

Object Oriented Tic Tac Toe Python

I've been learning to code in my spare time for a couple of years. I have covered object oriented stuff before and can usually understand other people's object oriented code. This is the first time I'...
2
votes
2answers
158 views

My first Python project Tic Tac Toe v2

Hey guys this is my second attempt at a Tic Tac Toe game using the advice given in my first post: My first Python project: Tic Tac Toe Again, just looking for advice on things I can improve. There is ...
3
votes
1answer
88 views

Beginner TicTacToe

I am trying to learn Python 3.6 with the help of a book. Until now I have learned the basics of functions, conditions and printing etc. No loops yet - so they need to come from recursion. To test ...
4
votes
3answers
182 views

My first Python project: Tic Tac Toe

I just finished coding a Tic Tac Toe game for my first Python project. Everything seems to be running correctly, but I wanted to get some advice on things I can improve. The main loop is pretty messy ...
6
votes
1answer
215 views

Tic Tac Toe Game in C++ using Classes

I made a Tic Tac Toe game using classes to show a better approach than the Tic Tac Toe game in Tic Tac Toe in C++11 which works not with classes. I already posted the code there as an improvement ...
1
vote
2answers
138 views

Tic Tac Toe Java Swing game

I just created a simple game. Now I'm thinking what could be done better here. I want to get some tips how to make the code better/easier or what to add to it. Code: ...
5
votes
2answers
161 views

Tic Tac Toe in C++11

I wrote this to sort of gauge my understanding of the bare basics of C++.Could you guys give me any pointers? (Ha, get it?). I would happy to hear what you have to say about the code. Also is it neat (...
7
votes
5answers
664 views

Tic Tac Toe in C w/ ncurses Revision

Someone in this thread said I could ask for a review of my revision: Ncurses Tic Tac Toe with simplistic AI I re-wrote it from scratch using the suggestions from the answers. In particular I did the ...
4
votes
1answer
90 views

Tic tac toe with unbeatable AI

I wrote this simple command line interface tic tac toe game with unbeatable AI with unittests. Looking for any suggestions how to improve it. Game: ...
14
votes
3answers
1k views

Ncurses Tic Tac Toe with simplistic AI

I have read your rules and in particular the part about bite-sized portions, so I am apprehensive about posting this but want to do it anyway. I have recently begun getting into C and in particular ...
3
votes
2answers
231 views

Beginner's user vs. computer Tic Tac Toe

I made a simply user vs. computer game on Tic Tac Toe. I used Object Oriented Programming to increase my understanding of this programming paradigm. Can you criticize any design flaws I have in my ...
4
votes
1answer
54 views

Battle Noughts vs Crosses in Javascript

This simple game tries to solve the problem of a game that often end in a lock. It does so by providing the players with Xs and Os with superpowers. With great powers come possible disadvantages. For ...
4
votes
2answers
61 views

Simple Python 3 TicTacToe Game

Relatively new here so please let me know if I'm doing something wrong. I'm mostly wondering if there's any additional way I can make this code more efficient. Specifically the moveset and win ...
2
votes
0answers
103 views

Tic Tac Toe in Python 3

Learning to code with python this is what i came up with. But looking at the code i am sure there are ways to improve. I would really appreciate a constructive review and some guidelines. ...
5
votes
2answers
91 views

Tick-tack-toe (Jumping into C++)

The exercise is from Alex Allain's book "Jumping into C++". From Chapter 10 Practical Problem 4: Write a small tic-tac-toe program that allows two players to play tic-tac-toe competitively. ...
1
vote
2answers
160 views

Tic Tac Toe Python

I wrote a simple tic tac toe game in python. (I wrote the game logic and implementation separately) (in this case, it's a command line interface, I may do a Tkinter version) Can you review the code ...
1
vote
1answer
95 views

First Python game of Tic-Tac-Toe

I'm just getting started with Python and was hoping for some feedback on a simple Tic-Tac-Toe game I wrote. Specifically, is there a simpler way to check the win conditions for the game, and to break ...
5
votes
2answers
272 views

Tic Tac Toe with images

This is my first 'real' project in C# , i looked up some tutorials on the Internet for Tic Tac Toe. But they were not how i wanted it to be, so i came up with some own ideas and wanted some tips on ...
1
vote
1answer
278 views

TicTacToe game in C#

I have been studying C#, and I am trying to model the Tic Tac Toe game. Is my program reasonable or is there anything I need to improve? ...
1
vote
1answer
143 views

Tic tac toe game using C++

I wrote this C++ code for Tic-tac-toe for an interview (The basic skeleton was pre-provided) and got rejected because the code was too complex and inefficient. I'm not an expert programmer so I'd like ...