ITECH7201: Maze Game Report - Software Engineering Lab Analysis
VerifiedAdded on 2022/11/15
|14
|2393
|198
Report
AI Summary
This report provides a detailed analysis of a Maze Game developed as part of a software engineering assignment. It explores various aspects of the game, including its background, functionalities, and the implementation of key software engineering concepts. The report discusses the Command Patt...

Software Engineering
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Table of Contents
Game Background...........................................................................................................................2
Functionalities Discussed in Lab 8..................................................................................................3
Look Command............................................................................................................................4
Hand drawn Map.............................................................................................................................5
Item management.............................................................................................................................7
Sequence diagram..........................................................................................................................10
Contribution...................................................................................................................................11
Reference.......................................................................................................................................12
1
Game Background...........................................................................................................................2
Functionalities Discussed in Lab 8..................................................................................................3
Look Command............................................................................................................................4
Hand drawn Map.............................................................................................................................5
Item management.............................................................................................................................7
Sequence diagram..........................................................................................................................10
Contribution...................................................................................................................................11
Reference.......................................................................................................................................12
1

Game Background
The ancient mythology tells us about the Greek hero Theseus who was tasked by king
Minos of Crete to kill the half man half bull beast Minotaur who was living in a maze done by
Daedalus. Gaining the heart of king’s daughter Ariadne, Theseus received from her a ball of
thread so he can find the way out of the Maze after killing the beast. In our exercise we’ll try to
help a turtle dropped in the middle of the maze to find its way out (Alhroob & Yousef, 2014). In
the absence of a thread to lead the turtle out we’ll try to make the exercise a bit easier, so we’ll
split our maze into squares. Each such square will be either open or will have a wall. Our turtle
moving in the maze, when reaching a wall needs to stop and try different direction. The
challenge will be to find a consistent method to teach the turtle to find its way out, so we’ll do
like this:
If moving north the turtle will reach a wall then we turn around and move south and
repeat the procedure as many times as needed. The square we are currently in will
become now the initial square
If by moving South we’ll find again a wall (remember there’s already a wall on the
North) we’ll move West and repeat the procedure as needed.
If by moving West we’ll find again a wall means the only option left Is to move
towards East and repeat this procedure as needed
We can conclude that our maze has no way out and we fail our exercise if on the
forth try we find again a wall.
Though seems pretty easy and forward what we have to do that may be a flaw in our
procedure. Let’s presume we move north and find no wall in our way so we continue recursively
with our procedure and move till we find our first wall. At this stage as per our procedure, we
stop and move south. Unfortunately, by doing this we go back from where we came, right?
Means we reached a loop and cannot find our way out of the maze. We have to re-think and
improve our strategy by adding a bread crumb trail. Each time we take a step forward we drop a
crumb. When reaching the wall and moving to the next step in our procedure, if we find a bread
crumb means we’ve been there before and potentially we are facing a loop. So we should
2
The ancient mythology tells us about the Greek hero Theseus who was tasked by king
Minos of Crete to kill the half man half bull beast Minotaur who was living in a maze done by
Daedalus. Gaining the heart of king’s daughter Ariadne, Theseus received from her a ball of
thread so he can find the way out of the Maze after killing the beast. In our exercise we’ll try to
help a turtle dropped in the middle of the maze to find its way out (Alhroob & Yousef, 2014). In
the absence of a thread to lead the turtle out we’ll try to make the exercise a bit easier, so we’ll
split our maze into squares. Each such square will be either open or will have a wall. Our turtle
moving in the maze, when reaching a wall needs to stop and try different direction. The
challenge will be to find a consistent method to teach the turtle to find its way out, so we’ll do
like this:
If moving north the turtle will reach a wall then we turn around and move south and
repeat the procedure as many times as needed. The square we are currently in will
become now the initial square
If by moving South we’ll find again a wall (remember there’s already a wall on the
North) we’ll move West and repeat the procedure as needed.
If by moving West we’ll find again a wall means the only option left Is to move
towards East and repeat this procedure as needed
We can conclude that our maze has no way out and we fail our exercise if on the
forth try we find again a wall.
Though seems pretty easy and forward what we have to do that may be a flaw in our
procedure. Let’s presume we move north and find no wall in our way so we continue recursively
with our procedure and move till we find our first wall. At this stage as per our procedure, we
stop and move south. Unfortunately, by doing this we go back from where we came, right?
Means we reached a loop and cannot find our way out of the maze. We have to re-think and
improve our strategy by adding a bread crumb trail. Each time we take a step forward we drop a
crumb. When reaching the wall and moving to the next step in our procedure, if we find a bread
crumb means we’ve been there before and potentially we are facing a loop. So we should
2
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

