COS10004 Assignment2 Report
COS10004 Assignment2 Report
Class: COS10004
Topic
Computer Systems-Assignment 2
Instructor:
Dr. Van Ho
Student name:
Vu Thanh Phong
Student ID:
104486950
Submission date:
06/08/2023
Objective:
The aim of this assignment is to program a game called Mastermind by using assembly
language via ARMlite.
Stage 1:
Stage 2:
Function created in Stage 2:
- getcode: it will perform checking the length of the input, validate the characters and give
the error message.
- CodeCheck: used to check the length of the code and check the characters whether they
are correct or not.
- ErrorMSG: this is used to print the error message when the user input the invalid
characters.
- ColorCheck: this is used to validate the input colours.
Stage 3:
Function created in stage 3:
Stage 4:
Stage 5a:
- comparedcodes: it is used to compare the secret code with the query codes.
- MatchingColor: it is used to compare the colours whether they match or not.
Stage 5b:
Function created in Stage5b:
Assumption:
This game requires two people to play and there is a person called “Codemaker” who will input
the secret code of 4 different colours and the maximum number of guesses into the program.
On the other hand, the other person is called “Codebreaker” whose mission is to guess the
correct colours and order the colours to earn a win. There will be announcements about
whether the “Codebreaker” gets the right colour but in the wrong order or the correct colours
and the proper order to help the “Codebreaker” to solve the secret code.
Unresolved problems: