The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
4
votes
2answers
633 views

Tic Tac Toe game in C++ 11

It's time for my second simple game - Tic Tac Toc. I checked it on my Linux and it's working. For compiling it I used g++ with -std=c++11. I will be glad for any advice for the future. ...
5
votes
1answer
2k views

Simple Tic-Tac-Toe with Minimax Algorithm - follow up

Based on previous question i implemented most of suggestions. also, i have added Alpha-Beta pruning to minimize the calls. and making the game more generic to accept the board to be any value like 4x4 ...
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 ...
2
votes
2answers
441 views

Java tictactoe console application

I recently finished a Java application and I was wondering if you could code-review it just for the sake of understanding what I could have done better :) Since the code is long, I figure it would be ...
7
votes
1answer
311 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
2k views

Tic Tac Toe - Object Oriented JS Implementation

I have programmed a Tic Tac Toe game using Object Oriented JavaScript and ES6 Classes. The program works as planned, but I wonder if some parts of the code can be made cleaner or more efficient. I'...
6
votes
1answer
109 views

Command line noughts and crosses v2

I'm pretty new to Python - did some Fortran 77 at University for a minor project. Programming skills are a bit rusty! I plan to add a computer opponent next ... This is written in Python 2.7. <...
12
votes
1answer
12k views

Simple Tic-Tac-Toe PHP/Pure HTML

I've been doing a simple Tic-Tac-Toe with PHP, generating only HTML code. A few notes: I didn't bother yet to give an AI to the opponents (the Os), and it is intentional. There is no CSS style to ...
2
votes
1answer
175 views

Tic Tac Toe on Android

Can someone review my Tic Tac Toe Code? I tried to make it as compact as I could. What could I improve? I save the state of the buttons by adding freezesText="true"...
2
votes
1answer
340 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 ...
7
votes
3answers
2k views

Tic Tac Toe in Java: Runner Class Design, Using Helper Methods, and Instance Variables

Background: As a fun exercise to work on my grasp of the OOP paradigm (my experience learning programming the past 2+ years has focused mainly on C), I wrote a basic implementation of Tic Tac Toe in ...
2
votes
1answer
114 views

TicTacToe and stack memory management

I'm going through "C# Player's Guide" book and one of the optional tasks was to make simple TicTacToe program. Here is my implementation: ...
3
votes
2answers
159 views

TicTacToe game in more pythonic style

I wrote a simple TicTacToe console game in Python3. I would like to make my program more pythonic than it is now. For example, instead of ...
23
votes
8answers
11k views

Simple C# console Tic Tac Toe program

I've been teaching myself how to program for a little bit now, and was hoping to get some critique on my most recent project, creating a Tic Tac Toe program! I'm hoping for people to point out some of ...
4
votes
2answers
2k views

Tic-Tac-Toe Python 3 game

I was given the challenge of creating a Tic-Tac-Toe game that would print out the board each time. It was fun to make and part B of the challenge was to have others review my code. If you would like ...
6
votes
1answer
2k views

JS Tic Tac Toe using Minimax algorithm

To challenge myself, I set out to create a tic-tac-toe game, complete with a Minimax-driven AI. I had already attempted this challenge once when I was following the FreeCodeCamp curriculum. For this ...
1
vote
1answer
170 views

Tic Tac Toe - Verifying a player won

I saw this problem on a mock interview I spectated online, and decided to take a stab at it. The problem as stated originally asked to find if a given player had won a standard game of tic-tac-toe. ...
3
votes
5answers
19k views

Tic Tac Toe victory check

I am writing Python code for a Tic Tac Toe game. I need to write a function that takes in three inputs: board, x, and y. Board being the current display of the board and then x and y being values of ...
4
votes
2answers
134 views

Tic Tac Toe C++ follow up

I have finally found some time to redo the last tic tac toe game I posted. I have gotten rid of "Magic Numbers" as well as any typos(if their are any please point them out but I think i rid myself of ...
4
votes
2answers
534 views

Python Tic Tac Toe game with two difficulty levels

I made my version of a tic-tac-toe game for fun, but as being new to coding, I would assume that there are far better ways to make this. I just want to simplify my code down to make it easier to ...
1
vote
3answers
254 views

Tic-Tac-Toe in C++ for Windows console

I'm new to programming. I'm an aspiring computer science major and have started taking a C++ course at my college. I was bored tonight, so I decided to see if I could make a working Tic-Tac-Toe game. ...
4
votes
4answers
416 views

Tic Tac Toe with SOLID principles

I am making a Tic Tac Toe game to be played in the console either against another human or a simple AI. It is a little rough but it works. What concerns me is how well it adheres to SOLID and other ...
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
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 ...
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
2answers
2k views

C# Tic-Tac-Toe Game

Basically I am made a class that settles most of the back-end work of a tic-tac-toe game. I would like to have remarks about my general coding style and possible optimizations. ...
6
votes
3answers
6k views

Tic Tac Toe C++ with classes

After A ton of work I finally have a working Tic Tac Toe game that I am very proud of, and it works great. I would like some feedback on anything that can be improved/ needs to be changed. I had a ...
5
votes
3answers
946 views

Beginner Tic Tac Toe game in Python

I've just started learning python and I tried making a tic tac toe game and would really appreciate it if I got some feedback. I know, my code isn't the best optimized but this is what I could come up ...
4
votes
2answers
7k views

Create and print a tic-tac-toe board

Write a program by creating an array of 9 integers that represent the positions in the tic-tac-toe board. Once the array is created, assign values to the board and print the contents of the board ...
7
votes
1answer
446 views

TicTacToe in C++

I'm looking for any feedback I can get about my tic tac toe game in C++. I don't know what flaws to look for in code or design so that's why I come here to ask. My goal is to improve and write "better"...
4
votes
2answers
778 views

Object-oriented Tic-Tac-Toe game

I implemented an object-oriented version of a Tic-Tac-Toe game in Python 3. I'd like to have feedback on general code style and possible optimizations. ...
4
votes
3answers
272 views

Novice Tic Tac Toe in Java

I've never done anything in java, but today I had a couple hours of free time so I decided I would learn it and make a Tic Tac Toe game. Please give me some constructive criticism on anything you ...
4
votes
1answer
364 views

Console Tic Tac Toe

So I started Python this week, and I never programmed a game before. Even though Tic Tac Toe is probably the simplest game ever, I had some challenges while coding the game rules. I split my project ...
1
vote
1answer
774 views

Tic Tac Toe in PyQt4

I'm working on learning Python, and this is my second GUI project using PyQt. I've played it a few times to test it and it seems to work. It isn't anything clever; the computer just picks randomly. ...
2
votes
2answers
348 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 ...
2
votes
1answer
443 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
969 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 ...
0
votes
2answers
179 views

JavaScript Tic Tac Toe - functional but could be DRYer

I've been working on a simple Tic Tac Toe game in JavaScript. It runs the way it should, but the Board.checkWin function (check every possible winning combo) could ...
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. ...
38
votes
4answers
6k views

Ultimate Tic-Tac-Toe in C

Here is my attempt at the UTTT code-challenge (in response to the the Weekend-Challenge Reboot). Here is what I would like critiqued: I tested the code a few times for bugs, but I may have missed ...
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 ...
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 ...
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, ...
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
526 views
3
votes
1answer
6k views

Tic Tac Toe Android game

Can you help me with suggestions regarding my code for Tic Tac Toe Game? This is my code, I've tested it and it works, but I feel like it can still be made shorter/clearer. I am not a good coder and ...
3
votes
0answers
475 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 ...