Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

- 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):

image text in transcribed

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 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions