text:
Take a stand against long lines
Recently, someone proposed more stringent limits for Python's default line length:

Clearly, no program should ever use more than 80 characters per line, for a whole host of reasons. First and foremost, for readability and maintainability, it is important to have a solid standard, so we can adjust the width of our text editors appropriately. As a secondary benefit, code can easily be transferred onto media that may have restrictions, and where adding line-breaks can be distracting, like print pages for review in a meeting, or punch cards.
But is 80 characters too high? Some suggest 79, or even as low as 75, to allow for an 80 character wide terminal to fit the code with a few columns devoted to line numbers. Clearly, ultimately, lower is better, as lower limits allow for the code to be used in more situations without reformatting.
Introducing the max6 standard

Your goal is to find and demonstrate the minimum line length required by Your Favorite Language by writing a FizzBuzz variant with the fewest number of characters in any line.
Input
An integer, n, via any desired method.
Output
Print the numbers from 1 to n, (n ≥ 1, n ∈ ℤ)  separated by line breaks, except:

for multiples of 3 print "Apple"
for multiples of 5 print "Pie"
for multiples of both 3 and 5 print "ApplePie"

Scoring
The maximum line length in bytes, not including the line break (Cr, CrLf, Lf, or other system standard break, specify, as desired), and the total code length in bytes as a tiebreaker.
Rules
All line breaks must be meaningful. Line breaks that can be removed and adjacent lines directly concatenated without an impact on the output, must be removed.

An ambiguity we've found in the rule about linebreaks: if the program breaks upon removing one linebreak, but unbreaks upon removing additional linebreaks (i.e. removing any single linebreak breaks the program, but removing a combination of linebreaks can leave it unchanged), is that a valid answer? This came up in Lenguage, but it's probably also relevant in Retina (which cares about whether the program has an even or odd number of lines).

On the newline restriction, if removing a specific group of newlines causes it to work but removing any single newline causes it to fail, must the newlines be removed?  They are syntactically important is just that removing some of them cancels out their importance.

Not sure how I feel about the "meaningful" newlines rule. When it comes to legal syntax, a wide majority of programming languages don't care about newlines and will let you write the entire program on a single line - just take a look at most of the code-golf solutions here :-P

@CalculatorFeline That must be a mistake.

Why change it to Apple Pie instead of the standard

@RohanJhunjhunwala To prevent using builtin FizzBuzz commands.

I take it that these rules require C-based programs to be written on one line since whitespace is not significant?

+1 This is actually a really good idea for a code golf challenge! The small number of characters per line does seem impractical though  I still love it though

@Hosch250 I have interpreted the concatenation as being "with no space between", so you can still have newlines between tokens that would fuse together into one, and even without that interpretation e.g. after to-end-of-line comment markers.

@ais523 the rule is meant to prevent inserting linebreaks everywhere possible vs everywhere necessary, where that then prompts abuse of the grammar to make them necessary. Rules-wise, remove the first line break, concatenating the adjacent lines. If it produces the same output, it is deemed removable, if not, it isn't. Repeat down the length of the program.

Is n guaranteed to be positive or do we need to handle 0 as well?

@12Me21 updated: "1 to n, (n ≥ 1, n ∈ ℤ)"

All line breaks must be meaningful. Line breaks that can be removed and adjacent lines directly concatenated without an impact on the output, must be removed. for real life line breaks are usually not meaningful, though (int fffff(|type1 value1,|type2 value2){)

><>, 1 byte per line, 243 161 135 bytes
-26 bytes thanks to Jo King!
2D languages FTW! Although writing loops and branches using goto instructions instead of the 2D structure is not fun.
v
l
:
:
3
%
:
&
0
4
7
*
&
?
.
~
~
"
e
l
p
p
A
"
o
o
o
o
o
$
5
%
:
&
0
a
5
*
&
?
.
~
~
"
e
i
P
"
o
o
o
*
0
@
?
n
?
~
l
{
:
}
=
?
;
a
o
1

Try it online!, or watch it at the fish playground!
The fish swims downward along the code, using conditional gotos to skip things depending on what divides the accumulator.
I believe this meets the spec: whatever newlines are removed, the fish always hits the initial v (the only direction-changing instruction present), so the fish always swims downwards in the first column. Thus deleting a newline has the effect of simply removing the next character from the fish's path, and I don't think you can remove any of the characters without changing the output.

How many bytes is that?

@L3viathan, it's 243 bytes. (I'll edit that in.)

@L3viathan: I rearranged it a bit and now it's 161 bytes!