immediately stop and take the next step in the procedure (Butter, n.d.). Understanding our work
till now as a code algorithm, backing is similar to returning from a recursive process.
Reviewing what we did so far, similar to what is done when reviewing a recursive
algorithm, we are checking step by step and potentially identified 4 base scenarios for our turtle
to find the way out of the maze:
When turtle is reaching a wall, since the square is occupied no further investigation
will be done at this point
When reaching a square that was previously explored, we shall not proceed further
with our investigation as this may take us into a loop
When turtle reaches a square which was investigated in all four direction we have
come to a complete stop as there is no way out of the maze
Finally when we reach an outside square we completed the maze and our turtle is out
(Meiliana, Septian, Alianto, Daniel & Gaol, 2017).
Functionalities Discussed in Lab 8
Implementing the Command Pattern
The DungeonMaster category is starting to be terribly disorganized. Let’s begin by
specifying an abstract category to represent commands normally. Now we have to produce a
replacement interface referred to as Command. We may also need a CommandResponse
category to supply a response back to the player when every command has been processed. To
write down a command category for move and another for quit. Before we alter DungeonMaster,
let’s introduce an added category to stay on track of the obtainable commands. So it’s time to
create and introduce a new category referred to as CommandHandler to maintain a Hashtable for
every command category (Morelli, 2003).
1. We will create aliases for various commands (such as move and go inform to identical
command).
3
till now as a code algorithm, backing is similar to returning from a recursive process.
Reviewing what we did so far, similar to what is done when reviewing a recursive
algorithm, we are checking step by step and potentially identified 4 base scenarios for our turtle
to find the way out of the maze:
When turtle is reaching a wall, since the square is occupied no further investigation
will be done at this point
When reaching a square that was previously explored, we shall not proceed further
with our investigation as this may take us into a loop
When turtle reaches a square which was investigated in all four direction we have
come to a complete stop as there is no way out of the maze
Finally when we reach an outside square we completed the maze and our turtle is out
(Meiliana, Septian, Alianto, Daniel & Gaol, 2017).
Functionalities Discussed in Lab 8
Implementing the Command Pattern
The DungeonMaster category is starting to be terribly disorganized. Let’s begin by
specifying an abstract category to represent commands normally. Now we have to produce a
replacement interface referred to as Command. We may also need a CommandResponse
category to supply a response back to the player when every command has been processed. To
write down a command category for move and another for quit. Before we alter DungeonMaster,
let’s introduce an added category to stay on track of the obtainable commands. So it’s time to
create and introduce a new category referred to as CommandHandler to maintain a Hashtable for
every command category (Morelli, 2003).
1. We will create aliases for various commands (such as move and go inform to identical
command).
3
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

