Questions tagged [ai]

Artificial intelligence (AI) is the branch of computer science and technology that studies the development of machines able to simulate aspects of human intelligence.

Filter by
Sorted by
Tagged with
5
votes
2answers
273 views

Codingame: Great Escape bot in Ruby

(EDIT: I incorporated a lot of the feedback from the answers, and posted a follow-up question here: Codingame: Great Escape bot in Ruby - Follow-up) I started working on some code challenges at ...
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 ...
7
votes
1answer
310 views

2048 game - AI can't score more than 256 average

I'm trying to implement AI for 2048 with MiniMax and Alpha-Beta pruning, based on a snake strategy, which seems to be the best as a single heuristics. Unfortunately, AI makes 256 in most games, what ...
2
votes
2answers
7k views

Using BFS to solve 8-puzzle game using Python 2

I'm trying to solve the 8-puzzle game using BFS, DFS and A* algorithms implemented using Python 2.7. For now, I have managed to solve a couple of test cases using BFS and I want to know how I can ...
6
votes
1answer
5k views

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

I've implemented A* search using Python 3 in order to find the shortest path from 'Arad' to 'Bucharest'. The graph is the map of Romania as found in chapter 3 of the book: "Artificial Intelligence: A ...
9
votes
2answers
1k views

Color guessing code

This code is supposed to learn colors from many many data images, and then recognize color using an algorithm that I made. Eventually, I want the program to make its own algorithm. Data input and ...
5
votes
1answer
433 views

Neural Network in Swift

This is my first Neural Network, specifically a multilayer feed forward neural network that uses back-propagation for training, and I plan on using it for a multitude of projects. I started with the ...
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 ...
4
votes
1answer
67 views

iOS game of drawing sticks with AI and scoring

My code actually works. I was just wondering if there was alternative ways, maybe even more efficient ways of coding my program. This is suppose to be a game of drawing stick, and it's recording the ...
6
votes
0answers
6k views

A game of NIM (Basic AI strategy)

I tried creating the game of NIM in python. I researched a couple of videos on how to always win at NIM. Eventually, I found a method and i was able to implement it in my code. This is the result... <...
2
votes
2answers
341 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 ...
5
votes
2answers
1k views

C++ Feed-Forward Neural Network

After a few days of reading articles, watching videos and bugging my head around neural networks, I have finally managed to understand it just so I could write my own feed-forward implementation in C++...
3
votes
1answer
337 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 ...
3
votes
1answer
1k views

Bulls and Cows AI

This is a program with an 'AI' that plays Bulls and cows. Bulls and cows is a code-breaking game where you think of 4 digit number and the other layer tries to guess it: https://en.wikipedia.org/...
5
votes
1answer
93 views

Teaching an Old AI New Magic Tricks

Recently I wanted to teach the AI of my castle game how to use the spells that I have added to the game. You can try out the game here: Castleparts Initially I thought that I would have to add ...
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. ...
10
votes
2answers
4k views

AI Decision Tree

I created little decision tree, what do you think about it, what I can correct? I wanted to create a code for tree that looks in that way: My implementation: ...
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 ...
5
votes
1answer
719 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 ...
10
votes
2answers
457 views

American Checkers with AI

This is the third question in the series. Number 1 had most of the official two-player rules implemented, and Number 2 was the basic UI. This one has the complete two-player rules implemented, an AI ...
5
votes
2answers
4k views

Connect Four game with minimax AI

I have created a connect four game between a bot and a player. It was quite a bit of a challenge since I wasn't too fond of the minmax algorithm until now. I know there's always room for improvement ...
1
vote
0answers
64 views

Multi-layered Perceptron

Solution: Generate Training Set ...
3
votes
0answers
583 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 ...
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 ...
3
votes
0answers
93 views

Classifying test data into several classes

The following code is to classify the test data into several classes: ...
2
votes
1answer
2k views

Naive Bayes Classifier in C#

I took the code from internet and tried to simplify it. So, what can I do? How can I simplify my code more to make it easily understandable? ...
3
votes
1answer
532 views

Tic-Tac-Toe game with AI

I started learning Racket recently and decide to revisit the problem that introduced me to computer programming: making a Tic-Tac-Toe game with AI. Here's the code: ...
6
votes
1answer
342 views

An unbeatable TicTacToe game

I wrote an answer to another question about the same subject and a new implementation, but instead of just posting my code there I think it's a good chance to see what can be improved on my own code. ...
5
votes
1answer
432 views

Udacity AI for Robotics translating Python code to C++

I've been learning C++ for about a week now. My primary language is Python, so I thought I would find some code to translate to figure out how the pieces fit together. Please let me know any ...
7
votes
1answer
474 views

