shironecko / LuaMaze

A tiny Lua module aimed at perfect maze random generation.
MIT License
22 stars 4 forks source link

Braille #5

Closed konsumer closed 3 years ago

konsumer commented 3 years ago

Adds example program to output nice braille mazes:

lua source/braille.lua 20 20 recursive_backtracker

⣏⣉⠉⠉⠉⢹⡏⠉⣉⣉⠉⢹⡏⠉⠉⢹⡏⢹⡏⠉⠉⠉⣉⣉⣉⣉⣉⣉⠉⢹⣏⣉⣉⣉⠉⠉⣉⣉⠉⢹
⡏⠉⣀⣸⡇⢸⡇⢸⡏⢹⣇⣀⣀⣸⡇⢸⣇⣀⣀⣸⣇⣀⣉⣉⠉⢹⣏⣉⣀⣀⣉⣉⣉⣉⣀⣸⡏⠉⣀⣸
⡇⢸⣏⣉⣀⣀⣀⣸⡇⠀⣉⣹⡏⠉⣀⣸⡏⠉⣉⣉⣉⣉⠉⢹⣇⣀⠉⢹⡏⠉⣉⣉⣉⣉⠉⢹⣇⣀⠉⢹
⣇⣀⠉⠉⠉⢹⡏⠉⣀⣸⡏⠉⣀⣸⣏⣉⣀⣀⠉⢹⡏⢹⡇⢸⡏⠉⣀⣸⡇⢸⡏⠉⠉⢹⣇⣀⣉⣉⣀⣸
⡏⢹⣇⣸⡇⢸⡇⢸⡏⠉⣀⣸⡏⠉⣉⣉⣉⣉⣀⣸⣇⣀⣀⣀⣀⣸⡏⠉⣀⣸⡇⢸⣇⣀⣉⣉⣉⣉⠉⢹
⣇⣀⣉⣉⣀⣸⡇⢸⡇⢸⡏⠉⣀⣀⣉⣉⣉⣉⣉⣉⠉⢹⡏⠉⠉⢹⣇⣀⠉⢹⡇⢸⡏⠉⣉⣉⣉⣉⣀⣸
⡏⠉⠉⠉⣉⣉⣀⣸⡇⢸⡇⢸⡏⠉⣉⣉⠉⢹⡏⠉⣀⣸⣇⣸⡇⠀⠉⢹⡇⢸⡇⢸⣇⣀⣉⣉⣉⣉⠉⢹
⡇⢸⡇⢸⡏⠉⣉⣉⣀⣸⣇⣀⣀⣸⣏⣉⣀⣸⡇⢸⡏⠉⠉⢹⡇⢸⣇⣀⣀⣸⣇⣸⡏⠉⣉⣉⠉⢹⡇⢸
⡇⢸⡇⢸⣇⣀⠉⢹⡏⠉⣉⣉⣉⣉⣉⣉⠉⢹⣇⣀⣀⣸⡇⢸⣇⣀⣉⣉⣉⣉⣉⣉⣀⣸⡏⢹⣇⣀⠀⢸
⡇⢸⡇⠀⠉⢹⣇⣀⣀⣸⣏⣉⠉⠉⠉⢹⣇⣀⠉⢹⡏⠉⣀⣸⡏⠉⠉⠉⣉⣉⠉⢹⡏⠉⠀⢸⡏⢹⡇⢸
⣇⣸⡇⢸⣇⣀⣉⣉⠉⠉⣉⣉⣀⣸⣇⣀⣉⣹⡇⢸⣇⣀⠉⢹⣇⣸⡇⠀⠉⢹⣇⣀⣀⣸⡇⠀⣀⣸⡇⢸
⡏⠉⠀⢸⡏⠉⠉⢹⣇⣸⡏⠉⣉⣉⣉⣉⠉⢹⣇⣀⠉⢹⡇⠀⠉⢹⡇⢸⡇⢸⡏⠉⠉⢹⡇⢸⡏⠉⣀⣸
⡇⢸⣇⣸⡇⢸⣇⣀⠉⢹⡇⢸⡏⠉⠉⢹⣇⣀⣉⣉⣀⣸⡇⢸⡇⢸⣇⣸⡇⢸⡇⢸⣇⣸⡇⢸⡇⢸⡏⢹
⣇⣀⠉⢹⡇⢸⡏⢹⣇⣀⣀⣸⣇⣸⣇⣀⣉⣉⣉⣉⣉⣉⣀⣸⡇⠀⠉⢹⡇⢸⣇⣀⣉⣉⣀⣸⣇⣀⠀⢸
⡏⠉⠀⢸⡇⢸⡇⠀⣉⣉⣉⣉⣉⣉⣉⣉⣉⣉⣉⣉⣉⣉⠉⢹⡇⢸⡇⢸⡇⠀⣉⣉⠉⢹⡏⠉⣉⣉⣀⣸
⡇⢸⣇⣸⣇⣀⣀⣸⡏⠉⣉⣉⣉⣉⠉⢹⡏⢹⡏⠉⣉⣉⣀⣸⣇⣸⡇⢸⡇⢸⡏⠉⠀⢸⣇⣀⠉⢹⡏⢹
⣇⣀⣉⣉⠉⢹⡏⠉⣀⣀⣉⣉⠉⢹⣇⣀⣀⣸⡇⢸⡏⠉⣉⣉⣉⣉⣀⣸⣇⣸⡇⢸⣇⣸⡏⠉⣀⣸⡇⢸
⡏⠉⣉⣉⣀⣸⣇⣀⣉⣉⠉⢹⣇⣀⠉⢹⡏⠉⣀⣸⡇⢸⡏⠉⣉⣉⣉⣉⣉⣉⠀⢸⡏⠉⣀⣸⡏⠉⠀⢸
⡇⠀⣉⣉⣉⣉⠉⠉⣉⣹⡇⢸⡏⠉⣀⣸⣇⣀⣉⣉⣀⣸⡇⢸⡏⠉⠉⢹⣏⣉⣀⣸⣇⣀⠉⢹⣇⣸⡇⢸
⣇⣀⣉⣉⣉⣹⣇⣀⣉⣉⣀⣸⣇⣀⣉⣉⣉⣉⣉⣉⣉⣉⣀⣀⣀⣸⣇⣀⣉⣉⣉⣉⣉⣉⣀⣀⣉⣉⣀⣸

Requires lua 5.3. Related to #4

konsumer commented 3 years ago

I included the other PR by accident, so if you like both ideas, I think you can just merge this one.

konsumer commented 3 years ago

Another sidenote, love adds utf8 via utf8 = require "utf8" as does luarocks "utf8" so it's not just lua 5.3:

Screenshot from 2021-03-17 21-59-37

shironecko commented 3 years ago

Hey! Love this idea, braille certainly look a lot cleaner that just printing hashtags and spaces. Although I have already merged your other PR so Git get's confused with the commits that are already in my master. Serves me right for rushing to merge without looking at all of the PRs 😅 Can you update this PR by merging my master into you braille branch to make the diff cleaner?

konsumer commented 3 years ago

No prob!

konsumer commented 3 years ago

Ok, added better one: #7 going to close this.