Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / At the Magical Educational Institute (M

At the Magical Educational Institute (M

Computer Science

At the Magical Educational Institute (M.E.I.) of West Attica, which is attended by apprentice magicians, every year

a competition is held between the two best students. Under the responsibility of the school's teachers, a maze is created in which the two rival students are locked inside. The labyrinth has no exit and in order to get out of it one has to find the magic teleportation stone, which is placed in the labyrinth for this purpose. The student who touches the stone first wins the exit from the maze and with it the race. The other student loses the race and hopes not to be forgotten while locked in the maze....

 

 This year, the race involves: Babis Poteridis (M) who competes in the orange costume and Loukas Malfois (L) who competes in a green costume. Unfortunately for both of them, the teacher in charge of the race was appointed the wicked Jimeles. Jimeles, who does not like Bambi Potterides, decided to interfere with the conduct of the match in two ways:

He bewitched Malfoy in such a way that during the race the student's steps were controlled by him.

He changed the magic stone with a similar one which would change its position, inside the maze, at irregular intervals.

Fortunately for Bambi, both the time at which the gem will change position and its new position are random and not controlled by the malicious Jimele.

 

 

-The object of the exercise is to write a program that implements the previous game.

The program will form the maze on the screen, place the two students and the magic  stone in random starting positions (with the correct colors), and respond to the user's commands to move Bumblebee. The direction in which Luke will move is decided by the program.

The implementation of the program will meet all of the following specifications:

 

1. The maze map will be read from a text file, the name of which will be given as an argument to the command line.

The maze will have the shape of a rectangular rectangle. In the file, the character '*' corresponds to a wall and

the character '.' corresponds to a corridor. The perimeter will be closed (wall).

 

2. Both the initial positions of the two students and the positions at which the magic stone is placed are chosen randomly by the program. No object is trapped inside a wall. The two students cannot start from the same position.

The gem is drawn, each time, to a free position in a corridor.

 

3. Bambi's movement is controlled by the player. In each move, Bambi moves one position up, down, left or right

(diagonal moves are not allowed). He may also remain stationary in his current position. Bambi is controlled

 exclusively with the "cursor keys" (for the corresponding movements) and the "Space" key (for immobility).

The user can still terminate the program by using the "Escape" key.

 

4. Luke's move is selected by the program, according to the rules that apply to Bambi.

The direction of his movement must be as... smart as possible.

 

5. The two students are assumed to move simultaneously. In each round, the program waits for the player to choose the direction in which Bambi will move, then chooses a direction of movement for Luke, and finally places the two characters in their new position to create the feeling of simultaneous movement.

Invalid keystrokes and wall movement commands are ignored by the program.

 

6. The program will handle the terminal using the "ncurses" library. If developed in Windows environment, some implementation of the library will be used which is compatible with the development environment (dev cpp).

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE