Skip to content

Suraj7972/Maze-Game-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Maze-Game-Python

This is a python code in which we can play maze game and it will also track the movement Title: Maze Game with Maximum Expected Utility (MEU)

Description: This Python script implements a simple maze game where the player navigates a 2D grid-based maze from a starting position to a goal position. The game incorporates the concept of Maximum Expected Utility (MEU) to guide the player's decisions.

Key Features:

Maze Generation: A predefined maze is used, but the code can be extended to generate random mazes. Player Movement: The player can move up, down, left, or right within the maze. Goal State: A specific cell in the maze is designated as the goal. Utility Function: The utility function assigns values to each cell in the maze, representing the expected reward or penalty for reaching that cell. The goal cell has a high positive utility, while obstacles have negative utilities. MEU-Based Decision Making: The player's movement is not random. Instead, the script calculates the expected utility of each possible move and chooses the move with the highest utility. This simulates a rational agent making decisions based on the expected outcomes. How to Run:

Install Required Libraries: Ensure you have the pygame library installed. You can install it using pip:

Bash pip install pygame Use code with caution.

Run the Script: Save the code as a Python file (e.g., maze_game.py) and execute it from your terminal:

Bash python maze_game.py Use code with caution.

Play the Game: Use the arrow keys to move the player within the maze. The goal is to reach the red square.

Potential Enhancements:

Dynamic Maze Generation: Implement algorithms to generate random mazes of varying complexity. Advanced Utility Functions: Explore more sophisticated utility functions that consider factors like distance to the goal, obstacles, and potential rewards/penalties. Learning-Based Agents: Integrate machine learning techniques to train an agent to learn optimal strategies for navigating the maze. Visualization: Visualize the utility values on the maze to help understand the agent's decision-making process. This project provides a basic implementation of a maze game with MEU-based decision making. It can be further extended and customized to create more complex and challenging scenarios.

About

This is a python code in which we can play maze game and it will also track the movement

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages