Ask a question to Desklib · AI bot


Mouse Maze Solver Program using C++ and Visual Studio

Added on -2019-09-16

This tutorial will guide you on how to create a mouse maze solver program using C++ and Visual Studio. You will be provided with the necessary files and instructions to create a functional program that can move a mouse around a maze in search of the exit while eating cheese along the way. The program uses a two-dimensional array of cells, and several helper functions are provided to aid in the movement of the mouse. You will need to develop a decision-making strategy to make the mouse smarter as it searches for the exit. At the end of the project, you will have a functional program that can solve a mouse maze.
| 2 pages
| 571 words

Trusted by 2+ million users,
1000+ happy students everyday

CPSC 231 Project 08Group ________________________________________________Using code already provided, write functions that will move a mouse around a maze insearch of the exit, eating cheese along the way. The compiled program will look asdisplayed below.Download the following files and create aworkspace using them:, Project08.vcxproj, Project08.vcxproj.filtersProject08.cppMaze Library.lib, Images.dllMaze 01.txt, Maze 02.txt, Maze 03.txtThis program is a Windows executable, nota command-line program. The graphics anduser interface have been designed for youand are included in Maze Library.lib andImages.dll. You will need to compile theprogram using the Microsoft Visual Studio.The zip file also includes three text files thatcontain maze maps to test your program.The mouse maze is stored as a two-dimensional array of cells. A cell has the followingvalues:CELL_OPENOpen space – the mouse can move here. CELL_WALLWall – the mouse can’t move here.CELL_CHEESEOpen space with cheese. After moving the mouse here, the cellchanges to CELL_OPEN.CELL_EXITThe exit of the maze You are provided two functions, which are called by the program when it runs:void mouse_init(int x,int y)This is called when a maze map is loaded.void mouse_move()This is called each tick of the internal timer.When you select a maze file, the program calls mouse_init(). You are providedaccess to this function in case you need to initialize variables that are global to yourProject08.cpp file.When you start the mouse (select a speed from the Run drop-down), a timer begins.Every tick of the timer, the mouse_move() function is called. The sample provided onlyattempts to move the mouse at random. You will develop this function to make yourmouse “smarter” as it searches for the exit.

Found this document preview useful?

You are reading a preview
Upload your documents to download
Become a Desklib member to get accesss

Students who viewed this