Skip to content

Python implementation of Einstein's Riddle with an interactive menu, attribute-based puzzle solving, and pre-order traversal for solution tree generation.

Notifications You must be signed in to change notification settings

fili5rovic/Einstein-Riddle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Einstein's Riddle

Description

Einstein's Riddle involves solving a puzzle by assigning attributes to different categories using a specific set of rules. The solution to the puzzle is obtained through the implementation of various functions and algorithms.

This project was developed as the second university assignment for "Algorithms and Data Structures", University of Belgrade School of Electrical Engineering, majoring Software Engineering. Please refer to the instructions.pdf file provided for detailed instructions regarding the assignment.

I really enjoyed working on this project because it gave me a chance to explore different ways of navigating through trees using code. My assignment was all about implementing the pre-order tree traversal, and it turned out to be a great learning experience that helped me grasp this important concept in a practical way.

Features

The project includes the following features:

  • Interactive Menu: The project offers an interactive menu that allows users to play the puzzle, display the solution tree, check the correctness of their solutions, and receive hints.

  • Puzzle Solving Algorithm: The core of the project lies in the puzzle-solving algorithm implemented in the main.py file. This algorithm manages the assignment of attributes to categories while adhering to predefined rules.

  • Solution Tree Visualization: The project generates and displays a solution tree that illustrates the different possible combinations of attributes and categories. The solution tree is saved in the stablo.txt file.

  • Attribute Manipulation: Users can interactively add attributes to categories using the format "category + attribute". The algorithm validates and updates the assignments accordingly.

  • Correctness Check: The algorithm checks the correctness of user assignments and provides feedback on whether the solutions are accurate.

Project Structure

The project consists of the following main components:

  • main.py: This file contains the core implementation of the puzzle-solving algorithm. It includes functions for adding, removing, and manipulating attributes within categories.

  • stablo.txt: This file stores the output of the puzzle-solving algorithm, showcasing the tree structure and possible solutions.

How to Run

To run the project, follow these steps:

  1. Make sure you have Python [version] or later installed on your machine.
  2. Open a terminal or command prompt.
  3. Navigate to the project directory using the cd command.
  4. Run the project using the following command: python main.py

Dependencies

The project does not have any external dependencies and should run using a standard Python installation.

About

Python implementation of Einstein's Riddle with an interactive menu, attribute-based puzzle solving, and pre-order traversal for solution tree generation.

Topics

Resources

Stars

Watchers

Forks

Languages