Skip to content

Implementing Connect4 Game in python with two versions: Version 1 using 2 players and Version 2 is to switch bewteen two modes ( mode 1 to play against AI player, and mode 2 to have to human players)

Notifications You must be signed in to change notification settings

moon-2000/Connect_4_Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Connect 4 Versions

The game has two versions

  • version 1: two human players play against each other
  • version 2: human player plays against AI

The AI version is implemented with two versions

  • version 1: AI chooses a random place to put its piece
  • version 2: AI put its piece after applying MINIMAX algorithm

How to play the Connect4 game

1 - activate the virtual environment first

  cd pygame_connect4 
  Scripts/activate
  cd .. 
  cd Connect4

2 - choose the playing version

  - To play the game with both versions and switch between them by pressing key C
    py main.py

  - To run connect 4 with 2-human players version ONLY 
    py 2_players_version.py

  - To run connect 4 with AI version ONLY
    py AI_vs_human_version.py

3 - to use keys correctly

   C  to change the game mode from "player vs player" to "player vs AI" and vice versa
   L  to change AI_level from "minimax algorithm" to "random choice"
   R  to restart the game 

Resources for the game code

Connect4 Game

About

Implementing Connect4 Game in python with two versions: Version 1 using 2 players and Version 2 is to switch bewteen two modes ( mode 1 to play against AI player, and mode 2 to have to human players)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages