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.

Filter by
Sorted by
Tagged with
2
votes
1answer
94 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 ...
4
votes
3answers
98 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 ...
-2
votes
1answer
110 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? ...
3
votes
2answers
75 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: ...
4
votes
2answers
99 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
61 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 ...
8
votes
1answer
19k views

Tic-Tac-Toe & counter against the player's moves and count scores

Here's a Tic Tac Toe program I wrote in C++. It can play (semi-effectively) against the player. Please give tips on how to improve. ...
3
votes
1answer
46 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 ...
1
vote
2answers
240 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: ...
3
votes
1answer
76 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
36 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
2answers
411 views

Tic-Tac-Toe Player vs Computer

I have created a logical AI for a Tic-Tac-Toe game. I want a review about how good or bad it is. Here the computer AI will defend all your attacks as well as try to attack whenever it gets a chance. <...
3
votes
0answers
47 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 ...
1
vote
1answer
3k views

Tic Tac Toe game - object oriented Java

I've written my first project which is Tic Tac Toe. Everything is working correctly. I'm here to get some advice about my code. I want to be this code as much object oriented as it can be. I divided ...
2
votes
1answer
40 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
121 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! ...
2
votes
2answers
312 views

TicTacToe solver in JavaScript

I come more from a frontend background and have been reading up on more backend approaches and algorithms while solving a TicTacToe grid to see if there are any wins normally, I'd probably use ...
12
votes
2answers
2k views

Ultimate Tic Tac Toe A.K.A. Tic Tactics

My attempt at this challenge., incorporating lessons from this question, which turned out into a much bigger project than I anticipated, but it works. I'll definitely be refactoring most of this in ...
5
votes
1answer
94 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
109 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. ...
6
votes
1answer
104 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. ...
8
votes
3answers
1k views

Tic-Tac-Toe in Python 3

I just got all the bugs fixed and my code is not the best. So, how can I restructure my tic-tac-toe code so that it does not take as many resources while being readable? ...
1
vote
0answers
39 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 ...
17
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
36 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" ...
1
vote
1answer
3k views

Tic Tac Toe (Player vs Computer)

I am looking on how I can improve my writing style and/or how to simplify how I write my code. ...
20
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 ...
6
votes
1answer
538 views

JavaScript/Angular TicTacToe Minimax AI

I am interested in getting some feedback on the code for my TicTacToe game, implemented with AngularJS, particularly with respect to the AI logic, which is printed below. (The full code base is ...
2
votes
1answer
55 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
233 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
88 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 ...
0
votes
0answers
33 views

TicTacToe Board Check

I have written a code in C# that checks whether the user have won the TicTacToe game. I feel that maybe there is a more elegant way to check it, but I couldn't find one. Would like your help. ...
1
vote
0answers
51 views

Tic-Tac-Toe Game in Rust

I recently discovered to joys of rust programming and I have written a tic-tac-toe game. I was hoping for some feedback on how it is made. (The reason split and <...
5
votes
1answer
173 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
211 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
91 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
2answers
3k views

Tic-Tac-Toe command line

I created a simple Tic-Tac-Toe. I'm looking for any critiques from a code standpoint: general structure / style / efficiency. Unfortunately I couldn't get a live demo working because of the ...
4
votes
3answers
179 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. ...
2
votes
1answer
392 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. ...
1
vote
1answer
57 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
86 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
70 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
177 views

MVC Java console tic-tac-toe

...
3
votes
1answer
983 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 ...
4
votes
2answers
2k views

Console Ultimate Tic Tac Toe game

Last week I wrote a C++ program on Ultimate Tic Tac Toe. The issue was that the program was a bit lengthy (~230 lines) and it is needed to be around 150 lines. I absolutely am not asking you to go ...
1
vote
1answer
72 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 ...
2
votes
2answers
80 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 ...
3
votes
3answers
285 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, ...
4
votes
2answers
196 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 ...
3
votes
1answer
240 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. ...