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
1answer
1k views

Tic-Tac-Toe AI Player

I made a simple tic-tac-toe AI app, where the AI, who is always O, wins or ties. I just wanted some input on it, and wanted to know if there was any ways to improve it (not the functionality of it, ...
3
votes
1answer
7k views

8-Puzzle using A* and Manhattan Distance

I have developed this 8-puzzle solver using A* with manhattan distance. Appreciate if you can help/guide me regarding: 1. Improving the readability and optimization of the code. 2. I am using sort to ...
3
votes
1answer
60 views

TicTacToe game with AI in ruby - follow-up

A week ago I posted my TicTacToe game follow-up question. The suggestions were referring mainly to the lack of polymorphism. Here's the new code, hopefully there's not a lot (or at all) to improve by ...
3
votes
0answers
8k views

Monkey-banana problem in Prolog

The monkey-banana problem: There many variations to this problem, but the basic premise is that a monkey is in a room with a banana and a chair, and the monkey cannot reach the banana until he moves ...
2
votes
1answer
1k views

Neural Net XOR Genetic Algorithms

New to Neural Networks and before I move on to gradient descent I would like to make sure I have got basic idea right. (Sorry that the class is called perceptron I know that this isnt technically ...
4
votes
3answers
532 views

TicTacToe game with functional AI in ruby - follow-up

A month ago I posted an earlier version of the game here, and got a great response, which was mainly about the structure of my code. I freed some time today and reworked the code from scratch. Things ...
1
vote
0answers
334 views

Markov chain chatbot producing poor results

In my high school AP computer science class we're making a very basic chatbot that replies with predefined answers. I decided to have a bit more fun with it My program is basically this answer on ...
4
votes
2answers
307 views

Noughts and Crosses GUI game in Java - Part 2/2: GUI

(See also Noughts and Crosses GUI game in Java - Part 1/2: AI) This part is dedicated to the View/Controller of the MVC pattern. So once again these are the building blocks of the Noughts and Crosses ...
3
votes
2answers
402 views

Noughts and Crosses GUI game in Java - Part 1/2: AI

(See also Noughts and Crosses GUI game in Java - Part 2/2: GUI) I was working on a GUI game of Noughts and Crosses, and this is what I finally got: Unfortunately, the entire source code for the ...
6
votes
2answers
724 views

Cleverbot Game in Java

This is a project I've been working on for a while. It's basically Cleverbot. What do you think? ...
5
votes
2answers
1k views

Simple TicTacToe game with AI in Ruby

What changes do you recommend from the perspective of structure, logic, etc? ...
6
votes
2answers
766 views

Ruby command line Mastermind game with AI

I've created a small command-line 'Mastermind' game using Ruby. The intent of the project (aside from having fun in the build!) was to learn and emphasize OOP concepts and principles. The game has ...
2
votes
0answers
104 views

Binary Bayes network classifier in Java - Part II/II

This is the continuation of Binary Bayes network classifier in Java - Part I/II TERMINOLOGY We are given a directed acyclic graph (dag) \$G = (V, A)\$, where \$V\$ is the set of nodes and \$A \...
2
votes
1answer
3k views

Iterative deepening depth-first search heuristics to solve “3 Missionary And Cannibal” challenge

Missionaries and cannibals problem is a well known Toy Problem to learn basic AI techniques. I implemented it using iterative deepening depth-first search algorithm. My state is represented by a 3-...
2
votes
0answers
907 views

Bayesian network query tool in Java

Suppose you are running a business of repairing cars. You know all the parts (graph nodes) and the way they affect other parts (directed edges), and you know the probabilities of each part failing. If ...
2
votes
2answers
1k views

Breadth-First Search heuristics to find solution to Water Jug Challenge

I started learning AI recently. In AI, searches should be avoided and everything in AI is a search problem. One of the easiest problem where we could use general AI search techniques is the water jug ...
1
vote
0answers
509 views

Generalized Missionaries and Cannibals in Java - follow-up

See the previous and initial iteration. Now I have incorporated all the points suggested by mdfst13, and have the following: StateNode.java: ...
5
votes
1answer
5k views

Generalized Missionaries and Cannibals in Java

See the next iteration. I was in the mood for some basic AI, and decided to code up an algorithm for solving "\$M\$ missionaries, \$C\$ cannibals in the boat with \$B\$ places" -algorithm: Demo.java:...
2
votes
1answer
117 views

Randomly learning a neuron to act as a signal counter

I have this small program for learning an artificial neuron to act as a simple signal counter: my cell has four input wires (also called dendrites) and a single output wire (also called axon). If at ...
19
votes
4answers
34k views

Simple Self-Learning AI

This is a programming challenge I set for myself a while back to create an AI that starts with no knowledge of anything whatsoever, and learns as you talk to it. (It can learn stuff like your name, ...
11
votes
3answers
459 views

“AI” chat program

I've thrown together this simple chat program, and while it works. I think it could certainly use some improvement. Here's how it works. Obtain user input by removing all punctuation from the input ...
10
votes
2answers
7k views

Connect 4 (glorified tic-tac-toe) implementation

I'm posting here my implementation of the game Connect 4. It's obviously a pretty trivial game and code but I'm primarily interested in any advice concerning improvements to the code structure: types, ...
4
votes
2answers
106 views

Calculating which direction my enemy should face when moving

I have just implemented an algorithm which calculates the direction an enemy in my game should face when moving to a location. This is a 2D game where characters can face in one of four directions: (...
6
votes
1answer
261 views

Video Game AI State Change

I have here a snippet of code from a simple video game AI enemy. The basic idea behind the enemy is that he can be in one of a few states. By default he is in a patrolling state, where he moves ...
5
votes
2answers
349 views

Obstacle-avoiding AI

I have made a game in Java that involves two players to fight each other with spaceships. For one player mode, I have programmed a simple AI to avoid allies and asteroids and go straight towards the ...
6
votes
2answers
438 views

Another JavaScript Stack Exchange chat bot

I've been inspired by @SirPython's SirAlfred JavaScript chat bot, so I went and made my own. This one is slightly different though, in the fact that it can accept input in a more lenient way. For ...
11
votes
2answers
6k views

Simple 2048 AI in Python

A few weeks ago, I wrote a Python implementation of 2048. Since then, I've been working on a simple AI to play the game for me. The code uses expectimax search to evaluate each move, and chooses the ...
7
votes
2answers
256 views

BotClean challenge

I'm going through the artificial intelligence domain at HackerRank. I'm very new to this domain and I really need a guide on how should I minimize the number of if/<...
2
votes
0answers
131 views

AI for depth-first walking in a maze, with variable depth look ahead search for dead ends and finish point

This code is a part of a little game I've started a week ago. It is too extensive to review at once, so I'm picking the most interesting and crucial parts. Start with the AI. It has public update ...
5
votes
2answers
3k views

Sudoku solver using forward checking

I was compelled to look into a Sudoku Solver in Java using the principles I have learned in a course, namely I wanted to make something that included backtracking and forward checking. Has anybody ...
4
votes
0answers
148 views

Super Resolution in the Wolfram Language, Attempt 2

This is a wolfram language program I wrote for super-resolution, in this case meaning to guess at how to increase the the resolution, and so detail shown in a raster image such as a photograph. It ...
4
votes
2answers
2k views

Chess programming algorithm minimax to Alpha Beta

I have written some code for alpha beta for Chess programming and not sure completely if that is the correct way to do it. Can someone please tell me if I implemented the ...
5
votes
1answer
568 views

Neural Network Simulator with OpenMP

I wrote a simple neural network simulator (the biophysical kind) from scratch, and was hoping to get some feedback on how I can speed things up, or any C++ / compilation best practices that I can ...
3
votes
1answer
138 views

Pitting two Blackjack bots against each other

I'm taking part in this Daily Challenge on http://www.reddit.com/r/dailyprogrammer/comments/29zut0/772014_challenge_170_easy_blackjack_checker/ Basically, you have to develop a program that runs two ...
3
votes
1answer
541 views

Optimizing a Tic-Tac-Toe AI

I built a Tic-Tac-Toe game in Python. The board is made of ASCII characters and it is the user versus an AI. The user chooses a number (1-9) and if the corresponding spot is open then either an 'X' or ...
4
votes
3answers
3k views

Evaluation function for Connect Four

Here is some code I have written as a connect four negamax evaluation function. The state of the board is stored inside a class state. ...
8
votes
1answer
2k views

2048 (game) solver 2.0

Follow-up of 2048 (game) solver I improved the script, using standard search methods like expectimax. Now it goes easily to 2048, but not really further, the difference with the highly efficient ...
6
votes
1answer
3k views

Minimax for Tic-Tac-Toe

I have written AI for Tic-Tac-Toe using Negamax in JavaScript. The Negamax object is translated from an implementation written in Python. The code runs on a Node.js server and the player interacts ...
15
votes
2answers
3k views

2048 (game) solver

The code contains an AI function, that searches breadth-first all possible moves and get the score of their grids, a depth of 6 is used which makes at most \$4+4^2+...+4^6\$ computed grids. The ...
10
votes
4answers
2k views

TicTacToe AI needs optimization

How do I condense this gigantic monster into something more manageable? I heard about command pattern but I can't figure out how to use it. What other solutions are there? ...
17
votes
3answers
3k views

Who is this Chatbot?

Based off the coding puzzle: Who is this chatbot? The code's purpose is to create an AI that the user can communicate with. Due to there being no hard-coded strings, the AI learns from what the user ...
8
votes
1answer
214 views

Brute Force (and not) Bejeweled AI

My approach to solving the problem of selecting the best match on a bejeweled board is a fully object oriented approach. Some of the other relevant code can be found in my previous questions ...
5
votes
3answers
1k views

Does this Tic-Tac-Toe game follow abstraction and encapsulation?

This below program will be further enhanced for TicTacToe game with Human and Computer as players. Currently this program is written for choosing best move for a ...
6
votes
1answer
512 views

JavaScript/Angular TicTacToe Minimax AI

I am interested in getting some feedback on the code for my TicTacToe game, implemented with AngularJS, particularly with respect to the AI logic, which is printed below. (The full code base is ...
2
votes
3answers
1k views

Pong game with AI

I have written a pong game in C++ using SDL2.0 for the graphics. I have a couple of questions regarding this code: How can I make the AI better, in such a way that it is actually dumber? Right now, ...
3
votes
1answer
926 views

Improving AI for a Connect 3 game

I am attempting to complete an assignment, which is basically Connect 3, instead of the classic Connect 4 game. The AI I am using is the exact same as the opponent, but the opponent wins more because ...
6
votes
2answers
6k views

Enemy patrol script using NavMeshAgent

I'm piecing together an Enemy script to attach to my characters. This is the portion that related the a game objects ability to patrol to given locations. Basically,...
8
votes
3answers
17k views

“Ella” Java chatbot

I recently developed an interest in AI and thought I would develop this little chat bot. Are there any recommendations/modifications? ...
24
votes
2answers
636 views

Where equations are born and mutants are buried

I've read up on genetic programming yesterday so I figured I'd try to implement something myself. I would like the main focus to be on whether or not I've implemented the idea behind it correctly. ...
3
votes
1answer
321 views

Neural Network in Julia

I am currently trying to implement a Neural Net in Julia with the goal of eventually implementing a stacked autoencoder. My code seems to work but I would appreciate any constructive criticism. If ...