Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

2 of 4
Added total byte count
Not a tree
  • 3.2k
  • 1
  • 13
  • 24

><>, 1 byte per line, 243 bytes

2D languages FTW! Although writing loops and ifs using goto instructions instead of the 2D structure is not fun.

v
1
:
f
%
&
0
4
a
*
1
+
&
?
.
~
~
"
e
i
P
e
l
p
p
A
"
o
o
o
o
o
o
o
o
0
a
a
*
7
+
.
:
5
%
&
0
7
a
*
1
+
&
?
.
~
~
"
e
i
P
"
o
o
o
0
a
a
*
7
+
.
:
3
%
&
0
a
a
*
5
+
&
?
.
~
~
"
e
l
p
p
A
"
o
o
o
o
o
0
a
a
*
7
+
.
:
n
:
{
:
}
=
?
;
a
o
1
+
0
1
.

Try it online, or watch it at the fish playground!

The fish swims downward in the first column, 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 meets 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.

Not a tree
  • 3.2k
  • 1
  • 13
  • 24

AltStyle によって変換されたページ (->オリジナル) /