Map inputted ASCII characters
JavaScript (ES6) + HTML, 114 + 16 = 130 bytes
Saved 16 bytes thanks to @Shaggy
a=Array(96).fill` `;onkeypress=k=>(a[k.key.charCodeAt()-32]=k.key,O.innerText=a.join` `.match(/.{1,32}/g).join`
`)
<pre id=O></pre>
It's so unbelievably satisfying to just mash the keyboard...
QBasic 4.5, 81 85 bytes
Added 4 bytes to comply with the spacing-rule.
DO
LOCATE 7,1
LINE INPUT A$:i=ASC(A$)
LOCATE i\16-1,(i MOD 16+1)*2
?CHR$(i)
LOOP
And the output will look like this (NOTE: Old screenshot, now every character is separated by a space):
QBasic has the LOCATE
command, which comes in handy here. A breakdown of this code:
DO Starts an infinite loop
LOCATE 7,1 Moves the cursor out of the way
LINE INPUT A$:i=ASC(A$) LINE INPUT gets user input; we need LINE INPUT instead of regular input
for support of <space> and <comma>. The ASC() function then takes the
ASCII value of the first character in the input, so it can deal with
inputs like 'Hello' - it will take ASC('H') and assign that to 'i'
LOCATE i\16-1 Here's the cool bit: LOCATE takes a row and a column to put the cursor on.
,(i MOD 16+1)*2 Row is determined by dividing the ASC value by 16, minus 1 (SPACE, ASC 32
is placed on row 1), and for columns we take the modulo plus 1 (Again, SPACE
mod 16 = 0, plus 1 = column 1). Multiplied by 2 gives us the spacing.
We move the cursor to 1,2
?CHR$(i) PRINT a cast of the ASCII value to CHR at the specified location.
LOOP Ad infinitum
Java 8, 143 bytes
o->{for(;;){char c=System.console().readPassword()[0];if(c>31&c<127)System.out.println(String.format("\u001B[%d;%df%c",c/16+1,(c%16+1)*2,c));}}
Uses the ANSI control code CSI n ; m f
to set the cursor position and Console.readPassword()
to read the user input silently. Output of some characters: