Skip to content

Latest commit

 

History

History
 
 

Codebreaker Game with AI

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Codebreaker Game with AI

Welcome to the Codebreaker Game with AI! This game allows you to challenge the computer's AI to crack a secret code that you create. You can also try to crack the AI's secret code.

How to Play

  1. Run the script using Python.
  2. The game will prompt you to input a secret code, which consists of a sequence of numbers between 1 and 6.
  3. The AI will then attempt to guess your secret code using logical deduction.
  4. The AI will provide feedback on each of its guesses.
  5. You will also have the chance to guess the AI's secret code by providing your own guesses and receiving feedback.
  6. The game ends when either you or the AI correctly guess the secret code or when the maximum number of attempts is reached.

Features

  • Player Interaction: You can enter your secret code and guess the AI's code.
  • AI Logic: The AI uses a brute-force algorithm to deduce the code.
  • Valid Input Handling: The game validates input to ensure correct format and range.
  • Limited Attempts: Both you and the AI have a limited number of attempts to crack the code.
  • Outcome Display: The game displays the outcome when the code is cracked or the game ends.

Prerequisites

  • Python

How to Run

  1. Open a terminal or command prompt.
  2. Navigate to the directory containing the script.
  3. Run the script using the following command:
python codebreaker_game.py

Customize

Feel free to modify the code and add your own features to enhance the game further!