8
In Map inputted ASCII characters, I asked you to .. map inputted ASCII characters. This time, you will do the opposite, by immediately mapping all ASCII characters, and then mapping spaces over them.
This program will have practical uses, such as seeing what characters you have left in a restricted-source challenge submission.
Challenge
Your job is to write a program that un-maps inputted ASCII characters. As soon as the program is run, it will display this exact map (except color, font, size, etc.):
Each time the user inputs a printable ASCII character, you will print a space over it.
Rules
- The initial output must be exactly as shown in the first image above: a 6x16 grid with ASCII characters in their respective positions, with the space (32) at the top left and the tilde (126) at one character left from the bottom right.
- Your program only needs to display the printable ASCII characters,
0x20
to0x7E
. - Your program must not terminate and continue to print spaces over characters until all printable ASCII characters have been overwritten. From here, your program can either terminate or run off into Neverland.
- Your reverse map must be updated in realtime (as soon as it receives user input).
- If your program does not read input silently, it must put the cursor out of the way, so the text won't get in the way of the map.
Here's a useful ASCII table for reference.
Scoring
The answer with the least bytes in each language wins. Have fun!
Note to potential DV-ers or duplicate voters - it would be more difficult to port an answer on https://codegolf.stackexchange.com/q/124306/61563 to here than it would be to write your own answer. The answers over there read input and then use the input to print to the screen. Answers here have to print to the screen without input (using a different loop mechanism) and then test each inputted character for its location, then print a different character.
– MD XF – 2017-08-02T17:05:07.513Can we assume that the user presses enter after he entered 1 character? – Mr. Xcoder – 2017-08-02T17:07:06.597
@Mr.Xcoder Yes, that's fine for languages that cannot take input in realtime. – MD XF – 2017-08-02T17:09:03.533
@Mr.Xcoder See rule 1 -
Your program only needs to display the printable ASCII characters, 0x20 to 0x7E
– MD XF – 2017-08-02T17:10:30.750Do we need to preserve new lines alignment exactly like on your image? Can we display all characters on a single line? Also, do we need to put spaces between characters? – None – 2017-08-02T17:10:50.367
@ThePirateBay Updated. – MD XF – 2017-08-02T17:13:45.870
3@MDXF It's still strikingly similar to the original challenge. I just need to print the ascii characters to the correct positions, then, instead of putting the user's input in the correct spot, I just use a space instead. – Conor O'Brien – 2017-08-02T17:22:19.713
@dzaima Oh, oops, I didn't look at the tag wiki properly. Edited. – MD XF – 2017-08-02T17:26:56.313