logo

Mouse Maze Solver Program using C++ and Visual Studio

2 Pages571 Words280 Views
   

Added on  2019-09-16

About This Document

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.

Mouse Maze Solver Program using C++ and Visual Studio

   Added on 2019-09-16

ShareRelated Documents
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:https://www.msu.edu/~bowmanm/231/Project08.zipProject08.sln, 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.
Mouse Maze Solver Program using C++ and Visual Studio_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Maze Solver AI for Desklib
|2
|917
|172

Extensions to the Multitasking Kernel
|2
|852
|280