0% found this document useful (0 votes)
5 views30 pages

Python

The document is a Statement and Confirmation of Own Work form submitted by Tayza Phone Myint for an NCC Level-3 Diploma in Computing, specifically for a project on a dungeon exploring game developed in Python. It includes a detailed outline of the game's specifications, success criteria, implementation details, testing strategies, and pseudocode. The document emphasizes the importance of academic integrity and proper referencing, requiring a signed declaration to accompany the assignment.

Uploaded by

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

Python

The document is a Statement and Confirmation of Own Work form submitted by Tayza Phone Myint for an NCC Level-3 Diploma in Computing, specifically for a project on a dungeon exploring game developed in Python. It includes a detailed outline of the game's specifications, success criteria, implementation details, testing strategies, and pseudocode. The document emphasizes the importance of academic integrity and proper referencing, requiring a signed declaration to accompany the assignment.

Uploaded by

nanikiken
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Statement and Confirmation of Own Work

A signed copy of this form must be submitted with every


assignment.
If the statement is missing your work may not be
marked.
For Level 7 assignments, please use the separate Level 7
Candidate
Statement of Own Work form instead of
this one.

Student
Declaration

I confirm the following details:

Candidate Name: Tayza Phone Myint

Candidate ID Number: 219860

Qualification: NCC Level-3 Diploma in Computing

Unit: Digital World

Centre: Global Pathway International School

Word Count: 1848


Tayza Phone Myint Introduction To Python 219860

I have read and understood both NCC Education’s Academic Misconduct Policy and
the Referencing and Bibliographies document. To the best of my knowledge my work
has been accurately referenced and all sources cited correctly.

I confirm that I have not exceeded the stipulated word limit by more than 10%.

Candidate Signature: Tayza

Date: 2.2.2026

Contents
Task 1........................................................................................................................................ 4

2
Tayza Phone Myint Introduction To Python 219860

Specifications and outcomes................................................................................................4


Success Criteria.................................................................................................................4
Map structure.......................................................................................................................5
Decomposition into subproblems........................................................................................6
Pseudocode.......................................................................................................................... 7
Task 2 Implementation........................................................................................................... 15
Python Code Screenshot.................................................................................................... 15
Game Play Screenshots...................................................................................................... 19
Task 3 Testing Strategy............................................................................................................25
Types of test data............................................................................................................... 25
Unit Testing.........................................................................................................................25
Movement Function.......................................................................................................25
Inventory function..........................................................................................................26
Drop Function.................................................................................................................26
Drawing grid Function.................................................................................................... 26
Integration Testing..........................................................................................................26
Run through....................................................................................................................26
Whitebox Testing............................................................................................................26
Test Log and Evidence.........................................................................................................27
Test 1 Player movement................................................................................................. 28
Test 2 Inventory opening................................................................................................28
Test 3 Dropping item...................................................................................................... 29
Test 4 Game Ending logic................................................................................................29
Task 4 Technical documentation.............................................................................................29
Guide for installation and running the program.................................................................29

Task 1
Specifications and outcomes

3
Tayza Phone Myint Introduction To Python 219860

This is a dungeon exploring single player game where u can find treasures, open
chests for loots, and collect coins to trade for items with an NPC.

You are a knight who’s going to explore the dungeon for loots and treasures. At the
very beginning u can enter a name for your character. You’ll have an inventory with 4 slots to
store items although coins won’t be counted as a designated slot in the inventory. You’ll also
have 3 hearts. You will be able to explore up to 10 different rooms in this dungeon. There
can be chest, keys, coins, or undead guards who are protecting the essential loots and
treasures of this dungeon and trap chest which will spawn in random and you’ll lose a heart
if u encounter one and decided to open it.

