Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ARM ASSEMBLY CODE PLEASE The Game of Hangman This is a single - player game. Your assignment is to implement in ARM assembler ( remember

ARM ASSEMBLY CODE PLEASE
The Game of Hangman
This is a single-player game. Your assignment is to implement in ARM assembler
(remember not to autogenerate the assembly code from C) the classic hangman game
as we described during lecture. Make up a dictionary text file as we did in class and
have your program randomly choose a word from the file as the keyword for the user
to guess.
The player then guesses a letter that they think may appear in the word. The
computer checks whether the letter appears in the word and either reveals all
instances of it (if it exists) or takes away one point from the player's lives (this is
equivalent to spelling the word H-A-N-G-M-A-N one letter at a time for each guess
in which the guessed letter does not appear in the keyword). The computer then
displays (somehow) the progress that the player has made towards guessing the
word. I would recommend that you display the letters that have been correctly
guessed in the correct location and dashes in the location where the letters have not
been guessed. Also display all the letters that have been guessed up to that point as
well as spell out the letters in the word HANGMAN based on how many bad
guesses have been made. If the user made 2 bad guesses, then print out HA, if the
user made 4 bad guesses, then print out HANG, etc...
The game continues until either all of the letters have been guessed (and the player
wins) or all of the player's lives are used up (the entire word HANGMAN has been
spelled out). In either case, the computer should announce this event and the game
should end.
Here is an example dialog. Words in parentheses are provided for clarity and do
not need to show up in your actual output:
(computer picks the word "fireball" from the dictionary file)
Computer: ________
Human: r
Computer: __ r _____
Letters guessed: r
Number of lives lost:
Human: a
Computer: __ r __ a __
Letters guessed: r a
Number of lives lost:
Human: L
Computer: __ r __ a l l
Letters guessed: r a l
Number of lives lost:
Human: h
Computer: __ r __ a l l
Letters guessed: r a l h
Number of lives lost: H
Human: f
Computer: f _ r __ a l l
Letters guessed: r a l h f
Number of lives lost: H
Human: e
Computer: f _ r e _ a l l
Letters guessed: r a l h f e
Number of lives lost: H
Human: i
Computer: f i r e _ a l l
Letters guessed: r a l h f e i
Number of lives lost: H
Human: b
Computer: f i r e b a l l h
Letters guessed: r a l h f e i h
Number of lives lost: H
Computer says "Congratulations! You figured out my word in 9 guesses
and had 3 lives left!"
When you turn in your lab, make sure to include the output screenshot
AND the dictionary.txt file that you used so that I can run it as is.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

Use prime factorization to find the LCM of 20 and 28.

Answered: 1 week ago

Question

3. Describe the communicative power of group affiliations

Answered: 1 week ago