Skip to content

The objective of this project is to develop multiple variations of AI algorithms that outperform random guessing and analyze their relative performance against each other. (This is a collaborative, final project for the “Intro to Artificial Intelligence” class at the University of South Florida).

Notifications You must be signed in to change notification settings

aagarwal32/Battleship-AI-Benchmarking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Battleship AI Benchmarking (Quick Overview)

This project is based on the popular game, Battleship. Players call out coordinates to hit or miss a part of a ship. The first player to sink all their opponent’s ships wins.

A mid-game position for Battleship is displayed below. (Please note that the opponent’s board is at the top, where their ships are not visible, and the player’s board is at the bottom, where their ships are shown. You can check your Hits (H) or Misses (M) on the opponent’s board.)

This script allows you to play the game against an AI opponent or simulate any number of games (AI vs AI). The AI algorithms implemented are as follows:
  • Greedy algorithm
  • Minimax algorithm with alpha-beta pruning
  • Custom Probability (custom made heuristic-based algorithm for Battleship)

For an AI algorithm to demonstrate any signs of intelligence while playing, it must consistently outperform random guessing. Consequently, all benchmarking results are based on comparing the AI opponent against random guessing. The table below presents the results:

battleship_ai_benchmark_results

Collaborators

Arjun Agarwal, Patrick Shugerts, Anxhelo Kambo, Alan Morcus

How to Play/Simulate:

  1. Install Python (If you don't already have it) then download the battleship.py file.
  2. Comment or Uncomment "play_games()" or "simulate_multiple_games()" functions to switch between play or simulate, respectively. These functions are found at the end of the file.
  3. Type and enter python battleship.py in a terminal to run the script!

########################################################

About

The objective of this project is to develop multiple variations of AI algorithms that outperform random guessing and analyze their relative performance against each other. (This is a collaborative, final project for the “Intro to Artificial Intelligence” class at the University of South Florida).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages