0% found this document useful (0 votes)
14 views17 pages

Maze game from python , Python games, He

The document presents a project report for a Python-based maze game titled 'MAZE' developed by students of B.M.S College of Engineering as part of their Aerospace Engineering curriculum. The game involves navigating a quantum particle through obstacles in a maze, incorporating elements of quantum mechanics, and is designed to enhance decision-making and problem-solving skills. The report includes details on hardware and software requirements, game design, source code, and the results of gameplay.

Uploaded by

Mohammed Zubair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views17 pages

Maze game from python , Python games, He

The document presents a project report for a Python-based maze game titled 'MAZE' developed by students of B.M.S College of Engineering as part of their Aerospace Engineering curriculum. The game involves navigating a quantum particle through obstacles in a maze, incorporating elements of quantum mechanics, and is designed to enhance decision-making and problem-solving skills. The report includes details on hardware and software requirements, game design, source code, and the results of gameplay.

Uploaded by

Mohammed Zubair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
You are on page 1/ 17

B.M.

S COLLEGE OF ENGINEERING
BENGALURU
Autonomous Institute, Affiliated to VTU

PYTHON AAT
Report on
MAZE
Submitted in partial fulfillment of the
requirements for AAT
Bachelor of Engineering in
Aerospace Engineering
Submitted by:

Praneeth Mahantesh M

Mohammed Zubair

Jayalekshmi DB

Anika Palasamudram

Department of Computer Science and


Engineering
B.M.S College of Engineering
Bull Temple Road,
Basavanagudi,
Bangalore 560 019
2024-2025
B.M.S COLLEGE OF ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE AND
ENGINEERING

DECLARATION
Anika , Praneeth, Zubair, Jaya student of 1st Semester, B.E,
Department of Aerospace, BMS College of Engineering,
Bangalore, hereby declare that, this AAT Project entitled "MAZE"
has been carried out in Department of CSE, BMS College of
Engineering, Bangalore during the academic semester Mar 2025
– Jul 2025. We also declare that to the best of our knowledge
and belief, the AAT Project report is not from part of any other
report by any other students.

Student
Student Name
Signature
1. Praneeth Mahantesh M
2. Mohammed Zubair
3. Jayalekshmi DB
4. Anika Palasamudram
BMS COLLEGE OF ENGINEERING
DEPARTMENT OF COMPUTER
SCIENCE AND ENGINEERING

CERTIFICATE
This is to certify that the AAT Project titled “MAZE” has been
carried out by PRANEETH MAHANTESH M (1BM24AS038)
MOHAMMED ZUBAIR(1BM24AS034) JAYALEKSHMI DB
(1BM24AS023) ANIKA PALASAMUDRAM (1BM24AS007)during
the academic year 2024-2025.

Signature of the Faculty in


Charge - SNEHA P
Table of
Contents
1.
INTRODUCTIO
N
This project, titled Maze(Quantum Leap) , presents a Python-
based game set within a quantum-themed maze . The objective
is to navigate a quantum particle (P) through various obstacles
and reach the Goal (G).The game includes quantum mechanics
inspired elements such as Wormholes (W), Quantum Flux (Q),
and Entanglement (E).This game helps players to explore
decision making and visualize basic maze/puzzle solving skills.
2. HARDWARE AND SOFTWARE
REQUIREMENT

