Skip to main content
The 2024 Developer Survey results are live! See the results

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.

5 votes
1 answer
201 views

Almost unbeatable Tic Tac Toe

JavaScript beginner here! I have written a Tic Tac Toe game is JS that seems to be unbeatable (Title says 'almost' because I'm not sure if it's really unbeatable or just I can't beat it :) ). I ...
user3756068's user avatar
3 votes
1 answer
123 views

Tic-Tac-Toe implementation c++

I created this game just to practice my skills. I've been coding for a few years and I'm decent at data structures and algorithms. I want to know how to improve my implementation. ...
Ibrahima Barry's user avatar
3 votes
2 answers
455 views

Checking if naughts or crosses win in Tic Tac Toe

I am working on a coding challenge for Tic Tac Toe. I am calculating the results and inserting them into the database. However I have a long and messy if statement, which checks if the array's values ...
Lowtiercoder's user avatar
3 votes
0 answers
287 views

Noughts and Crosses Terminal Game with AI

I created a game which can play tic-tac-toe with: 0 players (AI vs AI), 1 player (human vs AI) or 2 player (human vs human). Here is the AI function which wraps around my innermost function. This ...
RelativelyUnique's user avatar
2 votes
1 answer
485 views

C# Tic Tac Toe Game with SOLID

i'm doing a Core for a Tic Tac Toe game. I have my code with a dynamic size of the board (can be 2x2 to 10x10, if is 7x7 we need a 7 characters in a row to win , if is 4x4 we need 4 etc) , This code ...
Juan Andres Castillo Soria's user avatar
1 vote
1 answer
157 views

2 player CLI Tic-Tac-Toe game in python

This is a fully functional code that i have just completed today. I just want to know how efficient is this. and how could i improve it or if theres any bugs that i have miss out. ...
ShreddedPumpkin's user avatar
5 votes
2 answers
156 views

CLI Tic-Tac-Toe in python

Is there any way I could make my Tic-Tac-Toe board more aesthetically pleasing? Is there anything else I can improve besides the look of the board? ...
ShreddedPumpkin's user avatar
1 vote
0 answers
76 views

Tic Tac Toe game logic

I've implemented tic-tac-toe in TypeScript before; now I'm porting it to Elixir. As before, this is pure game logic, no UI involved. I'm very new to Elixir, so any suggestions are appreciated. The ...
DylanSp's user avatar
  • 203
1 vote
1 answer
100 views

Total beginner Tic Tac Toe game in Python

I've decided to learn Python about 2 weeks ago, been going through various books and videos, and I've decided to try my hand at programming a Tic Tac Toe game. I was somewhat successful (it doesn't ...
Flip Marlo's user avatar
8 votes
2 answers
368 views

Rust Novice's Tic Tac Toe

Introduction I am a Rust novice. So far, I have finished reading the first 15 chapters of The Rust Programming Language (a.k.a. the book). Here's my first big Rust project — Tic Tac Toe. ...
L. F.'s user avatar
  • 9,570
3 votes
1 answer
2k views

Tic Tac Toe with ASCII art

I have written a simple Tic Tac Toe game using some ASCII art. Is there anything I can do to improve upon the logic and structure of the program? ...
WireInTheGhost's user avatar
5 votes
1 answer
406 views

TicTacToe implementation in Java

Right now I'm studying Java, and as a part of understanding arrays, I've implemented a Tic-Tac-Toe game based on two-dimensional array. Any suggestions/comments are much appreciated! Source code ...
Denis Burtsev's user avatar
3 votes
0 answers
83 views

Simple Tic-Tac-Toe game in Javascript (NO A.I.)

After some hours of coding trying to implement "algorithms" to make a Tic-Tac-Toe game, I came up with something I'm not really proud of. Here's the code: ...
kibe's user avatar
  • 277
3 votes
1 answer
112 views

Tic Tac Toe in C++ (console version)

I have made a 2 player Tic Tac Toe game in C++. I have put in some error checking also (like if the players enters an invalid position). The code is working absolutely fine. This is what my program ...
theshubhagrwl's user avatar
1 vote
1 answer
638 views

JavaScript Tic Tac Toe Win Checker is Wet

New to coding/Javascript. Writing a basic Tic Tac Toe game. I'm writing the game to be dynamic, so it won't always be a three-by-three grid, but rather any size grid larger than 1. I have a ...
Sun Bak's user avatar
  • 11
2 votes
2 answers
115 views

TicTacToe with Python

...
Lathem01's user avatar
2 votes
2 answers
235 views

Javascript Tic Tac Toe

I've created a Tic Tac Toe game in JS/HTML/CSS. Is there anyway this can be improved? Thanks Codepen: https://codepen.io/KhushrajRathod/pen/wvaeOaZ Github: https://github.com/KhushrajRathod/...
user avatar
7 votes
1 answer
635 views

Pyqt Tic Tac Toe

Recently discovered PyQt5 and decided to make this as a 'hello world' for GUIs Would like input on the design, best practices, as well as idiomatic nature of the application and its structure. Game....
Legato's user avatar
  • 9,829
9 votes
1 answer
431 views

A Python based Tic-Tac-Toe game

As a basic project, I've programmed the game of noughts and crosses (tic-tac-toe) using classes. I made three classes: Board, ...
Lewis T.'s user avatar
  • 149
5 votes
1 answer
107 views

Yet Another Command Line Noughts and Crosses

It's been a while since I last looked at C++ so before resuming one of my old projects I thought I'd brush up on the basics so I've written a basic noughts and crosses game (because it's just getting ...
Nick is tired's user avatar
0 votes
1 answer
51 views

Tic-Tac-Toe game suggestion

I am a beginner so please keep it in mind while answering! For player vs CPU is there any more effective way to make CPU better ?? ...
Utkarsh Sharma's user avatar
5 votes
1 answer
128 views

TicTacToe Python

Can you provide some advice on how I can simplify this code? I am a beginner with Python, and I'm pretty sure that my code can be much simpler. I think the check() ...
MrLok3rs's user avatar
4 votes
1 answer
539 views

Beginner python tic tac toe with AI

I've come up with this code for a tic tac toe game with and AI that the player can go against, please help me optimise my code and help me grow better habits haha. ...
Tlomoloko's user avatar
  • 637
1 vote
2 answers
347 views

A simple AI for Tic-Tac-Toe game

This is an AI class that takes an array of the board as an argument, and plays the best move after evaluating the board and gets a win rate. I haven't used any java package to do this. How can I make ...
Anmol Agrawal's user avatar
2 votes
1 answer
5k views

Tic-Tac-Toe in Java with GUI

I've wrote a little program to play Tic-Tac-Toe: public class Control { public static void main(String args[]) { Gui gui = new Gui(); } } The ...
user avatar
0 votes
2 answers
154 views

Noughts and Crosses Game Feedback

Hi i have created a game of noughts and crosses in c++ I am new to this so the code is a bit messy, but i would love to get any feedback from you lot about the actual game and not the code for now. ...
clifj95's user avatar
  • 11
3 votes
0 answers
79 views

First Attempt at Object-Oriented Programming: Tic-Tac-Toe

Began learning python about 3 months ago and this was my first OOP. I was hoping to get constructive feedback! My own thoughts after writing it were that there had to be a better way to: 1) generate ...
Jacob Garwin's user avatar
3 votes
1 answer
244 views

Simulate Tic Tac Toe game using C language

I made a Tic Tac Toe game using C. Here two players, player1 and player2, can participate and play. Please rate my code and suggest improvements. ...
Avijit Mandal's user avatar
4 votes
0 answers
153 views

Tic Tac Toe with different level AI

I've already created a code in python here with almost the same logic: Tic-Tac-Toe with changeable board size (Part 1) Tic-Tac-Toe with changeable board size (Part 2) Here's the code in C++. As I'm ...
Sriv's user avatar
  • 2,750
3 votes
2 answers
530 views

Beginner Tic-Tac-Toe in Python

...
notak's user avatar
  • 605
4 votes
4 answers
781 views

Tic Tac Toe Game in Python 3

I made this as a personal challenge. It seems to work fine as I can't find any bugs and am happy with how it runs, but I am interested in what I should do to make the code more professional. Note: ...
Brijesh Kalkani's user avatar
5 votes
1 answer
103 views

Tic Tac Toe code could probably be optimized more

I recently got some help from Stack Overflow on my Tic-Tac-Toe code for the win conditions, but I think it could be optimized a little more. Any tips? ...
James's user avatar
  • 161
5 votes
2 answers
112 views

Back to Basics: Tic Tac Toe - follow-up

Follow-up from: Back to Basics - Tic Tac Toe Again, any optimizations and critique is welcome! I'm particularly interested if it involves numpy, ...
T145's user avatar
  • 3,099
4 votes
2 answers
171 views

Tic-Tac-Toe in Python3

I am new to Python and would like to get helpful tips and suggestions on this code. Would be awesome if you provide info if anything is fundamentally incorrect, improve the algorithm, and any room for ...
Ryan's user avatar
  • 43
5 votes
1 answer
5k views

Minimax algorithm for tic tac toe in Python

I am using minimax algorithm (for now without alpha beta pruning) for AI in tic tac toe game in Python and Numpy. It's working, but very slow, so I would like to optimize it. A few rules for current ...
Michal's user avatar
  • 203
4 votes
1 answer
93 views

Back to Basics - Tic Tac Toe

I've seen a few TTT related posts recently, and thought I might learn something or be reminded of certain techniques from attempting my own rendition. Here is that attempt! Hopefully any new coders ...
T145's user avatar
  • 3,099
5 votes
1 answer
521 views

Tic tac toe game for the console

You can set any size of the field, you can set how much you need to put in a row to win. I think I got a pretty flexible program. What do you think about the code? I would like to know if I made ...
Miron's user avatar
  • 418
2 votes
2 answers
109 views

Tic Tac Toe in C - Version 1

This was the first game I made not too long ago (2018), and while I'm working on another, more complex version, I want to know how good or bad I did this one and what can be improved. Note: the ...
AlexaN's user avatar
  • 39
14 votes
4 answers
4k views

Tic Tac Toe console program

I have been learning C++ for 3 months now. I decided to make something by myself, so I've made this little integer-based TIC TAC TOE console game. I need some advice on how to improve my code for ...
deep mondal's user avatar
2 votes
0 answers
283 views

Simple Tictactoe game in Typescript

I'm mostly wondering if I can simplify the code. I've been told that it's needlessly complicated. HTML: ...
Matthew Holliday's user avatar
2 votes
1 answer
74 views

Beginner tic-tac-toe implementation

I finally made tic tac toe as a beginner(took a month and a bit) and I want to know if I made things more complicated than they should. It seems like a lot of code for a simple game but I'm not sure. ...
OneDarkGamer's user avatar
3 votes
1 answer
716 views

Simulate Tic-Tac-Toe game in Python

Simulate a tic-tac-toe game Requirements A player is picked at random as a first player. The two players plays tic tac toe game. The game ends when the board is full or either one of the player ...
Akanksha's user avatar
  • 129
-2 votes
1 answer
475 views

Simple Python tic tac toe [closed]

I'm a beginner in python so I decided to take a simple challenge and wrote tictactoe How to write it better in future? What's wrong with my code? ...
HelloBT's user avatar
  • 79
5 votes
3 answers
166 views

TicTacToe in Javascript

I made this two player TicTacToe game as a challenge i was given in class. The game starts where the first player chooses where their X will be placed. Each area in the array has been given a number ...
NixonFixon's user avatar
4 votes
2 answers
390 views

"Tic Tac Toe" game in Python

I'm relatively new to Python. Here is a Tic Tac Toe game I've created in Python: ...
Omri Shneor's user avatar
3 votes
1 answer
691 views

Class diagram of Tic-Tac-Toe Game

I wrote a basic tic toe game. See, https://jsfiddle.net/shai1436/Lgy1u84s/4/ I am not satisfied with the way I have designed classes and how I have implemented the undo feature. Please suggest ...
Shahrukh Haider's user avatar
3 votes
2 answers
916 views

Tic-Tac-Toe code using Python with Tkinter

`I made this Tic-Tac-Toe game first, by using user input in the console here: https://pastebin.com/6zLjrWcf , and now new and improved using Tkinter: ...
Manusman's user avatar
3 votes
1 answer
166 views

Simplified board for X's and O's using Tkinter

Recently I am learning to program in Python and in order to practice I tried to program a little game which consists in a board with 9 cells. In this board each player draw an 'X' or 'O' with left or ...
EvaMGG's user avatar
  • 133
3 votes
1 answer
170 views

Pre-calculate the winning combinations for an n-sized tic tac toe board using C++ functional programming

This code pre-calculates the winning combinations for an n-sized tic tac toe board. I first created my function using an imperative approach. This is just how I naturally write code most of the time....
Demolishun's user avatar
5 votes
1 answer
118 views

How can I make my Pygame Tic Tac Toe game better?

I have this code ready and it works just fine. But what are the ways by which I can improve this code? I have no CS background and this is my first coding project. I could not paste my entire code so ...
Rahul Niranjan's user avatar

15 30 50 per page
1 2 3
4
5
13