Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an LC - 3 assembler program that checks whether the player is within a certain Manhattan distance of a specified goal point. a )
Write an LC assembler program that checks whether the player is within a certain Manhattan
distance of a specified goal point.
a Place your code in the assembly file manhattandist.asm
b The assembly file contains predefined constants, GX GY and GZ that specify the
position of the goal point.
c An additional predefined constant, GOALDIST, specifies the distance bound to be checked.
You may assume that GOALDIST
d The Manhattan distance between the player and the goal point is given by:
dmanhattan playerPosx GXplayerPosy GYplayerPosz GZ
If this inequality is met, the program should output The player is within Manhattan
distance of the goal to Minecraft chat. Otherwise, it should output the following string to
the Minecraft chat: The player is outside the goal bounds
Starter code in the file,
ORIG x
HALT
; Note: Please do not change the names of the constants below
GX FILL #
GY FILL #
GZ FILL #
GOALDIST FILL #
END
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started