Skip to content

Latest commit

 

History

History
191 lines (133 loc) · 6.35 KB

README.md

File metadata and controls

191 lines (133 loc) · 6.35 KB

AP course project

Stars License


MasterMind Game🎲

A "Mastermind" game designed with PyQt5 (Qt+Python)
Explore the documents »


Table of Contents
  1. About The Project
  2. Parts
  3. Results
  4. License
  5. Refenences
  6. Contact
  7. Roadmap

About The Project

Mastermind is a code-breaking game in which two players compete against each other. The game begins when the first participant, dubbed "The Codemaker", generates a four-digit (color) code that is hidden. The second participant, dubbed "The Codebreaker" then guesses a code.

The codemaker then evaluates the estimate by handing certain black and white pins to the codebreaker (plus and minus in the paper version). The codebreaker guesses another code based on the evaluation, and the game continues until the codebreaker finds (or fails to locate) the concealed code within the maximum number of tries.

(back to top)

Built With

Major frameworks/libraries used in this project:

(back to top)

Parts

1. Master Mind Class

The main MasterMind game Process; it contains:

  • get_random_solution(): Returns a random "solution" to be the hidden code.
  • check_guess(): Returns the nb of "correct" and nb of "misplaced" guess.
  • get_correct_colors(): Returns the "correct" colors.
  • get_misplaced_colors(): Returns the "misplaced" colors.
  • is_won(): Verify that the guess is correct according to the solution.

2. MainWindowUi Class (GUI_Window)

The main window of the game designed by Qt; it contains:

  • setupUi(): The QT codes that generate the main window.
  • resetButtonClicked(): That delete the selected colors.
  • set_thisguesstable(): connect the colors.
  • clicked_color(): Send the selected colors to the Guess table.
  • clicked_submit(): After clicking the submit button; its check the guess and return the score to the Scores Table.
  • show_game_over(): Show the Game Over Dialog. -print_score(): print score in the terminal (NOT GUI).

3. GameOverWindow Class (GUI_Window)

The resulting window, which shows the player's loss(+) or victory(-).

  • display_text(): Return a text with include the result of the game.(Win/Loss)

4. Splash Screen Class (GUI_Windows)

{⌛}

(back to top)

Results

GUI OUTPUT:

ScreenShoot Preview 🖼️


TERMINAL OUTPUT:

ScreenShoot Preview 🖼️

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Refenences

🔎

(back to top)

Contacts

Rabih ND - @RabihND

Hasan Sanei - @hasansanei

Project Link: https://github.com/RabihND/AP2021-2022-Final

(back to top)

Roadmap

  • Write the main code-map.
  • Design the GUI window.
  • Write the MasterMain Core Functions.
  • Design the GameOver window.
  • Build the .EXE Release
  • Splash screen
  • Build APK release.

(back to top)


Amirkabir University of Technology

(Tehran Polytechnic)