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
11
votes
1answer
2k views

Simple Tic-Tac-Toe Application in WPF

I made a Tic-Tac-Toe game in WPF and was just hoping for some input as I am pretty new to WPF and I am still a student so I'm sure that my C# code in general may be lacking XAML: ...
1
vote
2answers
11k views

Tic-Tac-Toe game in JavaScript/HTML/CSS

I need help with a question my teacher wants us to do by tomorrow. I would love for you to try to help me out with this. The following functions must be implemented: A function that initializes all ...
8
votes
4answers
790 views

Noughts and Crosses in Python using the pygame module

I've created a Noughts and Crosses game in Python using pygame, and I'm quite pleased with the result that I've produced. I've managed to reduce the code to what it is now, as it used to be much ...
3
votes
1answer
282 views

Tic Tac Toe implemented in WinForms using Model-Viewer-Presenter Pattern

I had to build a 2-player Tic Tac Toe app in C# w/ WinForms for a pre-interview screen. I got past that stage successfully and the app works flawlessly, but I would like to get some feedback. ...
7
votes
1answer
6k views

Simple Tic-Tac-Toe using tkinter

I've been learning programming using a book about Python for a few months. To explore object-oriented programming, I built a few things in tkinter. When I started this code, I wanted to be able to ...
5
votes
2answers
51k views

Simple Tic Tac Toe game

I'm just starting to learn Java and I have written this simple Tic Tac Toe game. Please review it and give me some feedback, advice, guidance etc. Main method: ...
12
votes
3answers
36k views

Tic Tac Toe game in C#

I wanted to get into C#, so I tried making a simple game. My first language was Java, so it was pretty easy to get the hang of C#. I know that there are multiple other posts of Tic Tac Toe games, ...
2
votes
2answers
240 views

Tic-Tac-Toe game requiring two players

I have a working Tic-Tac-Toe game, which requires two players. The game also keeps track of the result of each game and assigns score to each player based on the result of the game. For this, I have ...
11
votes
1answer
2k views

Real time Tic Tac Toe game in Javascript using Socket.IO

This is my first attempt at building a full project. I've recently learned using prototypical inheritance in JS. Please tell me how I can improve the quality of this code. The game is available here:...
6
votes
1answer
1k views

Single player Tic-Tac-Toe game

I have made an attempt to make a single player mode for the Tic-Tac-Toe game. I am not sure if this is the right way to do it and wanted a second opinion. ...
2
votes
2answers
565 views

Tic-Tac-Toe game code

I am new to programming and wrote this code for a Tic-Tac-Toe game. The game works as desired, however, I feel the code can be condensed a bit especially within the functions, ...
5
votes
1answer
2k views

Tic Tac Toe in PyGame

This is my first python/pygame program. Instead of using images I tried drawing with pygame.draw.line() and pygame.draw.arc() ...
1
vote
1answer
7k views

Tic Tac Toe game in Java vs computer

I am trying to create a Tic Tac Toe game in Java using a 2 dimensional array. The computer has to do the smartest move. ...
7
votes
1answer
3k views

Simple Tic-Tac-Toe game in React.js

I'm relatively new to react and attempted to create a simple Tic-Tac-Toe game. Would be great if i could get some feedback on this. Again, at this point using only React (no Redux). main.js - main ...
4
votes
1answer
484 views

Noughts and crosses command line game in Python 3.5

Based on this Code Review answer, I have created a noughts and crosses game in Python, which asks for an index (1 to 9) and updates the grid, and displays it on the screen. I have done some very ...
9
votes
2answers
1k views

TicTacToe in Python3 w/ Simple AI

Here is my version of TicTacToe on python 3.x I'm learning python for a several weeks and I will be very appretiated if you take a look on my script and review it! P.S. I've used NumPad to input ...
6
votes
2answers
227 views

Another Tic Tac Toe In Ruby

I am messing with Ruby a little bit and would like to get some feedback about the Spaghettii below :) ...
3
votes
1answer
402 views

Basic Noughts & Crosses

So I got bored and made a simple noughts and crosses game with colours instead of symbols. The colours are red and blue and I made the GUI in NetBeans with my own code in combination with the ...
5
votes
1answer
725 views

Tic Tac Toe game tree generator minimax

I have coded a working Tic Tac Toe game tree generator. It doesn't only generate the game tree, it also applies minimax values to each node. The code works fine on a board that already has 2 or more ...
22
votes
5answers
12k views

Tic Tac Toe computer AI

I am creating a TicTacToe game for my college project, and when I finished the code for computer AI, I ended up with a big chunk of code. It allows the computer to make the winning move, stopping the ...
2
votes
1answer
303 views

Tic Tac Toe (decoupling patterns and component based design)

I'm learning Unity with C# programming and am trying to learn game design. I know the that the best way to learn games programming is to recreate some existing games, and this is my code to create Tic ...
4
votes
1answer
553 views

Object Oriented TicTacToe

I have been trying to learn to program in a more object oriented manner and I am at the moment working on a Tic Tac Toe game. I have tried to split my classes so that it would make sense, OOP wise. I ...
3
votes
1answer
5k views

Minimax Tic-Tac-Toe implementation

Notes: I know \ are against PEP8; they are for readibility I created this working through a tutorial I forgot to add blank lines, so it may be a little squished ...
3
votes
1answer
550 views

Java - Tic Tac Toe

I am a self - taught coder, and have been learning Java for the last 2 years. I have recently created a tic tac toe game in Java. I have rearranged the program into separate classes & methods. I ...
1
vote
1answer
93 views

