Faculty of Science, Engineering and Technology
Introduction to Programming
HD Task 10.4: Maze Search
Overview
This program will allow you to implement a search using recursion by building on your solution to Task 4.4 HD.
Purpose: Task:
Submit To: Time:
Resources:
Modify a Ruby program which uses recursion to search. Modify the provided code in the search() function.
Doubtfire when complete
This task should be started in Week 7 and submitted for feedback before the start of week 12.
Sobkowicz, M 2015 Learn game programming with Ruby : bring your ideas to life with Gosu, The Pragmatic Bookshelf (See chapter 7 for help the grid aspect of the Maze Task)
Gosu Ruby Documentation Gosu site
Gosu game video tutorial
Submission Details
You must submit the following files to Doubtfire:
Basic gosu_maze_search.rb source code (i.e use your answer to Task 4.4 HD)
Screenshot of the window showing the execution of your program.
Make sure that your task has the following in your submission:
The program must allow the user to create a maze on the screen by modifying code in the appropriate sections (this code you should already have done in Task 4.4 HD).
Code must follow the Ruby coding convention used in the unit (layout, and use of case).
The code must run and the screenshot show it working.
This program does NOT need to have a procedure for main the Gosu cycle is the main cycle.
Your program must have the indicated local variables and use them appropriately.
Introduction to Programming HD Task 10.4: Maze Search
Instructions
Use the code you completed in Task 4.4 HD to get started. You must complete the code so that it works as follows:
1. Once the user has used the Left Mouse Key to create at least one path from one side of the screen to the other, the user should then be able to Right Click the mouse on a yellow cell on the left most side of the screen.
2. The program should then search using the recursive search() function to find a path to the right side of the screen following one of the users created paths.
3. Each cell on the path should then be displayed in red.
A found path through the maze may look something like:
Submit your completed code and screen shot to Doubtfire.
End of Task
Reviews
There are no reviews yet.