:( I don't think I can golf my answer down so much...

135 bytes. and here's the horizontal version for reference

Haskell, 3 bytes/line, 494 471 470 463 453 450 461 bytes
EDIT:

-26 bytes: Removed some redundant linebreaks and their associated comment markers, and changed -1+x into x-1.
+3 bytes: Oops, needed extra -- line after x-.
-1 byte: In f use c 47:[] instead of [c 47&0].
-7 bytes: Move newline handling to w.
-10 bytes: Inline a="Apple" and p="Pie" in # and use a dummy recursion for the 15 case.
-3 bytes: Inline w in f. Remove redundant -- between x and 15.
+11 bytes: Oops again! My string gap theory had a hole. Fixed by introducing % function. Finally made some automated testing to make sure there were no more surprises.

f takes an Int and returns a String.
{;f
n=
--
[--
1..
--
n--
]--
>>=
\
--
x->
--
gcd
x
15#
--
x++
--
c
47:
--
[--
]--
;1#
--
x=
--
n!!
--
(x-
--
1--
)--
;3#
--
_=
--
"A\
\p\
\p\
\l\
\e\
\"&
--
0--
;5#
--
_=
--
"P\
\i\
\e\
\"&
--
0--
;--
15#
--
_=
--
3#
--
0++
--
5#
--
0--
;n=
--
d++
--
[--
s++
--
t|
--
s<-
--
n--
,--
t<-
--
[c
9]:
--
d--
]--
;d=
--
(:
--
[--
]--
)--
<$>
--
[c
8..
--
c
0--
]--
;c
x=
--
[--
"9\
\"%
--
0--
,--
"8\
\"%
--
0..
--
]!!
--
x--
;--
[--
a]%
--
_=
--
a--
;x&
--
y=
--
x}

Try it online!
Test source restrictions! (Line 70 is excluded from the testing because removing its newline causes an infinite loop without output.)
Version with the most important squeezing tricks removed:
{;f n=[1..n]>>= \x->gcd x 15#x++c 47:[]
;1#x=n!!(x-1)
;3#_="Apple"
;5#_="Pie"
;15#_=3#0++5#0
;n=d++[s++t|s<-n,t<-[c 9]:d]
;d=(:[])<$>[c 8..c 0]
;c x=["9"%0,"8"%0..]!!x
;[a]%_=a
;x&y=x}

How it works

This code is written in the more rarely used indentation insensitive mode of Haskell, triggered e.g. by surrounding an entire program with {}. Since I'm actually defining a function rather than a whole program, I'm not quite sure how to count bytes; I've chosen to defensively count both the {}s and an extra ; declaration separator (the latter usually being a newline in normal Haskell mode.)
The main trick for making newlines "meaningful" is -- line comments, which make the next newline non-removable, and also a previous newline in the case when the previous line ends in an operator character (which is not itself part of a line comment).
The second trick is "string gaps", a sequence of whitespace between \ backslashes in string literals, indented for line continuations with possible indentation. A string gap with delimiters is removed from the parsed string.

If the newline of a string gap is removed, it becomes an added backslash in the string. For "Apple" and "Pie" this shows up directly in the output. For "8" and "9" a pattern match is used to give an error if the string has more than one character.

The third trick is the & and % operators, which allow forcing a line to end in an operator character for the first trick. We need this to end string literals, because \" is too wide to append --.

& is the general one, defined such that x&y=x.
% is defined such that [a]%y=a, allowing it to replace !!0 and simultaneously enforce that its string argument must have length 1.

The newline character poses a special problem, as \n seems impossible to fit in a string literal with only 3 bytes on the line.

Therefore, the more easily defined c x=["9"%0,"8"%0..]!!x is used to convert from an Int to a character, counting from the digit '9' downwards.

Because show is four characters, number output must be implemented by hand.

d is a list of the digit strings "1".."9".
n is an infinite list of number representations ["1","2","3",...] defined recursively using d.

# converts an Int x to its ApplePie form given an extra first argument that is the gcd of x with 15.

Jelly, 3 2 bytes/line, 106 80 56 bytes
“3
,e
5P
ḍ,
T⁾
ịi
⁾e
AF
ps
,5
⁾¤
pȯ
lµ
,€
⁾Y
”Ỵ
¢Z
¢F
¢v

Rows and columns of the string literal get transposed, so removing newlines messes up their order.
The remaining lines are separate links/functions and contain function calls (¢), so they can only be concatenated if the function calls are eliminated as well.
Try it online!

Haskell, 7 bytes/line, 339 bytes
The requirement for line breaks to be meaningful makes this a nontrivial challenge in Haskell.  There are almost no ways to insert line breaks that cannot be removed, so everything has to be done with legitimately tiny statements.
c=cycle
h=head
i=tail
k=[1..]
s=do
 let
  _=0
  _=0
 putStr
t=take
p=print
u=fst
v=snd
z=zip
n=s"\n"
o 5=do
 s"Pie"
 n
o _=n
5%x=o 5
_%x=p x
3!x=do
 s"App"
 s"le"
 o$u x
_!x=do
 let
  y=u x
  z=v x
 y%z
q x=do
 let
  y=u x
  z=v x
 y!z
g[]=s""
g x=do
 q$h x
 g$i x
a=t 3 k
b=t 5 k
l=z$c a
m=z$c b
f n=do
 let
  x=t n
  y=x k
  z=m y
 g$l z

Try it online!

TI-BASIC, 4 bytes per line
Since the goal is only to minimize the maximum line length, some of the lines are longer than they need to be, but the smallest I could make the longest line was 4 bytes.  Therefore I felt it'd make the code easier to read if I merged the lines that could be combined without exceeding 4 bytes.
"APP
Ans→Str1
"LE
Str1+Ans
Ans→Str1
"PIE
Ans→Str2
Input N
1→I
While I≤N
fPart(I/3
not(Ans→A
fPart(I/5
not(Ans→B
If A and B
Then
Str1
Ans+Str2
Disp Ans
Else
If A
Then
Disp Str1
Else
If B
Then
Disp Str2
Else
Disp I
End
End
End
I+1
Ans→I
End

Ungolfed
"APPLE"→Str1
"PIE"→Str2
Input "N:",N
For(I,1,N)
remainder(I,3)=0→A
remainder(I,5)=0→B
If A and B:Then
Disp Str1+Str2
Else
If A:Then
Disp Str1
Else
If B:Then
Disp Str2
Else
Disp I
End
End
End
End

About the Language and Limitations
TI-BASIC is a tokenized language, and, in this case, each of the tokens are 1 byte with the exception of the StrN variables, which are 2 bytes.  Also, you can leave off closing parentheses most of the time.  The remainder( function is 2 bytes, so using it would require at least 5 bytes (one for the function, two for the arguments, and one for the comma in remainder(I,3).  Instead, I used the fPart( and not( functions to make it shorter, which are both 1 byte tokens.  Also, you can see I used the built-in variable Ans quite a lot, since any expression that gets evaluated on a line by itself gets automatically stored to it.  So, I can save a few bytes by splitting up the expressions and assignments.
Another strategy was to obviously minimize the string assignments.  My method for doing so depended on the maximum line length in the rest of the code.  Once I determined it to be 4 bytes, I was able to cram as much of each string on the same line as possible to minimize the amount of assignments I needed.  I did this for the sake of readability.
The limiting factors in this code are the assignments to string variables and concatenation with string variables.  The lines Ans→Str1 and Str1+Ans both are 4 bytes in total.  I would have to find a way to eliminate string variables completely in order to further minimize the maximum line length in my code.  Everything else can be shortened to a maximum of 3 bytes or less per line.
The problem there lies in assignments to numeric variables, such as 1→I.  You can't golf that any further without somehow coming up with a solution without variables that doesn't exceed 2 bytes in line length.  That happens to be impossible for this challenge.
Binary operators like + require the operator symbol and the left and right arguments.  So without this, you would not be able to concatenate strings.  Without string concatenation, there would be no way to display the strings required for this program to complete the challenge without exceeding 2 bytes in line length.  Therefore the theoretical limit for this challenge in this language would be 3 bytes per line, which I was not able to attain.

But the longest line in the golfed version is 10 bytes If A and B

@jmarkmurphy TI-BASIC is a tokenized language, and most tokens are represented by a single byte.  I mentioned that in my description of the solution.  You can read more about that on this wiki.

But the premise was that editors should allow a minimum number of characters per line. I doubt that you are typing the tokens with an editor. And I don't think any of the other languages that are not purely interpreted are using a compiled object or tokenized byte count.

@jmarkmurphy actually you do type the tokens in the editor.  The Ans token is 1 byte, whereas the three consecutive characters Ans are 1, 2, and 2 bytes respectively for a total of 5.  It's not an ASCII string, it's literally the token when you type it on the calculator.

There's some consensus on this already on meta.

Fair enough....

Aceto, 1 byte per line, 230 bytes
Well, that wasn't fun to write. As a fungoid, Aceto's control structures heavily rely on its 2D nature, but we can work around that with lots, lots of conditional escapes (`). The only problem with those is that they affect the next command, regardless of its presence (all Aceto programs are squares, internally), which is why we need to align the program at some places by inserting empty lines at some points.
String literals can't really be used, but char literals can (in some places; again, we need to align them).
&
p
$
L
Q
`
L
p
`
L
d
`
L
Q
`
L
Q
`
L
x
`

L
M
!
%
5
d
$
L
Q
`
L
Q
`
L
p
`
L
d
`
L
Q
`
L
x
`
L
M
!
%
3
d
$
L
p
`
L
d
`
L
x
`

L
M
!
%
*
5
3
d
[
X
`

n
=
0
l
)
@
(
z
i
r
{
J
s
]
d
s
}
d
[
~
£
A
'
d
p
'

l
'

e
'

{
~
£
P
'

i
'
e
'

Called with 20, this prints:
1
2
Apple
4
Pie
Apple
7
8
Apple
Pie
11
Apple
13
14
ApplePie
16
17
Apple
19
Pie

All line breaks must be meaningful. Line breaks that can be removed and adjacent lines concatenated without an impact on the output, must be removed.

This is never the case here because it runs from the bottom to the top.
There's at least one place where we can save 2 bytes (by replacing the  `X with a | or #), but I kept it as it is because of the runtime cost associated with running through a relatively big Hilbert curve.
I also ignored the implicit requirement for using \r or \r\n newlines because I think it's an unintentional mistake by the OP. If there's an edit or a comment reinforcing this requirement, I can change it without much trouble to use CR newlines instead.
The bytecount is based on Aceto's codegolfing encoding; Latin-7, in which £ is a single byte.

Re Assuming the three strings on the stack […] and This replacement is left as an exercise to the reader.: Please provide the full code required to solve the task at hand. As is, your solution is incomplete. It also lacks the byte count, which is the tie breaker for solutions with a score of 1.

@Dennis I have now edited the answer to provide full working code.

C (gcc), 2 bytes per line, 374 368 320 310 262 bytes
I assume it can be golfed a bit more. Backslashes escaping newlines makes it sort of trivial.
i\
;\
f\
(\
n\
)\
{\
f\
o\
r\
(\
i\
=\
0\
;\
i\
+\
+\
<\
n\
;\
p\
r\
i\
n\
t\
f\
(\
i\
%\
3\
&\
&\
i\
%\
5\
?\
"\
%\
d\
\\
n\
"\
:\
i\
%\
3\
?\
"\
P\
i\
e\
\\
n\
"\
:\
i\
%\
5\
?\
"\
A\
p\
p\
l\
e\
\\
n\
"\
:\
"\
A\
p\
p\
l\
e\
P\
i\
e\
\\
n\
"\
,\
i\
)\
)\
;\
}

Try it online!

@Ørjan Johansen Ah, quite right.

You can remove a lot of the backslashes, reducing your tie-break score.  Also, no need to separate two-byte tokens such as &&.

Python 3, 4 bytes/line, 113 bytes
e=\
exec
def\
f(n\
):i\
=0;\
e('\
pri\
nt(\
i%3\
//2\
*"A\
ppl\
e"+\
i%5\
//4\
*"P\
ie"\
or-\
~i)\
;i+\
=1;\
'*n)

Try it online!

You know you don't need back slashes for newlines inside parens?

oh, wait I didn't read the useful newlines rule

@NickT: Addressed the rules change.

PHP 7, 2 bytes per line
(#
c#
.#
r#
.#
e#
.#
a#
.#
t#
.#
e#
.#
_#
.#
f#
.#
u#
.#
n#
.#
c#
.#
t#
.#
i#
.#
o#
.#
n#
)#
(#
'#
'#
,#
g#
.#
l#
.#
o#
.#
b#
.#
a#
.#
l#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
6#
)#
.#
a#
.#
r#
.#
g#
.#
n#
.#
(#
c#
.#
h#
.#
r#
)#
(#
7#
*#
8#
+#
3#
)#
.#
w#
.#
h#
.#
i#
.#
l#
.#
e#
.#
(#
c#
.#
h#
.#
r#
)#
(#
5#
*#
8#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
6#
)#
.#
i#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
7#
+#
1#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
7#
+#
1#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
7#
*#
8#
+#
4#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
6#
)#
.#
a#
.#
r#
.#
g#
.#
n#
.#
(#
c#
.#
h#
.#
r#
)#
(#
5#
*#
8#
+#
1#
)#
.#
e#
.#
c#
.#
h#
.#
o#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
6#
)#
.#
i#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
6#
+#
1#
)#
.#
3#
.#
(#
c#
.#
h#
.#
r#
)#
(#
7#
*#
9#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
5#
*#
8#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
6#
)#
.#
i#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
6#
+#
1#
)#
.#
5#
.#
(#
c#
.#
h#
.#
r#
)#
(#
7#
*#
9#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
6#
)#
.#
i#
.#
(#
c#
.#
h#
.#
r#
)#
(#
7#
*#
8#
+#
2#
)#
.#
P#
.#
i#
.#
e#
.#
(#
c#
.#
h#
.#
r#
)#
(#
5#
*#
8#
+#
1#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
7#
*#
8#
+#
2#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
5#
*#
8#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
6#
)#
.#
i#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
6#
+#
1#
)#
.#
5#
.#
(#
c#
.#
h#
.#
r#
)#
(#
7#
*#
9#
)#
.#
A#
.#
p#
.#
p#
.#
l#
.#
e#
.#
(#
c#
.#
h#
.#
r#
)#
(#
7#
*#
8#
+#
2#
)#
.#
A#
.#
p#
.#
p#
.#
l#
.#
e#
.#
P#
.#
i#
.#
e#
.#
(#
c#
.#
h#
.#
r#
)#
(#
5#
*#
8#
+#
1#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
6#
*#
7#
+#
2#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
4#
*#
8#
+#
2#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
2#
*#
5#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
4#
*#
8#
+#
2#
)#
.#
(#
c#
.#
h#
.#
r#
)#
(#
7#
*#
8#
+#
3#
)#
)#
(#
)#
;#

How does that work with the dots?

@L3viathan Dots denote concatenation. They are used to build long strings from single characters.

I know that, but does PHP just make strings from unassigned variable names, or how does that work? I see no quote chars.

@L3viathan Those characters are constants. If a constant has not been defined, PHP uses its name as the value.

Perl 5, 2 bytes per line, 182 bytes
&
#
{'
Er
0h
|R
hR
o
'#
^#
'I
 O
Ro
3f
+~
'#
.#
(#
p#
|#
Y#
)#
}#
(#
'z
;d
y"
"z
7#
vU
aW
zZ
7#
vU
gW
..
~.
4e
r;
|6
'#
^#
('
xR
~R
KR
fR
QR
/R
$R
cR
QR
/R
vR
UR
%R
xR
$R
'#
.#
4#
))

Try it online!
Perl's syntax is very forgiving, so a lot of gaps can be added to the code and comments added, which makes the core idea fairly straightforward. The main aim with this code is to build a string containing the code we want to run, and eval it. In Perl, it's possible to call a function using a string or variable with the &{...} notation, unfortunately however, eval isn't callable in this form, but evalbytes is, as long as you call it via the CORE:: namespace. Building that string was fairly straightforward and the program is passed directly to this call. The strings are built utilising the newlines as part of the XOR, to build these I used this script. To keep this valid, a few places have had to have comments placed, so that removing the newlines would result in non-functioning code.
The FizzBuzz routine was taken from primo's excellent answer.

Perl 5, 1 byte per line, 172 bytes
So, I (now) know this is invalid, because a bunch of the newlines can be removed, but since this was my original approach to the problem I'm adding it. It was fun see how far you can push Perl's syntax! I enjoyed this problem on its own merit, even though it's invalid.
&
{
(
I
.
'
X
0
o
k
h
~
'
.
(
p
|
Y
)
)
^
'
E
O
0
|
f
s
o
'
}
(
'
x
d
!
K
z
o
Q
U
9
$
Z
o
Q
U
?
v
.
&
%
e
*
$
6
'
^
'

c
~
"
z
f
#
.
/
W
"
c
#
.
/
W
v
U
.
l
x
;
$
4
'
^
p
)

Try it online!

Doesn't this break the "All line breaks must be meaningful" rule?

@12Me21 yeah, I've just been looking at that. So the first one breaks it if removed, but some of the others can indeed be removed, putting this as a length of 2. Damn, I spent ages getting an approach that worked with one char per line!

@12Me21 I think I've got a solution that works for 2 now, I've added a golfed version of the 1 byte length since I spent the time to make it, damn rules! :)

SmileBASIC, 9 7 bytes per line, 159 155 154 152 bytes
This was a really fun challenge.
Unfortunately, the rule against unnecessary line breaks causes a few problems, (though luckily it doesn't affect the maximum line length here.)
I had to add comments between lines like A%=I/3 and A=A%*3, since A%=I/3A=A%*3 is parsed correctly in SB. I was able to use a trick to leave out some comments, since replacing A with E makes that line invalid (It has something to do with numbers written using E notation, I think. 3E is considered an invalid number rather than a number and a variable name.)
A$="App
B$="le
P$="Pie
INPUT N
R=N
WHILE R
INC I
R=I<N
A%=I/3'
A=A%*3'
A=A==I
B%=I/5
E=B%*5
E=E==I'
?A$*A;
?B$*E;
?P$*E;
C=A+E
WHILE!C
C=1?I;
WEND?
WEND

The biggest limitation here is getting input. INPUT x is the simplest way allowed, the alternative being to define a function with an input value like DEF F x but that is still 7 characters. Making a conditional statement is also hard; I can't think of anything shorter than WHILE x.

If A%=I/3A=A%*3 is syntactically valid but logically broken, you don't need the comment char.

It's correctly parsed as A%=I/3 and A=A%*3, so the comment is required.

JavaScript (ES6), 3 bytes per line
Uses the global variable top to access the window object, from which we eval the following code:
n=prompt('')
i=0
for(;++i<=n;console.log(i%5?f||i:f+'Pie'))f=i%3?'':'Apple'

You'll have to run it in the console as top is inaccessible from a sandboxed Stack Snippet.

t//
=//
top
t//
[`\
ev\
al\
`//
]//
(`\
n=\
pr\
om\
pt\
('\
')
i=0
fo\
r(\
;+\
+i\
<=\
n;\
co\
ns\
ol\
e.\
lo\
g(\
i%\
5?\
f|\
|i\
:f\
+'\
Pi\
e'\
))\
f=\
i%\
3?\
''\
:'\
Ap\
pl\
e'\
`)

C#, 9 bytes per line, 248 242 230 bytes
Since C# doesn't care about linebreaks, it needs a oneline comment at the end of almost (thanks Ørjan Johansen) every line to comply with the rules. This program expects n as a command line argument. Here's with as many non-deletable newlines as possible:
class
A//
{//
static
void
Main//
(//
string//
[//
]//
a//
)//
{//
for//
(//
var
i//
=//
0//
;//
i++//
<//
int//
.Parse//
(//
a//
[//
0//
]//
)//
;//
)//
{//
var
s//
=//
""//
;//
if//
(//
i//
%//
3//
==//
0//
)//
s//
+=//
"A"+//
"p"+//
"p"+//
"l"+//
"e"//
;//
if//
(//
i//
%//
5//
==//
0//
)//
s//
+=//
"P"+//
"i"+//
"e"//
;//
if//
(//
s//
==//
""//
)//
s//
=//
$"{i}"//
;//
System//
.//
Console//
.//
Write//
(//
s//
+//
@"
"//
)//
;//
}//
}//
}

But since the longest line is 9 bytes, other lines can get that long too, shaving off some bytes:
class
A{static
void
Main(//
string[//
]a){//
for(var
i=0;i++//
<int.//
Parse(a//
[0]);){//
var
s="";if//
(i%3==0//
)s+=//
"Apple"//
;if(i%5//
==0)s+=//
"Pie";//
if(s==//
"")s=//
$"{i}";//
System.//
Console//
.Write(//
s+@"
");}}}

I have interpreted the concatenation as being "with no space between", so you don't need // between tokens that would fuse together, like static and void.

@ØrjanJohansen Thanks! Saved 6 bytes

I think maybe you can save more bytes by rearranging into var s="";if// (i%3==0// )s+=// "Apple"// ;if(i%5//.

And there's a similar opportunity to move A from the first to the second line.

And also saved 3 bytes by changing "\n" to @"", with the second quote on a new line, making that newline required too.

JavaScript, max of 6 bytes/line, 528 bytes
Idea ripped from here.
Code ripped from here.
Thanks to Anders Kaseorg for g=eval, saving a byte per line.
a="n"
a+="="
a+="p"
a+="r"
a+="o"
a+="m"
a+="p"
a+="t"
a+="("
a+="'"
a+="'"
a+=")"
a+=";"
a+="f"
a+="o"
a+="r"
a+="("
a+="i"
a+="="
a+="0"
a+=";"
a+="+"
a+="+"
a+="i"
a+="<"
a+="="
a+="n"
a+=";"
a+="c"
a+="o"
a+="n"
a+="s"
a+="o"
a+="l"
a+="e"
a+="."
a+="l"
a+="o"
a+="g"
a+="("
a+="i"
a+="%"
a+="5"
a+="?"
a+="f"
a+="|"
a+="|"
a+="i"
a+=":"
a+="f"
a+="+"
a+="'"
a+="P"
a+="i"
a+="e"
a+="'"
a+=")"
a+=")"
a+="f"
a+="="
a+="i"
a+="%"
a+="3"
a+="?"
a+="'"
a+="'"
a+=":"
a+="'"
a+="A"
a+="p"
a+="p"
a+="l"
a+="e"
a+="'"
g=eval
g(a)

Unseperated:
n=prompt('');for(i=0;++i<=n;console.log(i%5?f||i:f+'Pie'))f=i%3?'':'Apple'

a=""+\n"f"+\n"o"+ ... and ending with eval(\na) is slightly shorter

The rules changed slightly (ApplePie, take an input), but your scheme should still be valid.

The rule change invalidates @ValueInk’s suggestion, but you could still end with f=eval and f(a).

@AndersKaseorg thank you :) didn't think of that

@NickT fixed, thanks for letting me know about the edit

You can save a byte by putting 2 characters in the string on the first line.

Ruby, 10 5 bytes/line, 354 214 bytes
-140 bytes from the raw score from @NieDzejkob.
eval\
"pu"\
"ts"\
" ("\
"1."\
".g"\
"et"\
"s."\
"to"\
"_i"\
")."\
"ma"\
"p{"\
"|i"\
"|i"\
"%1"\
"5<"\
"1?"\
":A"\
"pp"\
"le"\
"Pi"\
"e:"\
"i%"\
"5<"\
"1?"\
":P"\
"ie"\
":i"\
"%3"\
"<1"\
"?:"\
"Ap"\
"pl"\
"e:"\
"i}"

How it works
Ruby will automatically concatenate sequences of string literals (except for single-character literals such as ?a) in the same statement. That means that x = "a" 'b' "c" %q{d} is equivalent to x = "abcd". We use this to split the FizzBuzz-like code into much smaller strings for calling eval with, since + will invalidate the program due to the removing-newlines rule, but the \ will cause syntax errors if the newlines are taken out!

I was just about to submit something similar

The rules changed slightly ('ApplePie, take an input), but your scheme should still be valid.

You can save a lot of bytes by adding two characters to the string on every line.

@NieDzejkob the primary scoring mechanism here is bytes per line, meaning that it's better to sacrifice total bytecount to reduce line length.

@NieDzejkob nvm I see what you mean now, it's since the initial eval line is longer than the rest, right?

@ValueInk Yes, that's what I had in mind.

Python 2, 5 bytes/line, 93 bytes
The max6 standard is already obsolete.
def\
f(n):
 i=0
 \
exec\
'pri\
nt i\
%3/2\
*"Ap\
ple"\
+i%5\
/4*"\
Pie"\
or-~\
i;i+\
=1;'\
*n

Try it online!
Python 2 and 3, 5 bytes/line, 100 bytes
def\
f(n):
 i=0
 \
exec\
('pr\
int(\
i%3/\
/2*"\
Appl\
e"+i\
%5//\
4*"P\
ie"o\
r-~i\
);i+\
=1;'\
*n)

Try it online!

PHP, 4 Bytes/line
for#
(#
$z=#
${#
ar.#
gn#
};#
$k#
++<#
$z#
;){#
(#
pr.#
in.#
t_.#
r)#
([#
A.#
p.p#
.le#
][#
$k#
%3#
].[#
Pie#
][#
$k#
%5#
]?:#
$k)#
;(#
pr.#
in.#
t_.#
r)#
("
");}

Try it online!

All line breaks must be meaningful. Line breaks that can be removed and adjacent lines concatenated without an impact on the output, must be removed.

@JulianWolf I have change it

Retina, 4 bytes/line
.+
$*      Convert the input number to unary.
1
$`1¶    Count from 1 to the input number.
111
A       Divide by 3.
+`A1
1111    If there was a remainder, restore the original number.
A{5}
AP      If the number is divisible by 3, try to divide by 5.
.*A     The result ends in `AP` if the number is divisible by 15,
Appl    or in `A` if it is only divisible by 3. Replace everything
l       up to the `A` with `Apple`; multiples of 15 become `AppleP`.
le
1{5}    If the number did not divide by 3, try dividing it by 5 anyway.
P
+`P1    If there was a remainder, restore the original number.
6$*1    Otherwise replace the result with `Pie`,
P+      which also fixes multiples of 15.
Pie     If the number was divisible by neither 3 nor 5,
1+      convert it back to decimal.
$.&

Try it online!

APL (Dyalog), 5 bytes per line
∇f
A←'A'
p←'p'
p,←p
e←'e'
A,←p
l←'l'
A,←l
A,←e
P←'P'
i←'i'
P,←i
P,←e
{O←''
M←3|⍵
M←0=M
O←M/A
M←5|⍵
M←0=M
M←M/P
O,←M
M←⍴O
M←0=M
M←M/⍵
O,←M
⎕←O⍝
}¨⍳⎕
∇

Try it online!

R, 10 bytes per line, 800 bytes
The "meaningful linebreaks" rule made this challenging. Currently this just spells out fizzbuzz code into a string and then executes it.
a="x"
a[2]="="
a[3]="y"
a[4]="="
a[5]="1"
a[6]=":"
a[7]="s"
a[8]="c"
a[9]="a"
a[10]="n"
a[11]="("
a[12]=")"
a[13]=";"
a[14]="y"
a[15]="["
a[16]="3"
a[17]="*"
a[18]="x"
a[19]="]"
a[20]="="
a[21]="'"
a[22]="A"
a[23]="p"
a[24]="p"
a[25]="l"
a[26]="e"
a[27]="'"
a[28]=";"
a[29]="y"
a[30]="["
a[31]="5"
a[32]="*"
a[33]="x"
a[34]="]"
a[35]="="
a[36]="'"
a[37]="P"
a[38]="i"
a[39]="e"
a[40]="'"
a[41]=";"
a[42]="y"
a[43]="["
a[44]="1"
a[45]="5"
a[46]="*"
a[47]="x"
a[48]="]"
a[49]="="
a[50]="'"
a[51]="A"
a[52]="p"
a[53]="p"
a[54]="l"
a[55]="e"
a[56]="P"
a[57]="i"
a[58]="e"
a[59]="'"
a[60]=";"
a[61]="w"
a[62]="r"
a[63]="i"
a[64]="t"
a[65]="e"
a[66]="("
a[67]="y"
a[68]="["
a[69]="x"
a[70]="]"
a[71]=","
a[72]="'"
a[73]="'"
a[74]=")"
t=toString
g=gsub
o=", "
l=""
f=t(a)
r=g(o,l,f)
P=parse
p=P(t=r)
eval(p)

Try it online!
Here is the concatenated ApplePie code (adapted from MickyT's golf here).
x=y=1:scan()
y[3*x]='Apple'
y[5*x]='Pie'
y[15*x]='ApplePie'
write(y[x],'')

And the ungolfed version of the parsing code:
eval(t=parse(gsub(", ", "", toString(a))))

Here I use toString to concatenate the list of symbols a into a single string. However, the default behavior is to separate each symbol with ,, so we call gsub to replace them with nulls. Then we pass it to parse and eval to do the dirty work.
It's possible that there's an approach that doesn't use this string parsing method and just straight up implements fizzbuzz, but it seems to me that using for or while or defining a function needs longer lines than the current approach.

Julia 0.6, 5 bytes per line, 168 bytes total
f=#
n->#
((i,#
a=#
"A"*#
"p"*#
"p"*#
"l"*#
"e",#
p=#
"P"*#
"i"*#
"e"#
)->#
["$i
","$a
","$p
",a*#
p*"
"][#
1+(i#
%3<1#
)+2(#
i%5<#
1)]#
|>[#
print
sin#
][1]#
).(#
1:n)

Try it online!
The print brings this unavoidably (afaict) into the 5 bytes per line territory.
Ungolfed:
function f_ungolfed(n)
  inner = (i,
           a="Apple",
           p="Pie") -> ["$i\n",
                        "$a\n",
                        "$p\n",
                        a*p*"\n"][
                                    1 + (i%3 < 1) + 2(i%5 < 1)
                                   ] |> [print; sin][1]
  inner.(1:n)
end

* is the string concatenation operator, so a*p*"\n" forms "ApplePie\n". |> is the function chaining (/piping) operator, so the chosen string gets sent as the argument to print. The sin is not used, it's just there because print needs to be in an array to have significant whitespace after it (using the # trick after it will bring the per line max byte count to 6).

If simply returning the output as an array is allowed, it can be done with 4 bytes max per line:
Julia 0.6, 4 bytes per line, 152 bytes total
f=#
n->#
((i#
,a=#
"A"#
*#
"p"#
*#
"p"#
*#
"l"#
*#
"e"#
,p=#
"P"#
*#
"i"#
*#
"e"#
)->#
[i,#
a,p#
,a*#
p][#
1+(#
i%3#
<1#
)+#
2(i#
%5<#
1)]#
).(#
1:n#
)

Try it online!
A function that takes n and returns an array containing the expected output.
Max line length here is constrained by n-> - Julia needs that in a single line to parse it properly as the start of a lambda.

Pascal (FPC) -Sew, 6 bytes per line, 348 320 bytes
var
n,i://
word//
;begin
read//
(n);//
for
i:=1to
n do
if 0=i
mod
15then
write{
$}(//
'A',//
'p',//
'p',//
'l',//
'e',//
'P',//
'i',//
'e',//
#10)//
else
if 0=i
mod
3then
write{
$}(//
'A',//
'p',//
'p',//
'l',//
'e',//
#10)//
else
if 0=i
mod
5then
write{
$}(//
'P',//
'i',//
'e',//
#10)//
else
write{
$}(i//
,#10//
)end.

Try it online!
Utilises FPC to get 6 bytes per line; without it, the result would be much worse. This is the smallest possible line width since after write must be either ; or ( (or unnecessary whitespace), so a special comment is inserted to avoid this. The features from FPC which influenced this answer are:

// - starting one-line comments.
Block comments in form {$<something>...} are compiler directives. If the directive does not exist, FPC will issue a warning (and on {$ ...} as well). In this program, { and $ are separated with a newline which will issue the warning when deleted.
-Sew - Compiler also halts after warnings so that { and $ joined stop the compilation.

Japt, 3 bytes per line
Nearly managed to get it down to two bytes per line, but the return from map breaks if it's followed by a newline.
The FizzBuzz implementation itself is from the canonical FizzBuzz thread.

`A
p
p
l
e
`y
Vx
`P
i
e
`y
Xx
ò1\
 Ë\
;W\
pD\
v3\
)+\
Yp\
Dv\
5)\
ªD\
Ã·

Try it online!

LOLCODE, 18 8 bytes per line, 303 bytes total
HAI 1.2
I HAS A…
B ITZ 0
IM IN…
YR L
B R SUM…
OF B AN…
1
MOD OF…
B AN 15
WTF?
OMG 0
VISIBLE…
"Apple"…
"Pie"
OMGWTF
MOD OF…
B AN 5
WTF?
OMG 0
VISIBLE…
"Pie"
OMGWTF
MOD OF…
B AN 3
WTF?
OMG 0
VISIBLE…
"Apple"
OMGWTF
VISIBLE…
B
OIC
OIC
OIC
BOTH…
SAEM B…
AN 100
O RLY?
YA RLY
GTFO
OIC
IM…
OUTTA…
YR L
KTHXBYE

Try it online!
-10 bytes per line using the line-continuation character …, thanks to Ørjan Johansen!

You can get that down to 8 with the … line continuation character. Try it online!

I'm learning something new about these esolangs every day. Thanks, Oerjan!

Python 2, 5 bytes/line
exec\
'f\
o\
r\
 \
x\
 \
i\
n\
 \
x\
r\
a\
n\
g\
e\
(\
1\
,\
i\
n\
p\
u\
t\
(\
)\
+\
1\
)\
:\
\n\
 \
i\
f\
 \
x\
%\
1\
5\
=\
=\
0\
:\
s\
="\
A\
p\
p\
l\
e\
P\
i\
e"\
\n\
 \
e\
l\
i\
f\
 \
x\
%\
5\
=\
=\
0\
:\
s\
="\
P\
i\
e"\
\n\
 \
e\
l\
i\
f\
 \
x\
%\
3\
=\
=\
0\
:\
s\
="\
A\
p\
p\
l\
e"\
\n\
 \
e\
l\
s\
e\
:\
s\
=\
x\
\n\
 \
p\
r\
i\
n\
t\
(\
s\
)'

Try it online!

Careful! 'z\"' means the same thing as 'z\⏎"', so the redundant newline rule means you’re not allowed to start a continuation line inside the string with ".

@AndersKaseorg made it r'...' now

This throws a SyntaxError.

The TIO stops one number early. Also, the rules changed from using FizzBuzz to using ApplePie.

JavaScript (ECMAScript6), 2 bytes per line

'\
'[
'\
b\
i\
g'
][
'\
c\
o\
n\
s\
t\
r\
u\
c\
t\
o\
r'
][
'\
c\
a\
l\
l'
](
0,
`\
n\
=\
p\
r\
o\
m\
p\
t\
(\
'\
'\
)\
;\
i\
=\
0\
;\
f\
o\
r\
(\
;\
+\
+\
i\
<\
=\
n\
;\
c\
o\
n\
s\
o\
l\
e\
.\
l\
o\
g\
(\
i\
%\
5\
?\
f\
|\
|\
i\
:\
f\
+\
'\
P\
i\
e\
'\
)\
)\
f\
=\
i\
%\
3\
?\
'\
'\
:\
'\
A\
p\
p\
l\
e\
'\
`)
()

TLDR - Shorter explanation
I'm accessing the new Function(code) constructor to parse the string instead of eval(code). This constructor is available at every native function by doing anyFunction.constructor, like alert.constructor===Function. I'm using a function/method inside the String.prototype.big String.prototype.big.constructor.call(null, /*string*/)
But accessing it directly from a string literal "".big and turned it to  bracket notation. ""['big']['constructor']['call'](0, CODE) to be able to break it using the \.
Long explanation
The way we can make lines shorter is transforming code into a string and escaping the line ends, this will impose a limit of 2bytes per line.
So alert(1) becomes
"\
a\
l\
e\
r\
(\
1\
)"

But now your code is a string so we need to execute the string as code. I know at least 4 ways you can execute string as code:

eval(code). Which takes at least 5 bytes to call eval(
setTimeout(code, timeout). Runs function asyncronously, but optionally if you pass a string it will invoke eval internally.
You can take advantage of the DOM and put your code inside a onclick="" attribute, but I could not manage to make the element creation part short.
Invoking the Function constructor new Function() will parse your code into a anonymous function which you can call later (I used this).

All the native functions lives inside the window object and in javascript you can access object properties using the dot notation so eval() becomes window.eval(), or you can access properties using the bracket notation window['eval'](). You can take advantage of this to break the eval in multiple lines using the method described before. But you still have to type the window, one trick is that if you're not inside a frame, the top variable is also window, so window.eval becomes top.eval (3 bytes less).
w=top
w['eval']

You can shorten the assignment using parenthesis
w=(
top
)
w[
'e\
av\
al'
](
/*string*/
)

So this will make the code minimum of 3 bytes. To make the code 2 bytes I used the new Function(/*string*/); constructor, but I had to be creative to access it without having to type it.
First, the Function constructor allows you to call it as a function omitting the new keyword, this reduce 4 bytes but it is also important for another reason. Calling the constructor as a function still returns a instance this allows us to turn new Function(code) to Function(code). Another importante thing is that the Function constructor have a call method that allows you to call any function but overriding the this reference, and the Function constructor itself being a function you can call a method on it self like Function.call(null, code).
All native functions are instances of the Function constructor, and all objects in javascript have a constructor property. So you can have access Function constructor on any native function like alert.constructor, and using the call method we can execute the constructor as a function. Now we have alert.constructor.call(null, code) returns a function.
combining the previous thechiniques we can turn it into alert['constructor']['call'](null, code)
Now we just need to find a short named function or method, so I choose the big() method inside the String constructor. So I can access it directly from a empty string "".big
"".big.constructor.call(null, "code")();
''['big']['constructor']['call'](0,'/* code */')()

Then I just broke every thing in 2 bytes

Unfortunately, I think this is invalid since e.g. any line break between ' and ] can be removed and the program will still run successfully.

I can't think of any way around this given a width of 2. But since we have nearly identical approaches, perhaps you can add an adapted version of your explanation to my answer, so not all is lost?

Pip, 3 bytes per line, 72 bytes total
V@Y
YUW
Y"L
a
P
S
T
[
`
A
p
p
l
e
`
`
P
i
e
`
]
X
!
*
+
+
i
%
^
3
5
|
i"

Try it online!
Pip is exceedingly flexible about whitespace, so the only strategy that seems feasible is to create a string, modify it in a way that requires the newlines not to be disturbed, and eval it.
We create a string where every other character is a newline, and take every other character of it using UW (unweave) and unary @ (get first element):
UW"abcdef"  => ["ace" "bdf"]
@UW"abcdef" => "ace"

The result of @UW should be our ApplePie code, adapted from the FizzBuzz solution here. If any newlines in the string are deleted, this will not result in the full code, giving either a syntax error or incorrect output.
There are still two newlines outside the string. We made these mandatory by using the Y (yank) operator--which here acts as a no-op--together with the way Pip parses runs of uppercase letters:
YUW   => Y UW
YUW Y => Y UW Y
YUWY  => YU WY

So if these newlines are deleted, the program parses differently and doesn't do what it's supposed to.

Java 8, 7 bytes per line, 171 bytes
A void lambda taking an int. I suspect this obeys the requirement regarding newlines, but I can't prove it, and verifying it by brute force would take about a month on my computer. So it goes.
a->{//
System
s=//
null;//
for(int
i=0;i//
<a;)s//
.out.//
print//
((++i//
%3*(i//
%5)<1//
?(i%3//
<1?//
"App"//
+"le"//
:"")+//
(i%5<//
1?//
"Pie"//
:"")://
i)+//
"\n");}

Try It Online
Pretty boring due to the line comments. The only interesting thing here is the use of a null System reference, which seems to be necessary in order to print to standard out in under 8 bytes per line. Note also that the print method call is the bottleneck.
Ungolfed with no comments:
a -> {
    System s = null;
    for (int i = 0; i < a; )
        s.out.print(
            (++i % 3 * (i % 5) < 1 ?
                (i % 3 < 1 ? "App"+"le" : "")
                    + (i % 5 < 1 ? "Pie" : "")
                : i
            ) + "\n"
        );
}

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Dynamically Create Boxes
The Challenge:
Draw a rectangle of ASCII boxes: []
The Rules:
Takes a width and a height input
You can assume both of these are numbers
Must produce a string with newline characters, \n
Examples:
2, 2:
[][]
[][]

2, 3:
[][]
[][]
[][]

Fewest Bytes wins.

Nice first post! Welcome to PPCG!

Can I assume that the numbers are positive? Can there be trailing newlines?

@dzaima Positive integers, no trailing or leading stuff

can we print to console or do we need to return the string?

@MDXF Thanks! (filler)

@Giuseppe return the string

what if we literally can't not print trailing newlines? it tends to be good practice to allow one trailing newline

I'll accept it, but it's better without the trailing newline for this purpose

@Robinlemon you might want to wait before accepting an answer, if you accept an answer than people are less inclined to answer

@StephenS, Sorry, first post! =) Thanks for the heads up, I've unaccepted an answer now!

@Robinlemon no problem :) usually you'd wait until it's been up a week or so, the top answer currently will probably win but it's possible someone might pull something crazy. Nice challenge for your first one :)

Nice 1st challenge. A couple of points: 1. It's not clear from the spec or examples whether the rectangle should be filled or just an outline. People interpreted it as filled because that's easier, but in future you should consider the spec more carefully. Writing a good challenge is hard - you can post to our sandbox before feedback before posting on the main site https://codegolf.meta.stackexchange.com/q/2140/15599 2. trailing newline should be either OK or not OK. Least bytes is better. if I can do it shorter with trailing newline, saying "No trailing newline is better"  is a contradiction.

@LevelRiverSt Thanks for the tips, I do agree I did contradict myself, it was supposed to be filled and I didn't really think of that perspective! Will definitely use the sandbox.

SOGL, 5 bytes
Ƨ[]*∙

Simple:
Ƨ[]    push "[]"
   *   multiply horizontally (repeating width times)
    ∙  get an array with input (height) items of that
       implicitly output the array joined with newlines

Mathematica, 26 bytes
Grid@Table["[]",{#2},{#}]&

Does a Mathematica Grid object count as "a string with newline characters"?

MATL, 7 bytes
v&DiiX"

Try it online!
Explanation
v    % Concatenate the (non-existing) stack contents: gives []
&D   % String representation: gives '[]'
ii   % Take two inputs
X"   % Repeat those numbers of times vertically and horizontally. Implicit display

Pyth - 7 5 bytes
-2 bytes by a clever trick thanks to insert_name_here
VE*`Y

Try it here
Explanation:
VE*`Y
V      # Loop
 E     # <input> number of times
   `Y  # String representation of empty list (used to be "[]", but insert_name_here pointed out this shorter alternative)
  *    # repeat string implicit input number of times
       # implicit print

You can save 2 bytes by using \Y(string representation of empty list) instead of"[]"`.

@insert_name_here Ingenious!! I updated the answer.  Thanks for pointing that out!

Came up with this exact code independently. Nicely done.

C, 47 46 bytes
f(w,h){for(h*=w;h--;)printf(h%w?"[]":"[]\n");}

or
f(w,h){for(h*=w;h--;)printf("[]%c",h%w?0:10);}

My first code golf attempt, did I miss anything obvious?

There's this for 45, but it has a newline at the beginning: f(w,h){h*=w;while(h--)printf("\n[]"+!(h%w));}

That only works when width is 2.

So it does, my mistake

Great first golf! Welcome to the site!

Wouldn't using a for loop shorten the code even more?

@CoolGuy updated, thanks for the hint!

05AB1E, 6 bytes
F„[]×,

Try it online!
Explanation
Input takes as height, width
F         # height times do
 „[]      # push "[]"
    ×     # repeat width times
     ,    # print with newline

;#+, 197 bytes
>;;;;;;~++++++++:>~;;;;:>~*(-:~<~+-::>-:::<~<-+++++++++~:::<~+-:::>-::*)-::<-::::>-::(;)::>-::*(-:~<~+-::>-:::<~<-+++++++++~:::<~+-:::>-::*)-:<~<;;;;;-+>-:<-:-(-:::~<-:::(~<#<-;;-#~;)-:<#-::<;>-:-)

Try it online! Requires a zero byte after each input number.
I kinda don't know how this works. What I can tell you is that this part of the code:
 *(-:~<~+-::>-:::<~<-+++++++++~:::<~+-:::>-::*)-::<-::::>-::(;)::>-::*(-:~<~+-::>-:::<~<-+++++++++~:::<~+-:::>-::*)

is parsing the input numbers.

brainfuck, 145 bytes
+++++++++[>++++++++++<-]>+[>+>+<<-]>>++>,>+++++++++[<----->-]<--->>>,>+++++++++[<----->-]<--->++++++++++<[<<<[>+>+<<-]>[<<<.>.>>-]>[<<+>>-]>>.<-]

Try it online!
My first ever code golf! Yay!
The input is in ascii + 48, so in order to do 50, 50 you must input b, b (the ascii letters for 98)
Explanation
+++++++++[>++++++++++<-]>+ Get the opening square bracket into first position
[>+>+<<-] Get it into the second and third position
>>++ Get the third position to be the closing bracket
>
,>+++++++++[<----->-]<--- Get first number into fourth cell
>>>
,>+++++++++[<----->-]<--- Get second number into seventh cell
>++++++++++ get newline into 8th position
<

[ Start our height loop
<<<[>+>+<<-] Get the width into the fifth and sixth positions
>[ Start our width loop at the fifth position
<<<.>. Print the second and third positions
>>-] Decrement the fifth position
>
[<<+>>-] copy the sixth position into the fourth position
>>. print newline
<-]

Impressive. Welcome to the site! :)

Why is the input ASCII+48? You can save a lot of bytes by just using ASCII+0 input (possibly linking to the ASCII+48 version for usability)

I just wanted to meet the criteria for input, @calculatorFeline

...Oh right. :|

J, 12 bytes
'[]'$~],+:@[

Try it online!
Explanation
'[]'$~],+:@[   input: y, x
        +:@[   double y
      ],       pair with x
               this gives (x, 2y)
    $~         shape the left argument into the right argument's shape
'[]'           2-length character string

This gives us an x by 2y string of repeating [] characters.

11 bytes

Python 2.7, 32 bytes
Full program:
n,m=input()
exec"print'[]'*n;"*m

Try it online!

Jelly, 7 bytes
ẋ⁾[]ẋ$Y

A dyadic link returning a list of characters (or a full program printing the result).
Try it online!
How?
ẋ⁾[]ẋ$Y - Main link: number w, number h          e.g. 2, 3
ẋ       - repeat w h times                            [2,2,2]
     $  - last two links as a monad:
 ⁾[]    -   literal ['[',']'],                        "[]"
    ẋ   -   repeat list (vectorises)                  ["[][]","[][]","[][]"]
      Y - join with newlines                          "[][]\n[][]\n[][]"
        - if a full program, implicit print

PowerShell, 25 Bytes
param($w,$h),("[]"*$w)*$h

-3 thanks to Mathias!

You can shorten it to 25 like so: param($w,$h),("[]"*$w)*$h

Japt, 13 12+1= 14 13 bytes
+1 for the -R flag.
"[]"pN× òU*2

Try it online

1 byte saved thanks to obarakon.

Being a little drunk can sometimes help your programming skills though :P

@ETHproductions: the very cartoon I was looking for but was too drunk to find!

Haha, hope you guys are having a fun night. fyi, U*V can be shortened to N×

@obarakon: That's 2 opportunities to work with N last night. Never drink & golf, kids!

Retina, 32 bytes
.+
$*
1(?=1*(¶1+))|.
$1
G`1
1
[]

Try it online! Takes height and width input on separate lines.

Charcoal, 8 7 bytes
ＥＮ×[]Ｉη

Try it online! Link is to verbose version of code. Takes input in the order height, width. Charcoal's drawing primitives aren't suited to this, so this just takes the easy way out and repeats the [] string appropriately. Explanation:
 Ｎ      First input as a number
Ｅ       Map over implcit range
      η Second input
     Ｉ  Cast to number
   []   Literal string
  ×     Repeat
        Implicitly print on separate lines

Well it has drawing primitives for this but still 8 bytes :P

@ASCII-only Sorry, I didn't realise that Oblong worked on arbitrary strings. Neat!

@ASCII-only Oh, and what's the verbose name of the predefined empty string variable?

It's w, name, greek to verbose

@ASCII-only Then what am I doing wrong here: Try it online!

Oops sorry for some reason I left out w in the parser, will fix ASAP

Let us continue this discussion in chat.

Python 3, 26 bytes
lambda n,m:('[]'*n+'\n')*m

Try it online!

V, 7 bytes
Ài[]<esc>ÀÄ

where <esc> is 0x1b.
Try it online!
Explanation
Ài[]<esc>                    " arg1 times insert []
         ÀÄ                  " arg2 times duplicate this line

Ohm, 9 bytes
M"[]"┘ÄJ,

Try it online!
Explanation
M"[]"┘ÄJ,
M         //Executes code input1 times
 "[]"     //Pushes []
     ┘Ä   //Duplicates [] input2 times
       J  //Joins the stack
        , //Prints with a trailing newline

APL (Dyalog), 11 bytes
'[]'⍴⍨⊢,2×⊣

Try it online!
'[]' the string
⍴⍨ cyclically repeated to fill the shape
⊢ right argument (rows)
, and
2× twice
⊣ the left argument (columns)

Bash, 55 bytes
seq $(($1*$2))|sed s/.*/[]/|tr -d "
"|fold -w $(($1*2))

Try it online! Uses the TIO flavor of bash, since I run windows.

I don't think this works for multi-digit numbers

@KritixiLithos It should work now

Japt, 7 bytes
6 bytes of code, +1 for the -R flag.
VÆç"[]

Doesn't work in the latest version due to a bug with ç, but it does work in commit f619c52. Test it online!
Explanation
VÆ   ç"[]
VoX{Uç"[]"}  // Ungolfed
             // Implicit: U, V = input integers
VoX{      }  // Create the range [0...V) and replace each item X with
    Uç"[]"   //   U copies of the string "[]".
-R           // Join the result with newlines.
             // Implicit: output result of last expression

R, 70 bytes
p=paste
function(w,h)p(rep(p(rep('[]',w),collapse=''),h),collapse='
')

Try it online!
Returns an anonymous function that constructs and returns the string.
45 bytes, non-conforming
function(w,h)write(matrix('[]',w,h),'',w,,'')

An anonymous function that prints out the string in the desired format.
Try this online

Go, 74 bytes
import."strings"
func(x,y int)string{return Repeat(Repeat("[]",x)+"\n",y)}

Try it online!

QBIC, 14 bytes
[:|?[:|?@[]`';

Explanation:
[:|     FOR a = 1 to (read input from cmd line)
?       PRINT a newlne
[:|     FOR c = 1 to (read input from cmd line)
?@[]`   PRINT A$ (containing the box)
';         and inject a semicolon in the compiled QBasic code to suppress newlines

This takes its arguments in the order of #rows, #cols. Output starts with a newline.

JavaScript (ES6), 43 36 bytes
From the comments, a trailing newline is now permitted.
w=>h=>("[]".repeat(w)+`
`).repeat(h)

Try it

f=
w=>h=>("[]".repeat(w)+`
`).repeat(h)
oninput=_=>o.innerText=f(+i.value)(+j.value);o.innerText=f(i.value=2)(j.value=2)
*{font-family:sans-serif;}
input{margin:0 5px 0 0;width:50px;}
<label for=i>w: </label><input id=i type=number><label for=j>h: </label><input id=j type=number><pre id=o>

Pyke, 8 bytes
}A;**"[]

Try it here!
Also 8 bytes:
 F2K*"[]

Try it here!

C#, 78 bytes
(w,h)=>"".PadLeft(h).Replace(" ","".PadLeft(w).Replace(" ","[]")+'\n').Trim();

Run in C# Pad
This is shorter than with for-loops and I'm not aware of any function in C# which can repeat with less code.

CJam, 10 bytes
l~"[]"*N+*

J, 11 bytes
,./@$'[]'"0

Try it online!

Canvas, 4 bytes
[]×＊

Try it here!

Vyxal j, 6 5 bytes
ƛk[⁰*

Try it Online!
Takes height then width.
-1 thanks to lyxal.
ƛ      # map 0...(height) to...
 k[    # `[]`
    *  # repeated...
   ⁰   # (width)
    *  # times
       # (j flag) join by newlines

5 bytes (dw, you didn't miss the k[ constant ;p)

Tcl, 50 bytes
proc B w\ h {time {puts [string repe {[]} $w]} $h}

Try it online!

R, 49 bytes
s=scan;cat(rep(c(rep("[]",s()),"\n"),s()),sep="")

Ungolfed :
s=scan # Creates an alias for the scan function

cat( # Prints to STDOUT
    rep( # The repetion of the following string :
        c(rep("[]",s()),"\n"), # "[]" repeated the number of times inputed by the user, followed by a linebreak
    s()), # This number of time (again, user inputed)
sep="") # with no separator

Perl 5, 19 bytes
say for('[]'x<>)x<>

Try it online!

Zsh, 31 bytes
repeat $1 S+=[]
repeat $2 <<<$S

Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Map inputted ASCII characters

Be sure to see the other challenge, Reverse ASCII character map!

The ASCII charset (American Standard Code for Information Interchange) is the most widely-used character encoding standard. ASCII codes represent text in computers, telecommunications equipment, and other devices.
Challenge
Your challenge is to print a mapping of the ASCII character set as the user inputs them.  GIF:

After the user enters every ASCII character, the output should look like this:

Mapping
Each character has an assigned position on a 16x6 logical grid, starting with the space character in the top left position, and wrapping such that the digit 0 appears below it.
When printable ASCII input is received, print that ASCII character at its assigned screen location without deleting any of the characters currently onscreen.
Rules

Your program only needs to map out the printable ASCII characters, 0x20 to 0x7E.
Your program must not terminate and continue to map characters to the screen until all printable ASCII characters have been inputted. From here, your program can either terminate or run off into Neverland.
Your program can map characters any way you like, e.g. to a spreadsheet, table, console window, or a graphical window.
No matter how you display the mapping, it 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.

Help
Here is the pseudocode algorithm I used to generate the GIF:
loop forever
    c = input
    y_coord = c / 16
    x_coord = c - y * 16
    if c is printable
        print c at (x_coord * 2 + 1, y_coord + 1)
    end if
end loop

There may be another way to achieve the required output. You can choose to use my algorithm or your own, but the output must be the same regardless.
Here's a useful ASCII table reference.
Scoring
The answer with the least bytes in each language wins. Have fun!

Do we need to have spaces between the characters?

@musicman523 Yep, those are necessary. The output must look exactly as shown in the screenshots.

Are we allowed to assume the terminal's background color?

Is clearing the terminal, then redrawing the updated table for each char acceptable?

@DigitalTrauma - Redrawing each time is acceptable - I asked in the Sandbox post

@totallyhuman yes, that's allowed. You don't have to do any sort of color changing.

Can we assume that nothing but printable ASCII chars will be given as input?

@ETHProductions yes, that's all right.

Can there be a prepending space on each line?

Can we substitute characters in languages that don't support all printable ASCII characters?

QBIC, 53 57 bytes
Added 4 bytes for the spacing.
{locate 7,1┘_?┘i=asc(A)┘locate i/16-1,(i%16+1)*2┘?chr$(i)

QBIC began development as a shorthand for QBasic, so I thought translating my QBasic answer would demonstrate this nicely. We've saved some 40% in the byte-count for a functionally identical program - and that's even when LOCATE, ASC, and CHR have no QBIC-functions yet. Fortunately, QBIC can pass code directly to QBasic to compensate for this. A side-by-side:
QBIC              QBASIC
------------      ------------
{                 DO
locate 7,1        LOCATE 7,1
                  note that the lower-case alphabet is left unaltered in QBIC.
_?                LINE INPUT A$  (LINE INPUT used instead of INPUT to handle comma's)
i=asc(A)          i=ASC(A$)
locate i/16-1     LOCATE i/16-1
   ,(i%16+1)*2       ,(i MOD 16+1)*2
?chr$(i)          ?CHR$(i)
                  LOOP   (implicitly added to QBIC at EOF)

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`
`)

It's so unbelievably satisfying to just mash the keyboard...

"so unbelievably satisfying to just mash the keyboard" may or may not have been what I was going for. +1

And yes, you can assume only printable ASCII is given. I'm pretty sure that's rule #1.

Can't you just use prompt() within a loop? It will save you from all the event handling and HTML. OP seems to allow it. See the Mathematica post's comments.

Only handles printable ASCII; subtract 7 bytes if we can assume only printable ASCII is given That does not seem to make sense. If it only handles printable ASCII, then how can assuming printable ASCII save any bytes?

You should be able to just use onkeypress by itself, allowing you to drop the body tag. Also, the pre tag can be shortened to just
 in order for it to work in a Snippet.

Couple more: Would onkeyup work? innerText saves a couple of bytes over textContent.

@Arjun That would work, but it would lead to a totally different solution than mine. Feel free to write one yourself if you'd like.

@Arjun Because the shorter version will e.g. replace E with Enter if the Enter key is pressed. Sorry if I worded it a little confusingly, I was quite tired when I posted this last night...

Thanks @Shaggy, I didn't know there were global event handlers. Both onkeyup and onkeydown register the Shift key as its own event, so that won't really work...

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

QBasic beats everyone! Wow!

@Arjun You kids and your Java...

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:

The first time I see that Java has a chance in code golf, too ! Nice !

+1, never seen readPassword() used like that. Oh, and you seem to be missing a semi-colon after the println. Also, isn't is possible to use System.out.printf somehow instead of System.out.println(String.format(? And you can change ()-> to o-> by using an unused empty parameter.

@KevinCruijssen Fixed, thanks!

BrainFuck, 355 Bytes
>>++++[->++++[->+>++++++<<]<]>>->[-<[-<<<<++++[->++++++++<]]>>>[<<<<<++++++++[->>++<<<+>]>>-<<<++>>]<<[>>>>>>[>>>]>+<<<<<[<<<]<<-]>>>>>>[>>>]++++[-<++++++++>]>[-<+>]<<[<<<]>>]<[-]<<,[[->+>+<<],[-]++++[->>--------<<]>>[>>>>[>>>]+[<<<]<-]>>>>[>>>]<<[-]<[<<<]<<[>>>>>[>>>]<<+<[<<<]<<-]>>>>>[>>>]<<<[[-]<<<]>[.>.>>]++++++++++[->+>++<<]>>[-<.>]<[-]<<<<[<<<]<,]

BrainFuck's options are pretty limited, so output is in the terminal and the screen is "cleared" with 20 newlines. Input should be the ASCII characters, separated by newlines.
Try it online!
Formatted and Documented
These are the debug notes I used to write the program. I used my interpreter which can optionally print the state of the tape at every '~' character for debugging.
[
    run.bf
    codegolf.stackexchange.com/questions/124306/map-inputted-ascii-characters
]

[
    Calculate 16 * 6
    Resulting tape state:
    [0 0 0 0 0 0 16 96 0 0 0 0 ...]
               ^
    Note that, to obtain a 16-by-6 grid, the 16
    immediately to the right is decreased to 15
    (since we will decrease it by 1 each loop
    until we reach 0 and immediately reset)
]
>>>>++++[->++++[->+>++++++<<]<]>~

[
    Our next goal is to make 96 sets of 3 cells each in the pattern [C D 0]
    The first cell will represent an entered character--when the corresponding
    input on the keyboard is pressed, it will change to the entered key.
    The first cell is initialized to 32 (' ').

    The second cell will represent the delimiter after that character.
    Every 16 cells, this should be 10 for '\n'. Otherwise, it should be 32 for ' '.

    The third cell is a buffer cell, used for traversal of the grid. In general,
    it should be only temporarily modified and then reset to 0.
]

>->[-<
    [
       -<<<<++++[->++++++++<]
       [
           The second cell of our 3-set should be 32, so the above line
           writes 32 to the 3rd cell from the beginning of the tape (0-indexed)
       ]
    ]
    >>>
    [
       <<<[ The second cell of our 3-set should be 10, and we must reset the line counter ]
       <<++++++++[->>++<<<+>]>>-<<<++>>
    ]

    [ At this point, the delimiting cell we need is two cells to the left. ]
    <<[>>>>>>[>>>]>+<<<<<[<<<]<<-]

    >>>>>>[>>>]++++[-<++++++++>]
    [ Debug Mode: In the previous loop, add a + in the string of 8 +'s to get visible spaces in the grid ($-signs) ]
    >[-<+>]<<[<<<]>>
]

[ Go back to the beginning of the tape and clear up the residual '15' ]
<[-]~

<<,

[
    [->+>+<<],[-]++++[->>--------<<]

    [
        Take input such that the state of the tape now looks like this:
        [0 0 0 0 0 c c-32 0 32 32 0 32 32 0 32 32 0 ...]
                 ^
        Where 'c' was the entered character.
        We now set up 1's in the buffer zones of the first c-32
        3-sets and clear the character that is currently there.
        All that is left, then, is to copy c to that location.
    ]

    [ Set up the row of 1's. ]
    >>[>>>>[>>>]+[<<<]<-]

    [ Clear the current character. ]
    >>>>[>>>]<<[-]~<[<<<]

    [ Copy the new character. ]
    <<[>>>>>[>>>]<<+<[<<<]<<-]

    [ Clean up the 1's. ]
    >>>>>[>>>]~<<<[[-]<<<]

    [ Print the grid. ]
    >[.>.>>]~

    [ Print a bunch of newlines ]
    ++++++++++[->+>++<<]>>[-<.>]<[-]

    [ Take a new input. ]
    <<<<[<<<]<,
]

Mathematica, 108 bytes
a=" "~Table~16~Table~6;Dynamic@Grid@a
((a[[⌊#/16⌋-1,#~Mod~16+1]]=i)&@ToCharacterCode[i=Input[]];#0[])&[]

Try it online at https://sandbox.open.wolframcloud.com/
When you paste code and press Shift+Enter, a dialog box will pop up, you enter "a" for example for character a. The program runs forever.
Note: On Wolfram sandbox, the font is formatted differently from that in Mathematica in my computer. So the line/column spacing may looks weird.

Does this continually map out every character? I.e. do you have to run it more than once to see the desired output?

You run it once, and each time you press OK of an input box, another input box appear for you to enter input.

Sounds valid then, thanks. Nice job!

I think i = ToString@Input[]] would be more convinient.Users should just type a and not "a"

or better i=InputString[]

@Jenny_mathy Unfortunately, they are longer.

@Jenny_mathy this won't work e.g. for #: you'll get #1 as the string, which will break things.

I just tried to enter # instead of "#" and got #1 in four cells with ToString@Input[].

@Ruslan Yes, I forgot that. But InputString[] does work.

Python 2, 115 bytes
s='\n'.join([' '*31]*6)
while 1:
 c=input();i=ord(c)
 if 31<i<128:i-=32;i=i%16*2+i//16*32;s=s[:i]+c+s[i+1:];print s

Try it online!
Requires quotation marks (single or double) around the inputted characters (the TIO version does not).

You can change raw_input to input as it is community census that you can assume the input has quotes around it if needed.

Sounds good! When I was testing I was just entering keys, and it was unhappy that I was entering { without a matching }.

str, noncompeting, 18 bytes
Presenting my new semi-esoteric language.
#C;dby16#/~2-~u#pq

#C;dby16#/~2-~u#pq
..;                   preamble
#C                    clear screen
   ...............    main program; each character is pushed to the stack before
   d                  duplicate
    b                 buffer the character
     y                convert to character code
      16#/            divmod by 16 (a / b, a % 6)
          ~2-~        subtract a / b by 2
              u       unbuffer the character
               #p     place that character in the given position
                 q    "quiet"; disable auto-printing

I don't see spaces between the characters...

@MDXF The spec says nothing about spaces in between characters. Not to mention there are plenty of answers that don't use spaces.

Haskell, 133 bytes
p=putStr.("\27["++)
g l=do c<-getChar;p"2J";mapM h(c:l);g(c:l)
h c|(y,x)<-divMod(fromEnum c)16=p$show y++';':show(2*x+1)++'H':[c]
g[]

Requires a terminal that understands ANSI escape sequences.
It's shorter to keep a list of all keys pressed so far and clearing the screen before printing all of them each round than turning off the echo in the terminal session. The latter needs import System.IO and hSetEcho stdin(2<1) which costs too many bytes.

C, 101 bytes
c,y,x;f(){while(~(c=getchar()))printf("\e[1;20H"),y=c/16,x=c-y*16,printf("\e[%d;%dH%c",y+1,x*2+1,c);}

This was the program I used to make the graphics. Output is as shown in the GIF. ;)

85 bytes

Building on @ceilingcat, 83 bytes

QBasic, 62 58 bytes
a=ASC(INPUT$(1))
LOCATE a\16-1,1+2*(a MOD 16)
?CHR$(a)
RUN

Tested with QB64. Should work fine on regular QBasic, too, although you may want to modify it to do a CLS on the first run.
Similar to steenbergh's answer, but uses INPUT$(1) to read characters one at a time. This approach is shorter and also displays no prompt. It also uses RUN for the infinite loop, since we don't have to store any state between iterations except the state of the screen.

Wow, nice. Didn't know about input$(). I like the TIPS-topic too btw.

Ruby, 79 75 71 + 13 = 84 bytes
+13 bytes for -rio/console flag.
loop{$/+=STDIN.getch
97.times{|n|print$/[(n+31).chr]||" ",["
"][n%16]}}

Ungolfed
loop {
  $/ += STDIN.getch
  97.times {|n|
    print $/[(n+31).chr] || " ", ["
"][n%16]
  }
}

Pascal, 112 chars
Uses crt;var c:char;Begin ClrScr;repeat c:=ReadKey;GotoXY(ord(c)and$F*2+1,ord(c)shr 4-1);write(c);until 1<0;End.

As my Mathematica solution takes many bytes in div, mod and ToCharacterCode[Input[]], I try making another answer with Pascal. But without ClrScr my compiler (FPC) left some compile information on the screen. ClrScr; takes 7 bytes.
The *2 used for proper spacing takes another 2 bytes.

LOGO, 90 bytes
cs
rt 90
keyboardon[invoke[setxy 30*modulo ? 16 -30*int ?/16 label char ?]keyboardvalue]pu

Try it on FMSLogo.
After all, my Logo solution is the shortest, compared with my Mathematica and Pascal answer.
Add 3 bytes if the turtle is required to be hidden.

6502 machine code + Apple //e ROM, 31 bytes
Hex dump:
8000- 20 58 FC 20 0C FD 48 38
8008- E9 A0 48 29 0F 0A 85 24
8010- 68 4A 4A 4A 4A 20 5B FB
8018- 68 20 ED FD 4C 03 80

Commented assembly:
 1 HTAB     =     $24        ; HORIZONTAL POSITION OF CURSOR
 2 SETVTAB  =     $FB5B      ; SETS VERTICAL POSITION OF CURSOR FROM ACC
 3 COUT     =     $FDED      ; OUTPUTS CHARACTER IN ACC
 4 HOME     =     $FC58      ; CLEARS SCREEN
 5 RDKEY    =     $FD0C      ; GETS CHARACTER FROM KEYBOARD, STORES IN ACC
 6          ORG   $8000
 7          JSR   HOME
 8 GETINP   JSR   RDKEY
 9 * POSITION CURSOR
10          PHA              ; PRESERVE ACC
11          SEC              ; MAKE SURE CARRY IS SET TO SUBTRACT
12          SBC   #" "       ; SUBTRACT CHAR CODE OF SPACE
13          PHA              ; SAVE ACC
14          AND   #$0F       ; GET LOWER 4 BITS TO GET CURSOR X POSITION
15          ASL              ; SHIFT LEFT TO MAKE SPACES BETWEEN CHARS
16          STA   HTAB
17          PLA              ; GET OLD ACC
18          LSR              ; SHIFT HIGH NIBBLE
19          LSR              ; INTO LOW NIBBLE
20          LSR              ; TO GET CURSOR Y POSITION
21          LSR
22          JSR   SETVTAB
23          PLA              ; RESTORE ACC
24 *
25          JSR   COUT
26          JMP   GETINP

If the cursor invalidates it, here's a 36-byte version without a cursor:
8000- 20 58 FC AD 00 C0 10 FB
8008- 8D 10 C0 48 38 E9 A0 48
8010- 29 0F 0A 85 24 68 4A 4A
8018- 4A 4A 20 5B FB 68 20 ED
8020- FD 4C 03 80

SmileBASIC 3, 82 bytes
CLS
@L
C$=INKEY$()IF""!=C$THEN V=ASC(C$)-32LOCATE V MOD 16*2,V DIV 16*2?C$;
GOTO@L

In the SmileBASIC character set, ¥ is located where \ normally would be; hopefully this doesn't invalidate this answer completely.

Japt, 63 43 bytes
Seeing as I apparently have a reputation for making Japt do things it shouldn't be able to do (continuous input, in this case), golfing from my my phone, and golfing with a feed of beer inside me, it's high time I combined all 3 of those things!
;$oninput=$@OqE¬ËoOx`Í*s.value` 1Ãú ò16 m¸·

Test it (just start typing in the "Notes" field)

sooo.. How do we use this?

Just start typing in the input field, @Razetime.

Applesoft BASIC, 134 bytes
0TEXT:HOME:PR#0
1C=PEEK(49152):POKE49168,0:HTAB1:VTAB20:NORMAL:IFC>=128THENC=C-128:INVERSE
4Y=INT(C/16):X=C-Y*16:HTABX*2+1:VTABY+1:IFC>=32THEN PRINTCHR$(C):IFC<32THEN PRINTCHR$(127)
9GOTO1

This is a golfed version of the Apple ][ keyboard test, the program that inspired the challenge.

This is actually 134 bytes, since Applesoft BASIC is tokenized.

@insert_name_here Ah, yes. Thanks.

8086 machine code, MS-DOS .COM, 27 bytes
Runnable in DOSBox. The only assumption about register starting values is AH = 0, which is true for most DOS isotopes. This, and the fact that only BIOS interrupts are used, means it can be run from a boot sector by changing the first instruction to mov ax, 3 (and the org of course) at the terrible, terrible cost of one byte.
Expects only printable ASCII characters as input. Does not terminate.
Binary
00000000 : B0 03 CD 10 31 C0 CD 16 50 2C 20 D4 10 D0 E0 92 : ....1...P, .....
00000010 : B4 02 CD 10 58 B4 0E CD 10 EB E9                : ....X......

Assembly
org 0x100
cpu 8086

    mov al, 3       ; Set video mode to 80x25 text
    int 0x10        ; Has the desired side-effect of clearing the screen

main_loop:
    xor ax, ax      ; Read keystroke into AX
    int 0x16        ; AH = scan code, AL = ASCII

    push ax         ; Save ASCII code for later
    sub al, 32      ; Make ASCII code into range 0..94
    aam 0x10        ; AH = AL / 16 (row), AL = AL % 16 (col)
    shl al, 1       ; Double column for spacing

    xchg ax, dx     ; Move cursor to proper position
    mov ah, 2
    int 0x10

    pop ax          ; Retrieve ASCII code
    mov ah, 0x0e    ; Output at cursor position
    int 0x10

    jmp main_loop