Question: 3 . Write an LC - 3 program that flattens a 3 x 3 area centred underneath the player. a ) Place your code in

3. Write an LC-3 program that flattens a 3x3 area centred underneath the player.
a) Place your code in the assembly file terraform.asm.
b) Let h denote the height of the land at the (x, z) location of the player. The height of the 3x3 area centred underneath the player should be levelled so that it all has a height of h.
c) Locations with a land height of less than h should be built up to the required height by
placing cobblestone blocks (block ID #4). Be careful not to replace any blocks unnecessarily; only air blocks should be replaced with cobblestone.
d) Locations with a land height of more than h should be cut down to the required height by replacing non-air blocks with air blocks (block ID #0).
e) For the purposes of this problem, land height is defined as the y-position of the highest nonair block at the given x,z coordinates.
f) See Figure 2 for a visual explanation (note the filled blocks should be cobblestone, not dirt)
Please give me the exact code needed for this specific problem.
3 . Write an LC - 3 program that flattens a 3 x 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!