Success Criteria
· The game must have only one player.
· The game must ask for the player’s name at the beginning.
· The player must start with an inventory that can store four items and can be checked
any moment by pressing e.
· The player should be able to explore all ten rooms in the game.
· After every move, the game must show where the player is.
· The player has to choose whether or not to take an item when they find it.
· Each item needs to have its own unique description or purpose.
· Each item in the inventory takes up one slot.
· The player can only carry a maximum of four items at the same time.
· The game must include coins, keys, chests, trap chests, undead guards, a NPC
(non playable character) for trading and giving a task.

4
Tayza Phone Myint Introduction To Python 219860

Map structure

Positions Descriptions

Entrance Hall Starting point where the player enters


their name and begins the dungeon.

Central Corridor Main connecting hallway linking multiple


rooms.

Treasure Room Contains chests with loot, items, or coins.

Trap Chamber Trap chests spawn here; opening one


costs one heart.

Undead Lair Undead enemies guard keys and


important loot.

Armory Room containing useful equipment or


items.

Coin Vault Room filled with coins used for trading.

Tasking Room NPC room for trading coins and receiving


a task.

Locked Room Requires a key to enter; holds rare


treasures.

Final Treasure Hall Final room with the most valuable


treasure.

Decomposition into subproblems


Subproblems Descriptions

5
Tayza Phone Myint Introduction To Python 219860

Game start Display the introduction

Create Player Set player name and health

Create Inventory Create an inventory with 4 empty slots

Move Player Allow player movement (up, down, left,


right), update every time player input a
direction

Game Loop Repeats player action (move, check


inventory lose health, die, quit, go to next
stages)

Player Class Store player name, health, inventory,


position, current stage

Main Game