TicTacToe in C++ (Gandalf vs Saruman)

I've written a TicTacToe game using classes, just for learning purposes... and I wonder If this code can be improved. main.cpp ...
2
votes
2answers
159 views

Method to check if TicTacToe board has a winner

I have a class called TicTacToeBoard that has a [3][3] array of TicTacToeBoardCells. Doc neck if board has a winner, I check if ...
2
votes
1answer
904 views

Tic Tac Toe in Ruby

I'm a novice programmer going through the Odin Project. I just finished up building a command line Tic Tac Toe game and I would appreciate some feedback on object-oriented design, methods, verbosity, ...
15
votes
5answers
18k views

Tic Tac Toe game in Java OOP

I have written a simple GUI Tic Tac Toe Application and since this is my first shot, I think it can be improved a lot. Please tell me what you think about it and what you see I made wrong so I can ...
4
votes
1answer
263 views

C++ Tic Tac Toe Game

I have reached a mini-capstone where I am asked to create a tic tac toe program. I have successfully created the program. What I'd like feedback on is two things: 1. How do I number my columns like I ...
6
votes
3answers
182 views

Tant Fant Game in Python

Here is our code of Tant Fant Game. Does anyone have suggestions for how to improve our code? ...
4
votes
2answers
569 views

Evaluate a game of tic-tac-toe to determine winner

So the program will take input of a series of 9 integers which indicate which square was played on each move. Player 1 is always X and player 2 is always ...
3
votes
1answer
536 views

Tic-Tac-Toe game with AI

I started learning Racket recently and decide to revisit the problem that introduced me to computer programming: making a Tic-Tac-Toe game with AI. Here's the code: ...
2
votes
2answers
622 views

Another TicTacToe Implementation

There are already many other TicTacToe implementations but most of them are missing some features like if duplicate input is entered exception and immediate termination of the program occurs board is ...
2
votes
1answer
88 views

TicTacToe between Gandalf and Saruman

What can be improved? ...
6
votes
4answers
2k views

Python, JavaScript, PHP, HTML: Unbeatable Tic Tac Toe

At first, I created an unbeatable Tic-Tac-Toe game in Python. However, I wanted a better interface, so I used a PHP backend that runs the script and simple JavaScript that sends user commands to the ...
6
votes
2answers
2k views

Tic Tac Toe in C++14

I've decided to learn C++, coming from Python, and this is my first program. I would love some feedback on it. It's split up into two header files and one .cpp file: Board.h ...
4
votes
3answers
2k views

Tic-Tac-Toe game simulator in Java

I've completed this Tic Tac Toe simulator in java and so far it's working. It's just supposed to generate a pre-played game and announce the winner. I'm required to use a 2D array and this is the way ...
6
votes
1answer
350 views

An unbeatable TicTacToe game

I wrote an answer to another question about the same subject and a new implementation, but instead of just posting my code there I think it's a good chance to see what can be improved on my own code. ...
7
votes
1answer
504 views

An unbeatable Tic-Tac-Toe game using exhaustive enumeration of all cases

I am a beginner programmer and I've been trying to complete an unbeatable tic-tac-toe program, my code is below. The program itself works, but it seems rather inefficient, as I literally have to type ...
4
votes
1answer
947 views

2 Player TicTacToe Game

I am a beginner Java programmer and I have just finished creating a simple 2 player TicTacToe game and would appreciate some feedback/advice on how to make it better. ...
3
votes
1answer
359 views

Tic Tac Toe against Al

I'm working on a project that has an option to playing against Al, so I started to make it in a separate class and just extended the main class which has an object of a GUI class which draws the ...
7
votes
3answers
365 views

Swinging Tic-Tac-Toe

This is just a simple PvP tic tac toe program, I'm learning and just looking for maybe some feedback on how to improve it? There are mainly two things I can see improvement for, the action listener ...
0
votes
2answers
807 views

Java Tic Tac Toe [closed]

This is the TicTacToe.java program that I've coded. How can I make this code more like a production type of code (except for Lack of Comments Part)? Requirements: Design the basic Tic Tac Toe game <...
10
votes
2answers
742 views

Game of Tic-Tac-Toe

Here is a game of tic-tac-toe I created to run in python 2.7. I am still learning and feel 400+ lines of code is a bit lengthy for such a small application. However, trying to get some feedback on how ...
6
votes
1answer
1k views

Player VS player Tic-Tac-Toe game

This program is supposed to be a player VS player Tic-Tac-Toe game. The computer then checks whether you've won, lost, or tied. The code does work, but I don't want it to work through hacking; I want ...
1
vote
3answers
2k views

Very basic Tic-Tac-Toe game

This is working C++ code for Tic-Tac-Toe (even not using arrays): ...
2
votes
0answers
515 views

Tic Tac Toe AI - library based on Minimax algorithm

I recently struggled with implementing AI in Tic Tac Toe game. For better understanding of minimax algorithm I've decided to separate AI's logic. When I finished I thought that some may find it useful,...
5
votes
1answer
300 views

Console-based TicTacToe game

Recently I have been wanting to get better with Python, in particular with Python 3.x features and Python OOP, so I wrote what I thought at first would be pretty simple, a TicTacToe game, which turned ...
3
votes
1answer
535 views

Tic Tac Toe with Python and Kivy

Accomplishment: Tic Tac Toe game with Python & Kivy I have created a simple tic tac toe game with a random bot logic (really random after a user selects a mark). Next step would be to insert the ...