2. When we need to develop new command categories we merely outline the category and
add it to the hashtable with a label and it works.
A problem happens once we have invoked the move command with no arguments and
our arguments ArrayList in ParsedInput is empty. We can fix this simply by coding defensively
the MoveCommand. We still need information extracted from the game after I change locations.
Therefore, I’m planning to modify the way results are displayed. Let’s begin by developing a
ToString technique for Location (Nikiforova, Kozacenko & Ahilcenoka, 2013).
Look Command
Before we proceed to implementing the look command, we should decide how the
command should behave in the user story(s). Our initial RAD known three “look” stories
Look Item
Look Character
Look Location
I will consider a fourth as well: “look exit”. As we didn’t introduce yet non-playing
characters or things let’s look on the location and exit:
Look Location – the player launches the look command while not arguments are set and
therefore the system returns an outline of the present player location.
Look Exit – the player launches the look command specifying the arguments and if the
argument matches an exit an outline of the exit is produced.
Both of those user stories are connected and might be completed quickly by developing
the LookCommand. To make this work you would be forced to introduce a replacement
methodology in Location referred to as ContainsExit. (Oehlke, 2013)
4
add it to the hashtable with a label and it works.
A problem happens once we have invoked the move command with no arguments and
our arguments ArrayList in ParsedInput is empty. We can fix this simply by coding defensively
the MoveCommand. We still need information extracted from the game after I change locations.
Therefore, I’m planning to modify the way results are displayed. Let’s begin by developing a
ToString technique for Location (Nikiforova, Kozacenko & Ahilcenoka, 2013).
Look Command
Before we proceed to implementing the look command, we should decide how the
command should behave in the user story(s). Our initial RAD known three “look” stories
Look Item
Look Character
Look Location
I will consider a fourth as well: “look exit”. As we didn’t introduce yet non-playing
characters or things let’s look on the location and exit:
Look Location – the player launches the look command while not arguments are set and
therefore the system returns an outline of the present player location.
Look Exit – the player launches the look command specifying the arguments and if the
argument matches an exit an outline of the exit is produced.
Both of those user stories are connected and might be completed quickly by developing
the LookCommand. To make this work you would be forced to introduce a replacement
methodology in Location referred to as ContainsExit. (Oehlke, 2013)
4

Algorithms used in the development of Maze game
A rule that may be used once generating a maze is that the deep-first search. The method
is very basic and straightforward by employing a recursive method or stack. Deep First Traversal
(or Search) for a chart is like Depth First Traversal of a tree. It differs though from the traditional
trees, charts could contain cycles, thus we have a tendency to could move to an identical hub
another time. To abstain from handling a hub over once, we tend to utilize a Boolean visited
cluster. The fact investigation of DFS varies as per its application region. In theoretical software
package engineering, DFS is often used to cross an entire chart, and needs some serious energy
{\displaystyle O(|V|+|E|)} O(|V| + |E|),[4] direct within the span of the diagram. In these
applications it in addition uses space {\displaystyle O(|V|)} O(|V|) in the most case scenario to
store the stack of vertices of the already visited stack. Therefore, the time and space are similar
to for expansiveness first hunt and therefore the call of that of those two calculations to utilize
depends less on their unpredictability and additional on the assorted properties of the vertex
orderings the two calculations turn out. (Oehlke, 2013)
Fundamentally, you start from an irregular point and continue diving ways in which in
one amongst four headings (up, right, down, left) till you can't go any more. When you come to
the situation that you cannot continue anymore, you have to reevaluate the situation and find
open way to complete the task. You'd keep going from that moment on
Steps to follow
1. Produce a 2-dimensional array with odd row and column size
2. Generate odd numbers for row and column. Set that cell to zero. Use row and column
variables to stay track of current location.
3. Select a random direction (up, right, down, or left) you're moving to. You may have to
move by two cells. The image illustrates how this cell is moving down. Before you move
you have to check if you wish to test if two cells in the selected direction are outside the
maze (Podyachev, 2014).
5
A rule that may be used once generating a maze is that the deep-first search. The method
is very basic and straightforward by employing a recursive method or stack. Deep First Traversal
(or Search) for a chart is like Depth First Traversal of a tree. It differs though from the traditional
trees, charts could contain cycles, thus we have a tendency to could move to an identical hub
another time. To abstain from handling a hub over once, we tend to utilize a Boolean visited
cluster. The fact investigation of DFS varies as per its application region. In theoretical software
package engineering, DFS is often used to cross an entire chart, and needs some serious energy
{\displaystyle O(|V|+|E|)} O(|V| + |E|),[4] direct within the span of the diagram. In these
applications it in addition uses space {\displaystyle O(|V|)} O(|V|) in the most case scenario to
store the stack of vertices of the already visited stack. Therefore, the time and space are similar
to for expansiveness first hunt and therefore the call of that of those two calculations to utilize
depends less on their unpredictability and additional on the assorted properties of the vertex
orderings the two calculations turn out. (Oehlke, 2013)
Fundamentally, you start from an irregular point and continue diving ways in which in
one amongst four headings (up, right, down, left) till you can't go any more. When you come to
the situation that you cannot continue anymore, you have to reevaluate the situation and find
open way to complete the task. You'd keep going from that moment on
Steps to follow
1. Produce a 2-dimensional array with odd row and column size
2. Generate odd numbers for row and column. Set that cell to zero. Use row and column
variables to stay track of current location.
3. Select a random direction (up, right, down, or left) you're moving to. You may have to
move by two cells. The image illustrates how this cell is moving down. Before you move
you have to check if you wish to test if two cells in the selected direction are outside the
maze (Podyachev, 2014).
5
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Hand drawn Map
The above-given figure illustrates the map developed for the maze game. Here the
condition considered for the map creation is M>N. Where M stands for the number of locations.
And N stands for the number of shops (Tan, Teo, Chin & Anthony, 2013). Here the developed
map contains five locations and two shops. The shops are James bakery and AS supermarket.
The locations are pub, outside, office, starting and ending point. There four directions are used in
the maze game such as north, south, west, and east. (Stemkoski, n.d.)
6
The above-given figure illustrates the map developed for the maze game. Here the
condition considered for the map creation is M>N. Where M stands for the number of locations.
And N stands for the number of shops (Tan, Teo, Chin & Anthony, 2013). Here the developed
map contains five locations and two shops. The shops are James bakery and AS supermarket.
The locations are pub, outside, office, starting and ending point. There four directions are used in
the maze game such as north, south, west, and east. (Stemkoski, n.d.)
6
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

