Questions tagged [tic-tac-toe]

A game, also known as "Noughts 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
45 views

basic two-player tic tac toe game [closed]

Here is my code: ...
8
votes
2answers
81 views

Managed to make Tic-Tac-Toe as someone who is new to coding

I'm trying to build up a toolset of best practices, so as this is my first complete program (if you can call it that) writen in c++, I know there's definitely better ways of doing things ...
2
votes
1answer
48 views

Tic-tac-toe game using Pygame

I programmed a tic-tac-toe game using pygame. It's the first game I make. I'd really appreaciate any comments you have about the coding style and any improvements that could be made. ...
6
votes
2answers
645 views

TicTacToe with AI in C

I recently started learning C, though I have some experience in other languages. I recently wrote a TicTacToe AI using the Minimax Algorithm in C. I would like to know how I could write better C. <...
1
vote
0answers
28 views

A Tic-Tac-Toe AI based on two rules

So i made a tic tac toe bot with the following rules (its not unbeatable) ...
4
votes
0answers
53 views

Text-based tic-tac-toe game in Python

I'm working on a text-based tic-tac-toe game, mostly for fun and because I'm learning programming. I would appreciate any comments you could give me to improve it. Main structure: Uses a Board class ...
4
votes
2answers
111 views

Tic Tac Toe, No OOP

I was looking at a code review of a Tic Tac Toe game in Python when I recalled a talk about not using classes, and I wanted to see if I could write a readable, working implementation of the game ...
8
votes
4answers
286 views

Python text-based Tic Tac Toe

I created a simple text-based Tic Tac Toe game in Python using OOP. Currently the computer moves are completely random - I plan to add some sort of algorithm later (no idea how to do that yet though) ...
0
votes
1answer
47 views

Tic Tac Toe in Python practice 2

The previous code on codereview I'm quite novice here so apologies for any silly mistake in advance I've been writing a simple tic tac toe game which is a part of my course in udemy Since this is my ...
1
vote
1answer
52 views

Tic Tac Toe in Python practice

I'm quite novice here so apologies for any silly mistake in advance I've been writing a simple tic tac toe game which is a part of my course in udemy Since this is my first project, I want to do my ...
7
votes
1answer
313 views

Improved Tic Tac Toe game. Made in C

For my second week of learning C, I decided to remake the Tic Tac Toe game I made last week, but in a different style (as some of you recommended me). This is my final product on the whole Tic Tac Toe ...
11
votes
5answers
1k views

Simple Tic Tac Toe game inside terminal

Hello fellow programmers. I started learning C last week and today I wanted to see if I can make a working program, so I made this game: ...
3
votes
1answer
59 views

Tic-Tac-Toe in C

I have implemented a Tic-Tac-Toe game in C which can be played as two-player or with a computer player. ...
12
votes
1answer
1k views

I made Tic Tac Toe in C

I made this Tic Tac Toe game in C. It works but I thinks it could be programmed better. You have the option to play alone or between two players. It also lets the player select if he uses 'X' or 'O'. ...
3
votes
2answers
76 views

Tic-Tac-Toe in Java

I am currently learning Java; I could really use some help from more experienced programmers. How can I clean up my Tic-Tac-Toe code? What mistakes have I made? Can I use more exception handling? I ...
1
vote
1answer
44 views

Given a Tic-Tac-Toe gamestate return all wins as text

In a game of Tic-TacToe given a gamestate: game_board = [ [1, 0, 1], [0, 1, 0], [0, 1, 0] ] I have written the following piece of ...
2
votes
1answer
67 views

OOP Based TicTacToe - Logic Improvement/Best Practices

Looking for any feedback to improve practices on the following logic, and I have removed large chunks of documentation to reduce noise. I feel the areas that could expect heavy criticism are the win/...
4
votes
1answer
93 views

Minimax based Tic Tac Toe

I am attempting to make an unbeatable Tic Tac Toe game using a simplified minimax algorithm. The code looks like this: ...
7
votes
1answer
116 views

A simple tic tac toe game in Javascript/HTML/CSS

This is my first web app written in JS. I would like to know how the code can be improved in terms of style and structure, especially in terms of following JS's conventions and general heuristics. I ...
5
votes
1answer
129 views

Almost unbeatable Tic Tac Toe

