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
3
votes
2answers
96 views

TicTacToe in Python

This is my second attempt to make Tic Tac Toe in Python. It's a part of my learning. Tomorrow I'll work on some simple AI and better menu. What do you think about it? What changes do you suggest? Code:...
6
votes
1answer
1k views

Tic-Tac-Toe AI in C# Unity

So I have a working game of Tic-Tac-Toe with an AI that plays random moves. Is anyway to maybe shorten the endturn() function so it's not so long? Also is this set up well enough to add a mode where ...
5
votes
2answers
215 views

Python TicTacToe

This is a console based Tic Tac Toe Game I programmed to practice my python. It is object oriented with a few standalone functions for getting user input. The game also has a basic AI that is ...
3
votes
1answer
761 views

TicTacToe with MiniMax algorithm (C#)

A friend of mine asked me to help him with his Tic-Tac-Toe implementation. He's a beginner, so we ended up implementing a simple state-machine that reacts to the moves. I was curious how I might ...
5
votes
2answers
569 views

C++ implementation of Tic-Tac-Toe game

I have written this simple code for Tic Tac Toe. ...
4
votes
2answers
1k views

Tic-Tac-Toe game made with JavaScript, HTML, and CSS

I am a beginner programmer. In a prototype function of the game function, called game.prototype.restart, I repeated some lines of code to reset variables I used to ...
3
votes
1answer
579 views

Noughts and crosses bot in Delphi

I hope someone can guide me in a way to make this code more efficient. Please explain the things you do simply because I'm no pro so more complex things I am unlikely to get. If you have issues with ...
18
votes
2answers
3k views

4x4 tic tac toe

I just started coding 10 days back. This is my first program using classes in C++. It is a two player 4x4 tic tac toe game. It works perfectly. If there are any improvements I can make, please let me ...
2
votes
1answer
232 views

Find winning move in Tic-Tac-Toe with boolean arrays in VBA

I've been trying to mess around with boolean arrays in VBA since I started to try to write an algorithm to solve sudoku puzzles. I thought I'd first try to solve codeabbey tic-tac-toe. I might be ...
4
votes
2answers
306 views

Java TicTacToe MVC with Singleplayer mode

To practice the MVC pattern and Unittesting in Java I decided to make a simple TicTacToe Console Application. The features of this App are: Multiplayer-Mode Singleplayer-Mode (that should always ...
3
votes
1answer
517 views

Tic-Tac-Toe engine in JavaScript

I just cloned (Github clone, not literal clone) someone's Tic-Tac-Toe game and I was originally going to make a pull request, but I ended up making too many changes, the code is simply unrecognizable ...
3
votes
3answers
1k views

Check for a win on the board

This code is part of a tic tac toe game. It uses a 2D array for the board. The functionality of the following code is to check for a win on the board, in rows, columns and diagonals. How can I ...
10
votes
1answer
6k views

Simple two-player Tic-Tac-Toe

How can I improve this simple code to look better, concise and elegant? I've been learning Python for 2 weeks. I knew about basic Python stuff and some algorithms and data structure as well. I made a ...
1
vote
1answer
351 views

Scala tic-tac-toe no mutable state

The following was an exercise for me to try to understand how state can be passed down the stack without immutability. I'm used to writing java code and this is just a way for me to understand. I've ...
3
votes
2answers
666 views

TicTacToe for Humans in C

This is a small project that is intended to be an educational exercise in learning and consolidating basic syntax and concepts of C. It is a simple console-based implementation of TicTacToe which ...
3
votes
1answer
330 views

Tic Tac Toe in JavaScript (+ jQuery)

Here is my first project that I made with JavaScript and jQuery with a little bit of HTML and CSS: ...
4
votes
2answers
578 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
1k 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 ...
2
votes
2answers
393 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 ...
2
votes
2answers
649 views

Tic tac toe OOP

I'm a beginner in OOP in JavaScript. I have programmed a Tic-Tac-Toe game. The program works, but I don't know if I followed the principles of OOP in this case. I know, that's functions in methods - ...
5
votes
1answer
8k views

Simple Tic-Tac-Toe with Minimax Algorithm

I have implemented AI to tictactoe game by using Minimax Algorithm. The game looks working okay and AI is intersecting the player moves to block him from winning the game. I would like to know if I ...
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 ...
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
101 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. <...
2
votes
1answer
159 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"...
3
votes
2answers
158 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 ...
6
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: ...
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? ...
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 ...
1
vote
1answer
163 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. ...
4
votes
2answers
511 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
239 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
409 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 ...
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. ...
1
vote
2answers
12k views

Tic Tac Toe in C

would appreciate if anyone could look through my tic tac toe code and what I possibly do to improve upon it. Initializing the Board ...
6
votes
1answer
1k 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 ...
5
votes
3answers
846 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 ...
7
votes
1answer
422 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
713 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
262 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
298 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 ...
23
votes
8answers
10k 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 ...
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
417 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
936 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
6k 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
689 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
392 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 ...