Hardware Requirements:
A personal computer or laptop
Minimum 2 GB RAM
At least 1 GHz processor
Software Requirements:
Python 3.x
Python IDLE
Command-line interface or terminal for user input/output
3.
DESIGN
MAZE CODE:
["#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"],
["#", " ", "W", " ", "#", " ", " ", "Q", " ", " ", " ", "G", "#"],
["#", " ", "#", " ", "#", " ", "#", "#", "#", "#", " ", "#", "#"],
["#", " ", "#", " ", " ", " ", " ", " ", " ", "#", " ", " ", "#"],
["#", " ", "#", "#", "#", "#", "#", "#", " ", "#", "#", " ", "#"],
["#", "E", " ", " ", " ", " ", " ", "#", " ", " ", "#", " ", "#"],
["#", "#", "#", "#", "#", "#", " ", "#", "#", " ", "#", " ", "#"],
["#", " ", " ", " ", " ", "#", " ", " ", "#", " ", "#", " ", "#"],
["#", " ", "#", "#", " ", "#", "#", " ", "#", " ", "#", " ", "#"],
["#", " ", " ", "#", " ", " ", " ", " ", " ", " ", " ", " ", "#"],
["#", "#", " ", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"]

MAZE DISPLAY:

The game design centers on a


two dimensional matrix realm
representing the maze. Each
element in the matrix
corresponds to a unique
obstacle.
“ # “ : Wall
“ “ : Empty Space
“ W “ : Wormhole
“ Q “ : Quantum Flux
“ E “ : Entanglement

The particle starts at position [1,1], and the game loop


continuous the user for directional movement (UP, DOWN,
LEFT, RIGHT). The player's decisions determine navigation,
influenced by the presence of obstacles.
4. SOURCE
CODE
realm = [
["#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"],
["#", " ", "W", " ", "#", " ", " ", "Q", " ", " ", " ", "G", "#"],
["#", " ", "#", " ", "#", " ", "#", "#", "#", "#", " ", "#", "#"],
["#", " ", "#", " ", " ", " ", " ", " ", " ", "#", " ", " ", "#"],
["#", " ", "#", "#", "#", "#", "#", "#", " ", "#", "#", " ", "#"],
["#", "E", " ", " ", " ", " ", " ", "#", " ", " ", "#", " ", "#"],
["#", "#", "#", "#", "#", "#", " ", "#", "#", " ", "#", " ", "#"],
["#", " ", " ", " ", " ", "#", " ", " ", "#", " ", "#", " ", "#"],
["#", " ", "#", "#", " ", "#", "#", " ", "#", " ", "#", " ", "#"],
["#", " ", " ", "#", " ", " ", " ", " ", " ", " ", " ", " ", "#"],
["#", "#", " ", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"]
]
particle_position = [1, 1]
score = 0
probability = 0.5
print("Welcome to Quantum Leap!")
print("Navigate the particle P through the quantum maze to
reach the GOAL G.")
print("Obstacles: W=Wormhole, Q=Quantum Flux,
E=Entanglement")
print("Walls # block your path.\n")
while True:
for r in range(len(realm)):
row_display = ""
for c in range(len(realm[r])):
if [r, c] == particle_position:
row_display += "P "
else:
cell = realm[r][c]
if cell == " ":
row_display += ". "
else:
row_display += cell + " "
print(row_display)
print("Probability: {:.2f} | Score: {}".format(probability, score))
move = input("Move (UP, DOWN, LEFT, RIGHT) or QUIT:
").strip().upper()
if move == "QUIT":
print("Game exited. Final score:", score)
break
new_row = particle_position[0]
new_col = particle_position[1]
if move == "UP":
new_row -= 1
elif move == "DOWN":
new_row += 1
elif move == "LEFT":
new_col -= 1
elif move == "RIGHT":
new_col += 1
else:
print("Invalid move. Move UP, DOWN, LEFT, RIGHT or QUIT.\n")
continue
if new_row < 0 or new_row >= len(realm) or new_col < 0 or
new_col >= len(realm[0]):
print("You can't move outside the realm\n")
continue
if realm[new_row][new_col] == "#":
print("There's a wall blocking your way\n")
continue
particle_position = [new_row, new_col]
cell = realm[new_row][new_col]
if cell == "W":
print("You entered a Wormhole. Teleporting to start position.")
particle_position = [1, 1]
score += 10
elif cell == "Q":
print("Quantum Flux alters your probability")
probability += 0.1
if probability > 1.0:
probability = 1.0
score += 20
elif cell == "E":
print("Entanglement doubles your score")
score = score * 2 if score > 0 else 10
elif cell == "G":
print("Congratulations, You reached the GOAL")
print("Final score:", score)
break
else:
print("Moved safely.\n")
5.
RESULTS

Player can reach the goal through trial, error, and understanding of
the maze.
REFERENC
ES

Nvidia
Google Python Class
W3Schools online web tutorials
Realpython.com
The provided Python code implements a simple text-based maze
game called "Quantum Leap," where the player controls a particle
"P" navigating through a grid-based quantum realm to reach a goal
"G." The game features obstacles and special cells that affect the
player's score and probability. Here's a detailed explanation of the
code:

Code:
particle_position = [1, 1]
score = 0
probability = 0.5
particle_position holds the current row and column of the
particle, initially at position (1,1).
score tracks the player's score.
probability is a floating-point number starting at 0.5,
representing a quantum probability factor that can be
modified during the game.
Main game loop
Code:
while True:
for r in range(len(realm)):
row_display = ""
for c in range(len(realm[r])):
if [r, c] == particle_position:
row_display += "P "
else:
cell = realm[r][c]
if cell == " ":
row_display += ". "
else:
row_display += cell + " "
print(row_display)

The game runs indefinitely until the player quits or reaches


the goal.
It prints the maze each turn:
The particle's current position is shown as P.
Empty spaces are shown as dots . for clarity.
Other cells show their respective symbols.
Status Display and Player Input
Code:
print("Probability: {:.2f} | Score: {}".format(probability, score))
move = input("Move (UP, DOWN, LEFT, RIGHT) or QUIT:
").strip().upper()
Displays the current probability and score.
Prompts the player to enter a move command or quit.
Quit Condition
Code:
if move == "QUIT":
print("Game exited. Final score:", score)
break
If the player types "QUIT," the game ends and displays the final score.
Calculate New Position Based on Move
Code:
new_row = particle_position[0]
new_col = particle_position[1]
if move == "UP":
new_row -= 1
elif move == "DOWN":
new_row += 1
elif move == "LEFT":
new_col -= 1
elif move == "RIGHT":
new_col += 1
else:
print("Invalid move. Move UP, DOWN, LEFT, RIGHT or QUIT.\
n")
continue
Updates the new position coordinates depending on the move
command.
If the input is invalid, it prints an error and restarts the loop.
Boundary and Wall Checks
Code:
if new_row < 0 or new_row >= len(realm) or new_col < 0 or
new_col >= len(realm[0]):
print("You can't move outside the realm\n")
continue
if realm[new_row][new_col] == "#":
print("There's a wall blocking your way\n")
continue
Prevents moving outside the maze boundaries.
Prevents moving into a wall cell.
Update Particle Position
Code:
particle_position = [new_row, new_col]
cell = realm[new_row][new_col]
Updates the particle's position to the new valid location.
Retrieves the cell type at the new position.
Cell Effects
Code:
if cell == "W":
print("You entered a Wormhole. Teleporting to start position.")
particle_position = [1, 1]
score += 10
elif cell == "Q":
print("Quantum Flux alters your probability")
probability += 0.1
if probability > 1.0:
probability = 1.0
score += 20
elif cell == "E":
print("Entanglement doubles your score")
score = score * 2 if score > 0 else 10
elif cell == "G":
print("Congratulations, You reached the GOAL")
print("Final score:", score)
break
else:
print("Moved safely.\n")
The game reacts differently depending on the cell entered

You might also like