Skip to main content
Share Your Experience: Take the 2024 Developer Survey
22 votes
Accepted

92 Spoons AI, sort of an AI in C++

There's a lot to say here, so let's not waste any time and jump right into it: You said that you didn't want to hear the using namespace std;-drill, but ...
Ben Steffan's user avatar
  • 5,228
16 votes
Accepted

The birth of my intelligent assistant: Khronos

Readability Inconsistencies in coding style: Decide where You put an asterisk. Now You have things like this: ps_decoder_t *ps, const char* fileName. A few ...
Kamiccolo's user avatar
  • 544
16 votes

92 Spoons AI, sort of an AI in C++

Here are some things that may help you improve your code. Don't abuse using namespace std I know you said you don't want to hear this, but your code is unusable ...
Edward's user avatar
  • 66.4k
13 votes
Accepted

Ncurses Tic Tac Toe with simplistic AI

Avoid numbered variables ...
mdfst13's user avatar
  • 21.6k
12 votes

92 Spoons AI, sort of an AI in C++

Header files You have a lot of implementation code in that header file (files.h). Header files should only contain the function or class headers, the implementation should go into an extra cpp file. ...
Raimund Krämer's user avatar
12 votes

Ncurses Tic Tac Toe with simplistic AI

Here are a number of things that may help you improve your program. Eliminate global variables where practical Having routines dependent on global variables makes it that much more difficult to ...
Edward's user avatar
  • 66.4k
10 votes
Accepted

Minimax implementation of tic tac toe

Sorry, but that someone is probably right. At the same time, thanks for being thus brave and asking on how to improve here. It's not so simple to give feedback in such a scenario, since there are so ...
Thomas Weller's user avatar
9 votes
Accepted

AI Decision Tree

Code style Naming The interface naming convention has a capital I at the beginning of your name so your TreeNode should be called ...
Denis's user avatar
  • 8,478
9 votes
Accepted

Simple Tic-Tac-Toe with Minimax Algorithm

Here are some things that may help you improve your code. First, yes, you implemented the minimax algorithm correctly, but there's an easy improvement you can make that I'll show later. Avoid magic ...
Edward's user avatar
  • 66.4k
9 votes

TicTacToe with AI in C

General Observations I see a lot of good programming practices followed here already, keep up the good work. Most of the functions are small and follow the Single Responsibility Principle. Use Library ...
pacmaninbw's user avatar
  • 23.8k
8 votes
Accepted

Color guessing code

Fix the includes Don't include headers you're not using. I had to remove a bunch of headers that aren't available here, simply to get your code to compile. I then had to include the math header for ...
Toby Speight's user avatar
  • 75.9k
8 votes
Accepted

Stock Monte Carlo Tree Search implementation to a simple connect 5 game in Python

There's a bunch of stuff to dislike about your code: The superficial docblocks are annoying. Please delete them. I really don't care if some automated checker passes with no errors or not - because ...
aghast's user avatar
  • 12.4k
8 votes

Create a clever Specker game player

Several things that can be improved. According to GDB the line << players_list[i % game_players]->play(currentState) << endl; causes a segmentation ...
yuri's user avatar
  • 4,458
8 votes

Tic Tac Toe in C w/ ncurses Revision

I've made this Community Wiki because my answer revolves around 1 example that those more knowledgeable about C could probably improve and expand. Improvements are welcome! Practice DRY code There's ...
8 votes
Accepted

Tic Tac Toe in C w/ ncurses Revision

Capitalize your defines #define num_spaces 9 should have NUM_SPACES instead of num_spaces....
Reinderien's user avatar
  • 62.1k
8 votes

Tic Tac Toe in C w/ ncurses Revision

A small review I noticed in both iterations of your code that you have to forward declare every single function. This is not advisable. It is better to declare ...
Summer's user avatar
  • 2,334
8 votes
Accepted

MMMRjs a product of BYTES Genesis

Comments The comments such a This is Mean. are pointless. And the comment ...
RoToRa's user avatar
  • 11k
7 votes

Tic Tac Toe in C w/ ncurses Revision

Compiling using clang with warnings turned on reveals a number of issues: ...
200_success's user avatar
6 votes

Connect Four game with minimax AI

First, you should ask yourself whether the names you chose are good. For example, a typical game of connect four takes place on a single Board, yet you defined an array of boards and call this array a ...
Roland Illig's user avatar
  • 21.3k
6 votes

Stock Monte Carlo Tree Search implementation to a simple connect 5 game in Python

There's something off about the following function: ...
Mast's user avatar
  • 13.4k
6 votes

Create a clever Specker game player

Have you got any ideas on how to create a more clever AI player that will actually try to beat every game? That's a vast question, of which I'm not certain it belongs here. I won't offer an ...
papagaga's user avatar
  • 5,757
6 votes

Python TicTacToe

Here is my list of thoughts (in random order). Since you don't specify any particular goal I am reviewing mainly for "relative beauty" of the code: you have ...
FirefoxMetzger's user avatar
6 votes
Accepted

A command-line unbeatable Tic-Tac-Toe written in C

Please add some space to your code - it can be hard to read when it's all crammed together. For example, compare these two versions of the same function; first, as written: ...
Toby Speight's user avatar
  • 75.9k
6 votes

MMMRjs a product of BYTES Genesis

Rotara already mentioned some great points - the comments can definitely be improved and follow common conventions, sorting should happen on copies of the data instead of the original data, and the ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
5 votes

Hungry ant AI: any food here?

Disclaimer: Current version of the code seems to be very weirdly indented. Some comments might be wrong because of some misinterpretation of your code. Style Python has a style guide called PEP 8. ...
SylvainD's user avatar
  • 29.2k
5 votes

The birth of my intelligent assistant: Khronos

This isn't a full review, just a couple of points: Help Text You have a method printHelp, not included in your code. I'm assuming that it returns a formatted ...
forsvarir's user avatar
  • 11.7k
5 votes

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

I'm going to sidestep the complexities of machine learning itself, it is after all a code review. Unclear method names and unused parameters ...
Flater's user avatar
  • 5,532
5 votes
Accepted

A* Search on 'Map of Romania' (Russel and Norvig ch3) in Python 3

Just a couple of observations: There's a comment documenting the elements of the priority queue: ...
Gareth Rees's user avatar
  • 49.6k
5 votes

Python Tic Tac Toe game with two difficulty levels

Before anything else, I'm going to point out to you that you have a function called testwon. It almost works. The problem is that it will return "x" or "o", but it ...
aghast's user avatar
  • 12.4k
5 votes
Accepted

Tic-Tac-Toe with changeable board size (Part 1)

and welcome, and thanks for providing an interesting subject. I like the idea of difficulty levels for the game! That said, your code is too long. Not "too long to review," just "too long." Moar ...
aghast's user avatar
  • 12.4k

Only top scored, non community-wiki answers of a minimum length are eligible