I thought it might be cool to make some game that uses ASCII Art like roguelikes.
But I ran into a problem. First off roguelikes use a number of Unicode character that I understand are just not part of the 95 printable ASCII characters. So I had some trouble displaying this
Code:
▄ ▄█▄ █▄ ▄
▄█▀█▓ ▄▓▀▀█▀ ▀▀▀█▓▀▀ ▀▀ ▄█▀█▓▀▀▀▀▀▓▄▀██▀▀
██ ██ ▀██▄▄ ▄█ ▀ ░▒ ░▒ ██ ██ ▄█▄ █▀ ██
█▓▄▀██ ▄ ▀█▌▓█ ▒▓ ▒▓ █▓▄▀██ ▓█ ▀▄ █▓
█▒ █▓ ██▄▓▀ ▀█▄▄█▄▓█ ▓█ █▒ █▓ ▒█ ▓█▄ ▒
▀▒ ▀ ▀ █▀ ▀▒ ▀ █▀ ░
I can live with that, though it does put a damper on things.
The real problem is that the strings are not mono spaced (all the characters take up the same amount of space)
even when you use a font that is supposed to be mono spaced like Courier New.
So This
Code:
.########.##.....##....###....##.....##.########..##.......########
.##........##...##....##.##...###...###.##.....##.##.......##......
.##.........##.##....##...##..####.####.##.....##.##.......##......
.######......###....##.....##.##.###.##.########..##.......######..
.##.........##.##...#########.##.....##.##........##.......##......
.##........##...##..##.....##.##.....##.##........##.......##......
.########.##.....##.##.....##.##.....##.##........########.########
Ends up looking like this-
.########.##.....##....###....##.....##.########.. ##.......########
.##........##...##....##.##...###...###.##.....##. ##.......##......
.##.........##.##....##...##..####.####.##.....##. ##.......##......
.######......###....##.....##.##.###.##.########.. ##.......######..
.##.........##.##...#########.##.....##.##........ ##.......##......
.##........##...##..##.....##.##.....##.##........ ##.......##......
.########.##.....##.##.....##.##.....##.##........ ########.########
Here is a work in progress that just displays some ASCII aret
textgame.rar
I suppose I could try to display a grid of char characters (I estimate it would take about 546 assuming 12 by 12 squares.
Because it says char displays Unicode character I guess I could use these
Box drawing characters - Wikipedia, the free encyclopedia
Code:
0 1 2 3 4 5 6 7 8 9 A B C D E F
2500 ─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┌ ┍ ┎ ┏
2510 ┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛ ├ ┝ ┞ ┟
2520 ┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯
2530 ┰ ┱ ┲ ┳ ┴ ┵ ┶ ┷ ┸ ┹ ┺ ┻ ┼ ┽ ┾ ┿
2540 ╀ ╁ ╂ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊ ╋ ╌ ╍ ╎ ╏
2550 ═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟
2560 ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬ ╭ ╮ ╯
2570 ╰ ╱ ╲ ╳ ╴ ╵ ╶ ╷ ╸ ╹ ╺ ╻ ╼ ╽ ╾ ╿
Code:
0 1 2 3 4 5 6 7 8 9 A B C D E F
2580 ▀ ▁ ▃ ▃ ▄ ▅ ▆ ▇ █ ▉ ▊ ▋ ▌ ▍ ▎ ▏
2590 ▐ ░ ▒ ▓ ▔ ▕ ▖ ▗ ▘ ▙ ▚ ▛ ▜ ▝ ▞ ▟
At that point I think it might be about as easy to just use tile sets. If I did not end up making all the tiles myself.
-----------------------------------------------------------
(Post made several hours latter)
I just spent a few hour figuring it out.
The extended ASCII codes (character code 128-255)
There are several different variations of the 8-bit ASCII table. The table below is according to ISO 8859-1, also called ISO Latin-1. Codes 129-159 contain the Microsoft® Windows Latin-1 extended characters.
ASCII Code - The extended ASCII table
This is not the extended ASCII you find on most table when you search "extended ASCII". Those seem to be an extended ASCII used in Dos.
What this means is the even when using unicode char it is still impossible to display Box drawing characters like these▐ ░ ▒ ▓.
This displays a number of one character strings in a grid so that they are mono spaced.
I tried to display some extended characters but that part is grayed off because it does not work in it's current state.
here is a second WIP It just displays some ascii 32-126
textgame (WIP)2.rar