Coder Social home page Coder Social logo

cpsc-481-ai's Introduction

CPSC 481 Artificial Intelligence Project

Group Members:

  1. Name: Kelsey Dang  Email: [email protected]
  2. Name: Jayson Doty  Email: [email protected]
  3. Name: Steven Liu   Email: [email protected]
  4. Name: Kelly Kuoch  Email: [email protected]

Layout of Code

How the Code is Structured (High Level Overview)

  1. Constant Declarations
  2. Functions
    • ...
    • Scoring System
    • Basic AI
    • Minimax
    • Minimax w/ Alpha-Beta
    • ...
  3. Main
    • GUI

Description of Code Structure

How to Execute and Interact with Program

Setup

  1. Install the following Python libraries:
    • import numpy as np
    • import pygame
    • import sys
    • import math
    • import random
  2. Navigate to the project folder

Program Execution

  1. To execute the program, run the following command in the terminal:
python connect4-ai.py
  1. Select one of the four options by typing the corresponding number (1-4):
        --- GAME MENU ---

1. Basic AI (R) vs Alpha-Beta (Y)

2. Minimax (R) vs Alpha-Beta (Y)

3. Alpha-Beta (R) vs Alpha-Beta (Y)

4. Player (R) vs Alpha-Beta (Y)

Select an option (1-4): 
  1. The Pygame window should open up. If the window is running in the background, simply click on the Pygame window from your computer desktop taskbar to bring it forward.

Interaction

The 4 options:

  • Option 1: Basic AI (Red) vs Alpha-Beta (Yellow)
    • User simply spectates the basic AI (non-Minimax) play against Minimax w/ Alpha-Beta
  • Option 2: Minimax (Red) vs Alpha-Beta (Yellow)
    • User simply spectates the Minimax algorithm play against Minimax w/ Alpha-Beta
  • Option 3: Alpha-Beta (Red) vs Alpha-Beta (Yellow)
    • User simply spectates Minimax w/ Alpha-Beta play against itself
  • Option 4: Player (Red) vs Alpha-Beta (Yellow)
    • User plays against Minimax w/ Alpha-Beta

What Does Each File/Folder Do

experiment folder

The experiment folder contains any files that can be used for experimenting or testing the code.

  • function.py
    • Ignore this file, it does not contribute to the final code
  • test.py
    • File to test and experiment with the Connect Four game from the YouTube tutorial by Keith Galli
  • test2.py
    • File to test and experiment with the Connect Four code from codeNewb204's Github repository

project folder

The project folder contains the source code of our Connect Four AI.

  • connect4.py
    • Starting code of the Connect Four game followed by a YouTube tutorial by Keith Galli
  • connect4-terminal.py
    • Starting code of terminal Connect Four from codeNewb204's Github repository, ignore this file since it does not contribute to the final code
  • connect4-ai.py
    • The final source code that we worked on, contains modified minimax alpha-beta implementation from the YouTube tutorial by Keith Galli

References

  1. YouTube Connect 4 /w Minimax Tutorial: https://www.youtube.com/watch?v=MMLtza3CZFM&t=2810s
  2. YouTube Connect Four with Minimax Alpha-Beta Pruning Code Github Repository (Starting Code): https://github.com/KeithGalli/Connect4-Python/blob/master/connect4_with_ai.py
  3. Existing Terminal Connect Four Code Github Repository: https://github.com/codeNewb204/Terminal-Game/blob/main/Connect4.py

cpsc-481-ai's People

Contributors

kelseydang2002 avatar sttvbn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.