Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
