A mazebuilder GUI, but with a few additional QOL-tweaks. This version features a fully-functional undo system, alongside rotating blocks.
- Make sure python version is fully updated
- Run the WallGui.py program using
python WallGui.py
- Set your canvas size
- Click on the screen to place a wall
- Customise the wall using the width and height sliders
- Click GENERATE CODE to generate a txt file "wall_code.txt" of code you can copy and paste into your main.c
- The txt file will be in the directory next to the WallGUI.py file
The contents of the txt file will kinda look like
insertAndSetFirstWall(&head, 0, 625, 375, 10, 100);
insertAndSetFirstWall(&head, 1, 535, 465, 100, 10);
// and so on...
- Select any of the instances listed on the right. It'll highlight the corresponding wall on the screen so you know what walls you are about to delete.
- After selecting an instance and the corresponding wall is highlighted, click the 'Delete selected' button.
- The block that you are currently holding can be rotated with
r
. This will swap its width and height. Useful for quickly building walls.
Ctrl + z
will undo the last action, if it was to delete a block, it will restore the deleted block. If it was to place a block, it will then delete the block.Ctrl + y
will redo the last undone action (usingCtrl + z
). Be careful, because if any action is taken after undoing, you will not be able to redo anymore.
- If you want to load your own walls to the editor, use the UPLOAD DATA BUTTON. This takes a txt file containing examples like:
insertAndSetFirstWall(&head, 0, 625, 375, 10, 100);
insertAndSetFirstWall(&head, 1, 535, 465, 100, 10);
insertAndSetFirstWall(&head, 2, 445, 465, 100, 10);
// etc...
- Make sure to set your canvas width and height first
- Try keeping the GUI windowed and not FULLSCREEN.
- the txt file must be in the exact format as the output file. Containing only lines of
insertAndSetFirstWall(&head, 0, 625, 375, 10, 100);
insertAndSetFirstWall(&head, 1, 535, 465, 100, 10);
- Adjust the snap scale to 5, 10 or 15
Original code written by Elvis Nguyen with assistance from chatGPT 4
Mlemko - Added undo, redo and rotation functionality.
Mudit-B - Provided Added Ctrl + Z, Clipboard functionality and fixed various issues