Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Turing Games Katy Evergreen is competing in the 75th Annual Turing Games. The arena is rectangular and surrounded on all sides by impassable walls.

The Turing Games

Katy Evergreen is competing in the 75th Annual Turing Games. The arena is rectangular and surrounded on all sides by impassable walls. The arena is also filled with numerous impassable obstacles. Katy must capture the flag to win the Turing Games. Write a program in a language of your choice that helps Katy reach the flag by finding the shortest path there. The rules of the Turing Games are as follows: The input for your program will be a file read from standard input. The first line of input will contain two floating point numbers: the arenas width (or maximum x dimension) and the arenas length (or maximum y dimension). The second line of input will contain two floating point numbers: (x, y) coordinates showing Katys starting point. The third line of input will contain two floating point numbers: (x, y) coordinates showing where the flag is located. The flag will be located within the arena and will not be within the bounds of an obstacle. Next will be 1 to infinity lines containing series of (x, y) coordinate pairs. Each line will contain at least three pairs. These pairs represent the coordinates of the corners of the various obstacles in the arena. Each obstacle is an impassable convex polygon with at least three sides. Input will end with EOF.

Below is a sample input file (bold text is explanatory only and will not be in the file):

1024 4096 arenas boundaries

110 19 (x, y) coordinates of Katys starting point

1023 4090 (x, y) coordinates of the flag

1000 900 1000 1000 800 900 triangle-shaped obstacle (3 pairs)

501 600 501 700 423 650 423 600 four-sided obstacle

Paste screenshots of the code and successful execution for each program

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

2. Discuss various aspects of the training design process.

Answered: 1 week ago

Question

5. Discuss the key roles for training professionals.

Answered: 1 week ago