Please code in JAVA and follow the instructions as it is mentioned.. please refer the images provided for scope and proper output making a sequel to the big hit game, Zeldar 2. You've been challenged to implement player movement in dungeons. The game is top-down, with dungeons modeled as a 2d grid with walls at the edges. The player's location is tracked by x,y values correlating to its row and column positions. Given the current position of the player and a sequence of input commands: w,a,s,d you must determine the new position of the player. The player must not be able to move outside the walls of the dungeon (i.e. grid) Facts ● the player's position is modeled using two integer values (x, y) ● x represents the column position, left-right axis ● top-left corner is (0,0) ● y represents the row position, up-down axis ● “w” move up by decreasing y by 1 ● “a” move left by decreasing x by 1  ● “s” move down by increasing y by 1  ● “d”  move right by increasing x by 1 ● if an input attempts to move player off grid, then ignore that move. Input The first input is the number of test cases. Each test case contains three lines of inputs. The first line is two positive integers that represent the dungeon's grid size, rows (length) columns (width). The second line is two non-negative integers representing the player's position in the dungeon grid, x,y. The third line represents the sequence of player movements "w", "s", "a", "d". Output The program should print the final location of the player in the form of , where “x” and “y” are the coordinates within the dungeon grid.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please code in JAVA and follow the instructions as it is mentioned.. please refer the images provided for scope and proper output

making a sequel to the big hit game, Zeldar 2. You've been challenged to implement player movement in dungeons. The game is top-down, with dungeons modeled as a 2d grid with walls at the edges. The player's location is tracked by x,y values correlating to its row and column positions. Given the current position of the player and a sequence of input commands: w,a,s,d you must determine the new position of the player. The player must not be able to move outside the walls of the dungeon (i.e. grid)
Facts
● the player's position is modeled using two integer values (x, y)
● x represents the column position, left-right axis
● top-left corner is (0,0)
● y represents the row position, up-down axis
● “w” move up by decreasing y by 1
● “a” move left by decreasing x by 1 
● “s” move down by increasing y by 1 
● “d”  move right by increasing x by 1
● if an input attempts to move player off grid, then ignore that move.
Input
The first input is the number of test cases. Each test case contains three lines of inputs. The first line is two positive integers that represent the dungeon's grid size, rows (length) columns (width). The second line is two non-negative integers representing the player's position in the dungeon grid, x,y. The third line represents the sequence of player movements "w", "s", "a", "d".
Output
The program should print the final location of the player in the form of <x> <y>, where “x” and “y” are the coordinates within the dungeon grid.

Sample Input
2
44
23
SSSW
10 10
94
sdwa
Sample Output
22
84
Transcribed Image Text:Sample Input 2 44 23 SSSW 10 10 94 sdwa Sample Output 22 84
P1 Concepts
●
P2 Solutions limited in scope to:
Selection statements
O
O
O
single selection
double selection
multi-selection
● Repetition statements
O counter-controlled loops
O sentinel-controlled loops
Transcribed Image Text:P1 Concepts ● P2 Solutions limited in scope to: Selection statements O O O single selection double selection multi-selection ● Repetition statements O counter-controlled loops O sentinel-controlled loops
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY