You are on page 1of 6

Swinburne Vietnam

Ho Chi Minh Campus

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:

Functions created in Stage 1:

- input: this is used to read inputs that are string.


- NumOfGuess: this function is used to read integer inputs.

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:

- secretcode: used to display message: “<codemaker name>, please enter a 4 character


secretcode”.

Stage 4:

Function created in Stage 4:


- querycode: it compares the maximum number of guesses with the number of query
codes the codebreaker has.
- QueryCheck: it will check whether the input query code is in correct length or not and it
also validates the colours input.

Stage 5a:

Function created in 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:

- There was no new added function in this stage.

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:

Stage 6 was unsolved.

You might also like