7

Item management
The above picture shows the item management class. It has the two arguments such as
item description and item name. Get function used to get the item description and get item name.
(WANG, WANG & LIU, 2009)
8
The above picture shows the item management class. It has the two arguments such as
item description and item name. Get function used to get the item description and get item name.
(WANG, WANG & LIU, 2009)
8
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

The above figure shows the purchase of the item. The function name is
getpurchaseItemString(). It displays the keys and item. (Yoo & Oh, 2017)
The above code shows the add purchase item. Once the item is purchased it display
we’ve already got one.
9
getpurchaseItemString(). It displays the keys and item. (Yoo & Oh, 2017)
The above code shows the add purchase item. Once the item is purchased it display
we’ve already got one.
9
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

The output shows the items name and purchase item. The get item sandwich is used to
purchase the sandwich. Now the purchased item displays the sand witch and bagel.
Class diagram for lab 8
The above figure shows the class diagram developed. Here the static overview of the
developed game is shown. This diagram generally used for the visualization process. It helps to
describe the features of the game or application. Also, it is useful for developing a software
application. Here the class “CommandHandler” has an association with the class
“DungeonMaster” and ‘Location”. Also “Location” and “DugeonMaster” has an association
between them. Each class has a different set of attributes. In general, attributes contain variables
and data types. (Ņikiforova, Putintsev & Ahiļčenoka, 2016)
10
purchase the sandwich. Now the purchased item displays the sand witch and bagel.
Class diagram for lab 8
The above figure shows the class diagram developed. Here the static overview of the
developed game is shown. This diagram generally used for the visualization process. It helps to
describe the features of the game or application. Also, it is useful for developing a software
application. Here the class “CommandHandler” has an association with the class
“DungeonMaster” and ‘Location”. Also “Location” and “DugeonMaster” has an association
between them. Each class has a different set of attributes. In general, attributes contain variables
and data types. (Ņikiforova, Putintsev & Ahiļčenoka, 2016)
10

