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.

Filter by
Sorted by
Tagged with
3
votes
1answer
82 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 ...
1
vote
1answer
37 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 ...
2
votes
2answers
77 views

TicTacToe with Python

...
2
votes
2answers
59 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/...
7
votes
1answer
106 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....
8
votes
1answer
109 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, ...
5
votes
1answer
73 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 ...
0
votes
1answer
44 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 ?? ...
5
votes
1answer
107 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() ...
4
votes
1answer
137 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. ...
1
vote
2answers
135 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 ...
2
votes
1answer
113 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 ...
1
vote
2answers
50 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. ...
3
votes
0answers
52 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 ...
3
votes
1answer
125 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. ...
4
votes
0answers
61 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 ...
3
votes
2answers
119 views

Beginner Tic-Tac-Toe in Python

...
4
votes
4answers
317 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: ...
5
votes
1answer
81 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? ...
5
votes
2answers
90 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, ...
4
votes
2answers
111 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 ...
3
votes
1answer
1k 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 ...
4
votes
1answer
72 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 ...
5
votes
1answer
383 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 ...
2
votes
2answers
84 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 ...
13
votes
4answers
3k 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 ...
2
votes
0answers
87 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: ...
2
votes
1answer
52 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. ...
2
votes
1answer
184 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 ...
-2
votes
1answer
229 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? ...
5
votes
3answers
107 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 ...
4
votes
2answers
197 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: ...
3
votes
1answer
93 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 ...
3
votes
2answers
203 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: ...
3
votes
1answer
63 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 ...
3
votes
1answer
81 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....
3
votes
0answers
47 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 ...
3
votes
0answers
79 views

Implementing a tic tac toe board in python

This is my attempt at making a class to represent a game board for tic tac toe. I normally hate while loops but I used one because I cant seem to make the ...
2
votes
1answer
44 views

Determine whether there is a winner in tic-tac-toe game

Below a function which answers: is there a winner in tic-tac-toe game? Also, there is a test suite I wrote for it. ...
6
votes
1answer
152 views

Python3 OOP Tic-Tac-Toe

I'm studying Object-oriented Programming and decided to apply some things doing an Object-oriented Tic-Tac-Toe. I wanted to know if you have some hints of what to improve and why! ...
5
votes
1answer
104 views

TicTacToe classic in C

I'm learning myself C and to make sure that I learn to code C in a proper way I created tic tac toe and want to hear your opinion on what I should do and what I shouldn't do. One thing is sure is to ...
6
votes
1answer
137 views

Minimax implementation of tic tac toe

I have the following working tic tac toe program. Someone said it's a convoluted mess and I'm looking for pointers on how to clean it up. ...
1
vote
0answers
48 views

Tic Tac Toe finish the game function [closed]

currently i am working on javascript. Learning deep etc. So i decided to made my own tic tac toe game 4x4 without any tips. Then i stucked. If anyone can help me will be perfect. Game is playable ...
6
votes
1answer
150 views

Improved first Tic-Tac-Toe + Minimax AI

Posted my first attempt at Tic-Tac-Toe a second ago here. Got a lot of great and helpful responses. The main things I took away from these responses was to use spell check, and to keep things simple. ...
18
votes
7answers
5k views

Tic-Tac-Toe for the terminal

I recently started learning C, and this is my first fairly large (to me) program. It's a basic Tic Tac Toe game for the console. There's no AI, it's just a 2-player game. Is there anything I can ...
4
votes
1answer
44 views

Python program to know who wins a tic-tac-toe game

Given an input where we have two players: "X" and "O", and empty cells marked with a "." like: check_winner([ "X.O", "XX.", "XOO"]) the program outputs if there are three "X" ...
21
votes
5answers
3k views

First Program Tic-Tac-Toe

This is the first little project I've made that didn't feel it was complete gibberish. But I couldn't tell. The biggest problem I had with this was using the ...
2
votes
1answer
57 views

First proper program, Tic Tac Toe

I'm still pretty new to programming, only been doing it a week. I'm just wondering if I made any glaring mistakes or anything that could be improved code wise? ...
6
votes
2answers
371 views

Tic-Tac-Toe code in JavaScript

I have developed a tic-tac-toe game in native JavaScript. Can you tell me how to optimize more and what are the missing things? JSBIN The logic, modular approach, testable and scalable? ...
6
votes
1answer
106 views

Tic Tac Toe console game in C++ (w/graphic)

I have finished a simple Tic Tac Toe game, and I'd like if anyone was to give advice to how I could improve my code. main.cpp ...

1
2 3 4 5
10