top of page

Maze Displays

  • Writer: Shray Pungaliya
    Shray Pungaliya
  • Apr 27, 2017
  • 3 min read

In my last blog post, I explained the process by which mazes are generated. This week, I'll explain how the mazes go from a list of edges to the image below, as well as the different attempts I made at achieving this.

Before I go into the different attempts, for reference, the wall generating part of the program (detailed in my previous blog post) returned a list of walls - each wall having its orientation and coordinates.

JPEGs and Image Editors

I first tried to generate these mazes using an image editing library. I had found some code that used an older library, but after a few hours of trying to reconcile this code with newer versions, I decided to try to write my own. However, after some research into using newer libraries, I realized I didn't have the time to write the necessary code. So, I decided to take a more rudimentary approach.

Hyphens (-) and Bars (|)

My next attempt was a little more complex. First, I sorted the walls by row and orientation. This was fairly complex as I had to specify exactly how these walls were to be sorted (Orientation --> Y-Val --> X-Val). Once it was sorted, I went through, line by line, and alternatingly added a line of horizontal dashes and spaces, then a line of bars and spaces. While this method somewhat worked, it was extremely inefficient, and it was difficult to see paths within mazes because the lines were not together, so gaps were difficult to identify.

Hyphens (-) and Bars (|) Pass 2

In order to solve this problem, I decided to combine each row of horizontal walls with a row of vertical walls, and instead of using a single String structure, I created a list of Strings (one for each row). While this was a better result (shown below), it was still not what I was looking for.

So, I tried decreasing the spacing between each line, eventually settling on a spacing value of 0.5, leading to the following maze:

However, even this maze did not look nice, although it was starting to look nicer.

Octothorpes (#)

I noticed that the bars and hyphens were intersecting with each other, so I decided to replace them with the same character. Having to find a character that could connect vertically and horizontally with characters of the same type, I decided to use the "hashtag" sign (#). With this replacement, the program generated the following maze:

I was pleased with this maze, but upon showing it to a few others, I found it bothered their eyes, so I decided to try to find another character.

Upper Half Block ( ▀ )

I found this character, and it worked perfectly with the 0.5 spacing as the bottom half of the character is whitespace while the sides of the character take up all allocated space for a character, allowing for there to be no gap horizontally between characters. This adjustment resulted in:

With this final product, I have begun moving on to the portion of my project where I will attempt to programatically solve the maze and display the soution. Given that I have very little time left, I cannot predict whether or not this will be complete in time for the presentation, but if it isn't, I will, at the very least, explain the process by which I planned to solve the maze.


 
 
 

Comments


Contact Me

Tel: 123-456-7890

info@mysite.com

  • Google+ Social Icon
  • Facebook Social Icon
  • LinkedIn Social Icon
  • Twitter Social Icon

© 2023 by Phil Steer . Proudly created with Wix.com

Success! Message received.

bottom of page