Sequence diagram
11
11
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Contribution
Here I have done the code for lab 8 functionalities. Here I made different features based
on the user’s requirements. For example consider the features like help, weapon change,
pick up and drop the items and other collectibles are created by myself.
My friend completed functionalities of lab 8. Here he developed different functions like a
lock and unlock, start and quit the game, etc.
As a team, we created a map jointly. And the test process we carried out by me and my
friend.
12
Here I have done the code for lab 8 functionalities. Here I made different features based
on the user’s requirements. For example consider the features like help, weapon change,
pick up and drop the items and other collectibles are created by myself.
My friend completed functionalities of lab 8. Here he developed different functions like a
lock and unlock, start and quit the game, etc.
As a team, we created a map jointly. And the test process we carried out by me and my
friend.
12
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Reference
Alhroob, A., & Yousef, N. (2014). Transforming UML State Machine Diagram to High Level
Petri Net Using Genetic Algorithm. Lecture Notes On Software Engineering, 2(3), 243-246.
doi: 10.7763/lnse.2014.v2.130
Butter, A. Java.
Meiliana, Septian, I., Alianto, R., Daniel, & Gaol, F. (2017). Automated Test Case Generation
from UML Activity Diagram and Sequence Diagram using Depth First Search
Algorithm. Procedia Computer Science, 116, 629-637. doi: 10.1016/j.procs.2017.10.029
Morelli, R. (2003). Java, Java, Java!. Upper Saddle River, NJ: Prentice Hall.
Nikiforova, O., Kozacenko, L., & Ahilcenoka, D. (2013). UML Sequence Diagram:
Transformation from the Two-Hemisphere Model and Layout. Applied Computer
Systems, 14(1), 31-41. doi: 10.2478/acss-2013-0004
Ņikiforova, O., Putintsev, S., & Ahiļčenoka, D. (2016). Analysis of Sequence Diagram Layout in
Advanced UML Modelling Tools. Applied Computer Systems, 19(1), 37-43. doi:
10.1515/acss-2016-0005
Oehlke, A. (2013). Learning Libgdx Game Development. Packt Publishing.
Podyachev. (2014). UML diagram based TTCN tests implementing. SPIIRAS Proceedings, 0(4),
155. doi: 10.15622/sp.4.10
Stemkoski, L. Java game development with LibGDX.
Tan, T., Teo, J., Chin, K., & Anthony, P. (2013). Pareto Ensembles for Evolutionary Synthesis of
Neurocontrollers in a 2D Maze-Based Video Game. Applied Mechanics And
Materials, 284-287, 3173-3177. doi: 10.4028/www.scientific.net/amm.284-287.3173
WANG, X., WANG, H., & LIU, C. (2009). Automatic Hierarchical Layout Algorithm for UML
Class Diagram. Journal Of Software, 20(6), 1487-1498. doi: 10.3724/sp.j.1001.2009.03417
13
Alhroob, A., & Yousef, N. (2014). Transforming UML State Machine Diagram to High Level
Petri Net Using Genetic Algorithm. Lecture Notes On Software Engineering, 2(3), 243-246.
doi: 10.7763/lnse.2014.v2.130
Butter, A. Java.
Meiliana, Septian, I., Alianto, R., Daniel, & Gaol, F. (2017). Automated Test Case Generation
from UML Activity Diagram and Sequence Diagram using Depth First Search
Algorithm. Procedia Computer Science, 116, 629-637. doi: 10.1016/j.procs.2017.10.029
Morelli, R. (2003). Java, Java, Java!. Upper Saddle River, NJ: Prentice Hall.
Nikiforova, O., Kozacenko, L., & Ahilcenoka, D. (2013). UML Sequence Diagram:
Transformation from the Two-Hemisphere Model and Layout. Applied Computer
Systems, 14(1), 31-41. doi: 10.2478/acss-2013-0004
Ņikiforova, O., Putintsev, S., & Ahiļčenoka, D. (2016). Analysis of Sequence Diagram Layout in
Advanced UML Modelling Tools. Applied Computer Systems, 19(1), 37-43. doi:
10.1515/acss-2016-0005
Oehlke, A. (2013). Learning Libgdx Game Development. Packt Publishing.
Podyachev. (2014). UML diagram based TTCN tests implementing. SPIIRAS Proceedings, 0(4),
155. doi: 10.15622/sp.4.10
Stemkoski, L. Java game development with LibGDX.
Tan, T., Teo, J., Chin, K., & Anthony, P. (2013). Pareto Ensembles for Evolutionary Synthesis of
Neurocontrollers in a 2D Maze-Based Video Game. Applied Mechanics And
Materials, 284-287, 3173-3177. doi: 10.4028/www.scientific.net/amm.284-287.3173
WANG, X., WANG, H., & LIU, C. (2009). Automatic Hierarchical Layout Algorithm for UML
Class Diagram. Journal Of Software, 20(6), 1487-1498. doi: 10.3724/sp.j.1001.2009.03417
13
1 out of 14

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.