JavaScript beginner here! I have written a Tic Tac Toe game is JS that seems to be unbeatable (Title says 'almost' because I'm not sure if it's really unbeatable or just I can't beat it :) ). I ...
3
votes
1answer
76 views

Tic-Tac-Toe implementation c++

I created this game just to practice my skills. I've been coding for a few years and I'm decent at data structures and algorithms. I want to know how to improve my implementation. ...
3
votes
2answers
85 views

Checking if naughts or crosses win in Tic Tac Toe

I am working on a coding challenge for Tic Tac Toe. I am calculating the results and inserting them into the database. However I have a long and messy if statement, which checks if the array's values ...
3
votes
0answers
28 views

Noughts and Crosses Terminal Game with AI

I created a game which can play tic-tac-toe with: 0 players (AI vs AI), 1 player (human vs AI) or 2 player (human vs human). Here is the AI function which wraps around my innermost function. This ...
2
votes
1answer
58 views

C# Tic Tac Toe Game with SOLID

i'm doing a Core for a Tic Tac Toe game. I have my code with a dynamic size of the board (can be 2x2 to 10x10, if is 7x7 we need a 7 characters in a row to win , if is 4x4 we need 4 etc) , This code ...
1
vote
1answer
46 views

2 player CLI Tic-Tac-Toe game in python

This is a fully functional code that i have just completed today. I just want to know how efficient is this. and how could i improve it or if theres any bugs that i have miss out. ...
5
votes
2answers
74 views

CLI Tic-Tac-Toe in python

Is there any way I could make my Tic-Tac-Toe board more aesthetically pleasing? Is there anything else I can improve besides the look of the board? ...
1
vote
0answers
39 views

Tic Tac Toe game logic

I've implemented tic-tac-toe in TypeScript before; now I'm porting it to Elixir. As before, this is pure game logic, no UI involved. I'm very new to Elixir, so any suggestions are appreciated. The ...
1
vote
1answer
69 views

Total beginner Tic Tac Toe game in Python

I've decided to learn Python about 2 weeks ago, been going through various books and videos, and I've decided to try my hand at programming a Tic Tac Toe game. I was somewhat successful (it doesn't ...
6
votes
2answers
113 views

Rust Novice's Tic Tac Toe

Introduction I am a Rust novice. So far, I have finished reading the first 15 chapters of The Rust Programming Language (a.k.a. the book). Here's my first big Rust project — Tic Tac Toe. ...
3
votes
1answer
146 views

Tic Tac Toe with ASCII art

I have written a simple Tic Tac Toe game using some ASCII art. Is there anything I can do to improve upon the logic and structure of the program? ...
6
votes
1answer
128 views

TicTacToe implementation in Java

Right now I'm studying Java, and as a part of understanding arrays, I've implemented a Tic-Tac-Toe game based on two-dimensional array. Any suggestions/comments are much appreciated! Source code ...
3
votes
0answers
41 views

Simple Tic-Tac-Toe game in Javascript (NO A.I.)

After some hours of coding trying to implement "algorithms" to make a Tic-Tac-Toe game, I came up with something I'm not really proud of. Here's the code: ...
3
votes
1answer
91 views

Tic Tac Toe in C++ (console version)

I have made a 2 player Tic Tac Toe game in C++. I have put in some error checking also (like if the players enters an invalid position). The code is working absolutely fine. This is what my program ...
1
vote
1answer
46 views

JavaScript Tic Tac Toe Win Checker is Wet

New to coding/Javascript. Writing a basic Tic Tac Toe game. I'm writing the game to be dynamic, so it won't always be a three-by-three grid, but rather any size grid larger than 1. I have a ...
2
votes
2answers
85 views

TicTacToe with Python

...
2
votes
2answers
93 views

Javascript Tic Tac Toe

I've created a Tic Tac Toe game in JS/HTML/CSS. Is there anyway this can be improved? Thanks Codepen: https://codepen.io/KhushrajRathod/pen/wvaeOaZ Github: https://github.com/KhushrajRathod/...
7
votes
1answer
188 views

Pyqt Tic Tac Toe

Recently discovered PyQt5 and decided to make this as a 'hello world' for GUIs Would like input on the design, best practices, as well as idiomatic nature of the application and its structure. Game....
9
votes
1answer
148 views

A Python based Tic-Tac-Toe game

As a basic project, I've programmed the game of noughts and crosses (tic-tac-toe) using classes. I made three classes: Board, ...
5
votes
1answer
81 views

Yet Another Command Line Noughts and Crosses

It's been a while since I last looked at C++ so before resuming one of my old projects I thought I'd brush up on the basics so I've written a basic noughts and crosses game (because it's just getting ...
0
votes
1answer
45 views

Tic-Tac-Toe game suggestion

I am a beginner so please keep it in mind while answering! For player vs CPU is there any more effective way to make CPU better ?? ...
5
votes
1answer
109 views

TicTacToe Python

Can you provide some advice on how I can simplify this code? I am a beginner with Python, and I'm pretty sure that my code can be much simpler. I think the check() ...
4
votes
1answer
214 views

Beginner python tic tac toe with AI

I've come up with this code for a tic tac toe game with and AI that the player can go against, please help me optimise my code and help me grow better habits haha. ...
1
vote
2answers
152 views

A simple AI for Tic-Tac-Toe game

This is an AI class that takes an array of the board as an argument, and plays the best move after evaluating the board and gets a win rate. I haven't used any java package to do this. How can I make ...
2
votes
1answer
1k views

Tic-Tac-Toe in Java with GUI

I've wrote a little program to play Tic-Tac-Toe: public class Control { public static void main(String args[]) { Gui gui = new Gui(); } } The ...
0
votes
2answers
65 views

Noughts and Crosses Game Feedback

Hi i have created a game of noughts and crosses in c++ I am new to this so the code is a bit messy, but i would love to get any feedback from you lot about the actual game and not the code for now. ...
3
votes
0answers
56 views

First Attempt at Object-Oriented Programming: Tic-Tac-Toe

Began learning python about 3 months ago and this was my first OOP. I was hoping to get constructive feedback! My own thoughts after writing it were that there had to be a better way to: 1) generate ...
3
votes
1answer
140 views

Simulate Tic Tac Toe game using C language

I made a Tic Tac Toe game using C. Here two players, player1 and player2, can participate and play. Please rate my code and suggest improvements. ...
4
votes
0answers
71 views

Tic Tac Toe with different level AI

I've already created a code in python here with almost the same logic: Tic-Tac-Toe with changeable board size (Part 1) Tic-Tac-Toe with changeable board size (Part 2) Here's the code in C++. As I'm ...
3
votes
2answers
162 views

Beginner Tic-Tac-Toe in Python

...
4
votes
4answers
422 views

Tic Tac Toe Game in Python 3

I made this as a personal challenge. It seems to work fine as I can't find any bugs and am happy with how it runs, but I am interested in what I should do to make the code more professional. Note: ...

1
2 3 4 5
11