Game Set up[ Player Actions

Create Player Create Inventory Move Player View Inventory

Talkignt to NPC,
Stage Number Find Items Use items

Quit

Drop items
Game
Conditions

Enter wrong
Health = 0 ->
room-> Game
Game over
over

Enter Final
Treasure room

6
Tayza Phone Myint Introduction To Python 219860

Pseudocode
CLASS Player

DECLARE x, y, health AS INTEGER

PROCEDURE Constructor(startX, startY)

SET x TO startX

SET y TO startY

SET health TO 3

END PROCEDURE

PROCEDURE TakeDamage(amount)

health ← health - amount

OUTPUT "Player took damage. Health:", health

IF health ≤ 0 THEN

OUTPUT "Game Over"

STOP PROGRAM

END IF

END PROCEDURE

7
Tayza Phone Myint Introduction To Python 219860

PROCEDURE Move(direction)

IF direction = "w" AND y > 0 THEN

y←y-1

ELSE IF direction = "s" AND y < 9 THEN

y←y+1

ELSE IF direction = "a" AND x > 0 THEN

x←x-1

ELSE IF direction = "d" AND x < 9 THEN

x←x+1

END IF

END PROCEDURE

END CLASS

PROCEDURE AddItem(item, inventory)

IF LENGTH(inventory) < 4 THEN

ADD item TO inventory

OUTPUT item, "added to inventory"

ELSE

OUTPUT "Inventory full"

END IF

END PROCEDURE

PROCEDURE RemoveItem(inventory, stage)

IF LENGTH(inventory) = 0 THEN

OUTPUT "Inventory is empty"

RETURN

8
Tayza Phone Myint Introduction To Python 219860

END IF

OUTPUT "Inventory:"

FOR i FROM 1 TO LENGTH(inventory)

OUTPUT i, inventory[i]

END FOR

INPUT choice

IF choice IS NUMBER THEN

slot ← choice - 1

IF slot IS VALID THEN

item ← REMOVE inventory[slot]

OUTPUT "You dropped", item

dropPosition ← (player.x, player.y)

IF item = "key" THEN

ADD dropPosition TO [Link]

ELSE IF item = "sword" THEN

ADD dropPosition TO [Link]

END IF

ELSE

OUTPUT "Invalid slot"

END IF

9
Tayza Phone Myint Introduction To Python 219860

ELSE

OUTPUT "Invalid input"

END IF

END PROCEDURE

CLASS Stage

DECLARE player, coins, keys, doors, enemies

PROCEDURE Constructor(stageNumber)

SET player TO new Player(1, 5)

CALL SetupStage(stageNumber)

END PROCEDURE

PROCEDURE GetRandomPositions(amount)

positions ← EMPTY LIST

REPEAT amount TIMES

x ← RANDOM(0,9)

y ← RANDOM(0,9)

ADD (x,y) TO positions

END REPEAT

RETURN positions

END PROCEDURE

PROCEDURE SetupStage(number)

IF number = 1 THEN

coins ← GetRandomPositions(1)

10
Tayza Phone Myint Introduction To Python 219860

keys ← GetRandomPositions(1)

door1 ← (9,5)

END IF

IF number = 5 THEN

undeads ← GetRandomPositions(3)

END IF

IF number = 6 THEN

undeadKing ← (7,5)

END IF

END PROCEDURE

END CLASS

PROCEDURE CheckPlayerPosition(inventory)

pos ← (player.x, player.y)

IF pos IN coins THEN

REMOVE pos FROM coins

RETURN "coin"

END IF

IF pos IN keys THEN

ASK "Pick up key?"

IF yes THEN

REMOVE pos FROM keys

11
Tayza Phone Myint Introduction To Python 219860

CALL AddItem("key", inventory)

END IF

END IF

IF pos IN undeads THEN

RETURN "undeads"

END IF

IF pos IN undeadKing THEN

RETURN "undeadking"

END IF

RETURN "none"

END PROCEDURE

PROCEDURE GameLoop

stageNumber ← 1

inventory ← EMPTY LIST

coinCount ← 0

stage ← new Stage(stageNumber)

INPUT playerName

OUTPUT "You are a knight exploring a dungeon"

WHILE TRUE DO

12
Tayza Phone Myint Introduction To Python 219860

DISPLAY stage map

OUTPUT "Health:", [Link]

INPUT move

IF move = "e" THEN

OUTPUT inventory

INPUT dropChoice

IF dropChoice = "d" THEN

CALL RemoveItem(inventory, stage)

END IF

CONTINUE LOOP

END IF

CALL [Link](move)

result ← CheckPlayerPosition(inventory)

IF result = "coin" THEN

coinCount ← coinCount + 1

END IF

IF result = "undeads" THEN

ASK "Fight undead?"

IF player has sword THEN

OUTPUT "Enemy defeated"

13
Tayza Phone Myint Introduction To Python 219860

ELSE

CALL [Link](1)

END IF

END IF

IF result = "undeadking" THEN

ASK "Fight boss?"

IF player has Super Sword THEN

OUTPUT "Boss defeated"

CALL AddItem("Special Key", inventory)

ELSE

CALL [Link](2)

END IF

END IF

END WHILE

END PROCEDURE

14
Tayza Phone Myint Introduction To Python 219860

Task 2 Implementation
Python Code Screenshot

15
Tayza Phone Myint Introduction To Python 219860

16
Tayza Phone Myint Introduction To Python 219860

17
Tayza Phone Myint Introduction To Python 219860

18
Tayza Phone Myint Introduction To Python 219860

Game Play Screenshots

19
Tayza Phone Myint Introduction To Python 219860

20
Tayza Phone Myint Introduction To Python 219860

21
Tayza Phone Myint Introduction To Python 219860

22
Tayza Phone Myint Introduction To Python 219860

23
Tayza Phone Myint Introduction To Python 219860

24
Tayza Phone Myint Introduction To Python 219860

Task 3 Testing Strategy


The program is well structured and well written to match the success criteria as expected.
Play class, adding or removing items into the inventory, movement, interaction with the
surroundings and NPC are all behaving as calculated. If something occurs during the play
time, there will be an appropriate message or output to ensure and point out the error.

The program will convert the player input even if they are in upper case into lower case to
run and have smooth user experience.

There are total of 5 items that player can carry around, drop off anytime, use in the usable
scenarios.

Types of test data


Normal data: player direction inputs (w, a, s, d), inventory opening (e), yes/no

Extreme data: limited area player is able to move around in each stages:

 X position anything over 9 and anything lower than 0


 Y position anything over 9 and anything lower than 0
 Trying to move up when the Y position in at 9
 Trying to move down when the Y position in at 0
 Trying to move left when the X position in at 0
 Trying to move right when the X position in at 9
 Number of spaces in the inventory (4 total slots)

Invalid data: Any input that has not been interpreted in the implemented code that user try to
enter.

Unit Testing
Movement Function
 Boundary: for both X and Y positions 0 to 9
 Moving left at X position 0,
 Moving right at X position 9,
 Moving up at Y position 9,

25
Tayza Phone Myint Introduction To Python 219860

 moving down at Y position 0,

: Expect won’t output any message back to player, but player will stay still in that
position.

Inventory function
 Inventory space less than 4: Expect allow user to put more thing inside the inventory
 Inventory at 4: Expect output “Inventory Full”

Drop Function
 Drop only the items inside the inventory
 Dropping the items on current position
 Selecting item by name to drop

Drawing grid Function


 Draw 10 by 10 grid
 Include player, keys, coins, doors, swords, door back to previous stage, undead,
undead king, NPC.

Integration Testing
All the classes, functions, and player’s input are well connected and works well with each
other.

Run through
This phase is to indicate whether the program runs smoothly from the player perspective by
testing and performing several complete game runs to ensure expected test results.

Whitebox Testing
Whitebox Testing test is to verify the justification and logicality of the program internally to
indicate logical problems inside the code path line by line.

26
Tayza Phone Myint Introduction To Python 219860

Test Log and Evidence


Test Test purpose Player input Expected Actual Result Evidence
Number Result

1 Test player Input = w Y position Y position


movement up Move up by 1 Move up by 1

2 Test player Input = s Y position Y position


movement down Move down by Move down by
1 1

3 Test player Input = a X position X position


movement left Move down by Move down by
1 1

4 Test player Input = d X position X position


movement right Move up by 1 Move up by 1

5 Inventory Input = e Show Items Show Items


Opening inside inside
inventory inventory

6 Picking item up Input = yes Add item in Add item in


and putting them current current
in inventory position into position into
inventory inventory

7 Testing inventory Add 5th item Output Output

27
Tayza Phone Myint Introduction To Python 219860

limit “Inventory full” “Inventory full”

8 Test using keys Input = yes Remove key Remove key


from inventory from inventory
and move to and move to
next stage next stage

9 Test using sword Input = yes Remove Remove


and super sword undead from undead from
the stage the stage
drawn, add +1 drawn, add +1
to undead kill to undead kill
count count

10 Test opening Input = yes Output “You Output “You


doors without don’t have a don’t have a
key key” key”

11 Test going into Input = yes Deal 3 Deal 3


Trap chamber damage to damage to
player player

12 Test Going back Input = yes Stage_numbe Stage_number


to previous stage r -1 -1

Test 1 Player movement


Input data – Direction = player input

Expected output: movement direction

Actual output: movement direction

Evidence:

Test 2 Inventory opening


Input data – player input = yes/no

Expected output: output inventory list

Actual output: output inventory list

Evidence:

28
Tayza Phone Myint Introduction To Python 219860

Test 3 Dropping item


Input data – existing item name inside inventory = player input

Expected output: remove item from inventory and place it in current position

Actual output: remove item from inventory and place it in current position

Evidence:

Test 4 Game Ending logic


Input data – player reached final treasure room or player quit = player input

Expected outcome: game end

Actual outcome: game end

Evidence:

Task 4 Technical documentation


Guide for installation and running the program
Before running the program, user must install python into the computer

1. Locate the game program location


2. In order to start the game
 By double clicking
 Right click open
3. To uninstall delete the file

29
Tayza Phone Myint Introduction To Python 219860

System Requirements

Window 7 to 11 or MacOS

Minimum of 2GB of RAM

20 KB of storage

30

You might also like