Well it was easy enough to add octal to your code, I won't post it because, it's a big program. I will say that this makes a nice
cheat-sheet wall hanging. If you are using linux, do:
./abovescript -Dakdbh > ascii.txt
a2ps -P display ascii.txt
Then print from gv.