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
8
votes
1answer
4k views

Python Tic Tac Toe

I'm learning Python at the moment. While taking the first steps, I implemented a Tic Tac Toe game and wanted to share it here, to get some feedback and continue learning. I'm looking for any ...
2
votes
1answer
440 views

Tic Tac Toe in Android

I made my first Tic Tac Toe game on Android and I'm looking for a way to simplify, make the code more flexible and remove the hardcoded code. I managed to do this game by looking at different ...
2
votes
0answers
968 views

Python Tic Tac Toe Gui and AI

So, I've tried to write a gui for Tic Tac Toe or noughts and crosses, as well as an AI opponent to play against. This is by far the longest program I've written, having mainly just done bash scripts ...
5
votes
2answers
7k views

Tic Tac Toe in Swing

This is a Tic Tac Toe game I wrote in Java (Swing). It fully works when detecting the winner or a tie. I'm wondering if there's any way I can improve it or clean it up. I'm trying to achieve a 3 by ...
8
votes
4answers
695 views

First Console Game: Tic-Tac-Toe

I have just finished my first true console game using C++. I would love if I could get some feedback on my program, I have a few specific comments in my code that I have questions on and will list a ...
7
votes
1answer
2k views

Tic Tac Toe in Python (Jupyter)

I am working on Jupyter Notebook and I am new to Python. I have created this tic tac toe game. ...
7
votes
2answers
425 views

Tic Tac Toe implemented With jQuery table pseudo-buttons

I made this code myself and was experimenting with making buttons from a table, and decided to make a game of Tic-Tac-Toe with it. The code loads from JSON a grid, and then makes a Tic-Tac-Toe game ...
1
vote
1answer
473 views

C# Events in a Tic Tac Toe game

I am new to coding and am trying to understand events what is an annoying stage but super important I guess. I just made a Tic Tac Toe game and it is working but not really "beautiful" coded. I really ...
2
votes
1answer
1k views

Determine if someone has won a game of Tic-Tac-Toe on a board of any size

I was asked this question in interview yesterday: Write the code for winning condition in an NxN matrix for tick tack toe.For example A function named "input_event(player_info, x_position, ...
4
votes
2answers
213 views

TicTacToe Logic

I've started to write a small Tic-Tac-Toe game. I am pretty sure everyone knows how this game works so I don't have to explain that part. I've decided to represent the grid using 2 bitsets which ...
6
votes
1answer
106 views

TicTacToe game | Starting with python after learning JS

I've been coding since about one year in JS now, and started with Python this week. I've created this TicTacToe game to get familiar with Python and would like to know what you think about this code, ...
4
votes
1answer
1k views

Simple Tic-Tac-Toe Game in python3

Thank you for reviewing my code. I know C++ and I am learning python. As a beginner project I wrote a simple tic-tac-toe game using python3. It would be helpful if you could: Tell whether there is ...
-2
votes
2answers
524 views
2
votes
0answers
1k views

TicTacToe in Python with MiniMax/AlphaBeta

I know barely anything about Python, I just jumped into this project as I've already coded it in different languages and it's my go-to when figuring things out in a new one, any feedback will be ...
3
votes
0answers
474 views

React Tic Tac Toe

This is a project that grew out of the React Tutorial and is one of my first efforts at solving React problems on my own. There is a lot of code here and I am sure that there are more concise ways ...
5
votes
1answer
1k views

TicTacToe with MiniMax algorithm

I just got into C++ a few days ago and decided to make a MiniMax based TicTacToe game, I don't really know much about the conventions and best uses of the C++ language so I'd really appreciate any ...
2
votes
2answers
347 views

Tic-tac-toe with many enumerated computer moves

This code is able to create a tic tac toe game, user vs a computer. For every move the user makes in a check board 3⨉3 abc⨉123. The functions setup the instance of the game along with creating the ...
7
votes
1answer
310 views

TicTacToe (again!), but with difficulty levels, undo, and hints

I'm learning Python after a 30+ year break from programming, got bored with the usual TicTacToe exercise, so went a bit wild adding functionality to it to make something that's a bit more fun to play ...
3
votes
2answers
494 views

Noughts and Crosses winner declaration in a game of variable square board size

I have made a tic tac toe for two players and written down some functions to do the decision making about who is the winner. I have gone through some cases while testing but need advice to see if I am ...
5
votes
1answer
915 views

Design Tic tac toe game

Today I had an interview, where I was asked to solve this question: Design Tic tac toe game Game rules: Design a simple tic tac game with 2 modes for 3*3 matrix. At the beginning, ask if single ...
6
votes
1answer
276 views

TicTacToe in MVP Winforms

I took the source code from this question, (thank you gaessaki for the motivation!) and did a lot of refactoring. I use 4 projects: Common: contains mainly interfaces and enumerations referenced by ...
3
votes
1answer
1k views

Tic Tac Toe in Python, converted to use classes

I am new to using Classes and Objects, and as such thought i would edit a previous Tic Tac Toe game i created, this time using Classes. I found it easier using entirely public (Class?) variables (ie, ...
2
votes
2answers
617 views

Tic Tac toe in React

I wrote this tic tac toe game in react. I am learning react now. Feedback is welcome. I deliberately used single file, to focus on React and not other aspects. ...
3
votes
1answer
359 views

Evaluation function for minimax/alphabeta algorithm for Tic Tac Toe AI

I am trying to develop an optimal evaluation function to use in minimax/alpha-beta algorithm for developing tic-tac-toe AI. I am counting number of circles/crosses in a row/column/diagonal with ...
8
votes
4answers
814 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 ...
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: ...
8
votes
1answer
693 views
7
votes
1answer
7k 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 ...
2
votes
1answer
339 views

Tic-Tac-Toe class and methods

I'm trying to learn python and am still a bit foggy on classes. Am i using them right in this tic-tac-toe game? Everything function like i want it too but not sure if i am really getting how to use ...
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:...
2
votes
2answers
244 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 ...
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
587 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
490 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 ...
3
votes
1answer
425 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
743 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 ...
6
votes
2answers
228 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 :) ...
2
votes
1answer
215 views

Python tic-tac-toe game - procedural programming only

I made a tic-tac-toe game that is a player vs. player version (no AI). I have tried not to utilize objects because I haven't really gotten there yet. A previous version (see here) utilized global ...
3
votes
1answer
285 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. ...
4
votes
1answer
573 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
573 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 ...
3
votes
0answers
683 views

Python TicTacToe AlphaBeta Program

I am looking for a review of my perfect TicTacToe algorithm. It will be split up into 3 parts: The function The GameState Class The game (NOT well designed) I am mainly looking for tips and comments ...
1
vote
1answer
94 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 ...
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 ...
9
votes
2answers
945 views

JavaScript Tic-Tac-Toe web app

I am teaching myself JavaScript and made a little Tic-Tac-Toe web app. I'm not asking anyone to read through it all, but to just tell me what I need or should not do in the future. ...
2
votes
1answer
963 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, ...