CSCI 200 - Fall 2023
Foundational Programming Concepts & Design

Lab 6C - SFML: Maze Drawer

This lab is due by Thursday, December 07, 2023, 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab. If you choose to pair program a solution, be sure that you individually understand how to generate the correct solution.

Jump To: Rubric Submission

The process of determing if a maze can be solved will be done in two phases. First, we will read in and visualize the maze. Then we will look for a path from start to end (if one exists).


Maze Files


A maze pack has been provided with many sample mazes. The format of the maze file is:

R C
#####
#S#E#
#...#
#####

The first line specifies the size of the maze as R rows and C columns. Next, an RxC 2D array of characters follow. The following properties describe the makeup of the character array:


Loading the Maze


Begin by checking if a command line argument was specified with the filename. If not, prompt the user to enter a file containing the maze. As you read the file, create a 2D list of characters that matches the size of the maze. Read the maze contents into your 2D list. Be sure to note what location the S character is in to start your upcoming search.


Drawing the Maze


Each space in our maze will be a 15x15 rectangle. Create an SFML window that has a width of 15*C and height of 15*R. Inside of the draw loop, loop over every row & column in the maze array. Create a RectangleShape that is sized and positioned accordingly. Color the rectangle based on the value in the maze at that position:

The visualization of Maze 1 is shown below:

Maze 1

The visualization of Maze 4 is shown below:

Maze 4

Grading Rubric


Your submission will be graded according to the following rubric:

PointsRequirement Description
0.70Fully meets specifications
0.15Submitted correctly by Thursday, December 07, 2023, 11:59 PM
0.15Best Practices and Style Guide followed
1.00Total Points


Lab Submission


Always, always, ALWAYS update the header comments at the top of your main.cpp file. And if you ever get stuck, remember that there is LOTS of help available.

Zip together your main.cpp, Makefile, *.h, *.cpp, *.hpp files and name the zip file L6C.zip. Upload this zip file to Canvas under L6C.

This lab is due by Thursday, December 07, 2023, 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab. If you choose to pair program a solution, be sure that you individually understand how to generate the correct solution.