An unbeatable Tic-Tac-Toe game using exhaustive enumeration of all cases

I am a beginner programmer and I've been trying to complete an unbeatable tic-tac-toe program, my code is below. The program itself works, but it seems rather inefficient, as I literally have to type ...
3
votes
1answer
189 views

Agar.io-like game

I've created a game (basically an Agar.io clone), where a human player is placed against AI controlled bots powered by a genetic algorithm and neural networks. The problem is that I think that my ...
2
votes
0answers
513 views

Tic Tac Toe AI - library based on Minimax algorithm

I recently struggled with implementing AI in Tic Tac Toe game. For better understanding of minimax algorithm I've decided to separate AI's logic. When I finished I thought that some may find it useful,...
3
votes
1answer
668 views

A simple fully connected ANN module

I've written a simple module that creates a fully connected neural network of any size. The arguments of the train function are list of tuples with a training example array first and an array ...
2
votes
1answer
375 views

Multi or n-armed bandit reinforcement learning in R

I am learning about reinforcement learning and came across the first and simplest form of reinforcement learning system called multi-armed reinforcement learning (also called as n-armed bandit). I ...
11
votes
1answer
2k views

Yet another minimax tree for TicTacToe

I have written a working minimax tree for Tic-Tac-Toe. What I have done so far is create a tree with end node having value 10, 0 or -10 base on win, lose or draw. After I create a tree I then ...
4
votes
1answer
144 views

Tic Tac Toe algorithm using itertools

I'm looking for feedback on the readability of my code and opinions on the pick_best algorithm. I do this stuff for fun when I have time, and never get a chance to have anyone else look at it. ...
3
votes
1answer
148 views

Pong game with a random twist

I made a simple Pong game using SDL2, with a twist: You don't get to play :), only the 2 AIs get to. ;) Because Pong is a very small game, I put everything in a single file (...
18
votes
2answers
474 views

The birth of my intelligent assistant: Khronos

I've done a lot of reworking to this main file recently, in regards to using a new speech recognition engine and integrating the last reviews suggestions. My question before is going to be phrased ...
6
votes
1answer
197 views

Logic Prolog compiler

I'm actually doing my own Prolog compiler just like SWISH one with Java. Prolog is a logic language that is particularly suited to programs that involve symbolic or non-numeric computation. Prolog ...
4
votes
3answers
199 views

Hungry ant AI: any food here?

I'm working on a little AI to simulate ants (very basic). The full code can be found on Github. This function (in Ants.py) takes a list of Tuples containing ...
4
votes
1answer
3k views

Tic Tac Toe game AI in C++

I wrote a Tic Tac Toe game from scratch a couple days ago. My AI doesn't always make the best moves, so I'd like some advice on how to improve it. I also hardcoded a move in a very specific ...
3
votes
1answer
2k views

Tic Tac Toe with 3 AI modes or Two-Player

This is my first stab at a game AI, and I've been working on multiple game mode difficulties, so I decided to start with a simple game. :) I'm most concerned about efficiency of the AI algorithms, and ...
7
votes
1answer
1k views

2 player chess game in C++

I have written a 2 player chess game in C++. Things I have accomplished so far: Legal moves validation Bit board generation Things I look forward to (would appreciate advice on them): Move ...
2
votes
1answer
7k views

DFS and BFS search for 8-puzzle

I implemented the DFS and BFS. Please offer improvements. ...
2
votes
1answer
2k views

Connect4 With AI

I have made a connect 4 console application in C++ and would love some feedback. In this project I have learned about inheritance and using virtual functions. Main.cpp ...
6
votes
1answer
1k views

Alpha Beta Pruning Optimization

I made a class that would do alpha beta pruning on a binary tree of 40 degree. However there is a time limit on a single move of 30 seconds. I am to play against my professor and his opponent class. I ...
3
votes
1answer
150 views

Alpha Beta Pruning with binary tree of size 40

I'm working on a program that is supposed to use alpha beta pruning to find the best move for a game. The game is basically a binary tree of degree of 40 and each node will have a different float ...
14
votes
1answer
167 views

TicTacToe with AI in ruby - follow-up overload

I already posted this program numerous times, always surprised by the amount of improvement that is possible suggested by people here. Is it possible to make it even better, without nitpicking? At ...
6
votes
0answers
127 views

Chatty AI that saves .txt files to remember

This is a basic AI that I created. It has a teach function that creates a .txt file with user inputed info for future use. If you type teachme you have the option to type in something that you have ...
22
votes
1answer
276 views

21: The number with the curse

The goal of this game is to not say the number 21. Rules: You must only say numbers consecutive to the previous said number. You may say 1, 2, or 3 numbers at a time. For example: Player 1 says 1 ...