Question
Java Programming: A level configuration file specifies the size of the game area and the locations of the walls of a game. It is a
Java Programming:
A level configuration file specifies the size of the game area and the locations of the walls of a game. It is a text file of numbers separated by whitespace.
- The first line in the file contains two integer values specifying the width and height of the game area. If there is additional data on this line, it may be ignored.
- The following lines (if any) specify the walls. A wall line contains contains four integer values: the first two are the x and y position of the upper left corner of the wall, the second
two are the x and y position of the the lower right corner of the wall. If there is additional data on this line, it may be ignored
The output of the text file would appear like this (without the f and s):
Write a method that takes in a text file that looks like this, parses through the lines, and returns the proper variables with associated values.
20 11 1 0 180 1 10 18 10 0 1 0 9 19 1 19 9 4 5 155 2Step 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