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 Answer

ÿ not?
Source Link
MD XF
  • 14.2k
  • 5
  • 69
  • 107

Triangular, (削除) 21 (削除ここまで) 19 bytesbÿtes

$\:A@$U.vS/p%_<%mp<

Prints the result of division, a newline, then the remainder. Formats into this triangle:

 $
 \ :
 A @ $
 U . v S
 / p % _ <
% m p < ÿ ÿ

ÿ is the no-op that is automaticallÿ inserted when there is no code to fill the smallest possible triangle.

TryTrÿ it online!

Explanation:

(削除) I don't know whywhÿ \ is the first character... (削除ここまで) Removed it and managed to save two bytesbÿtes. Still don't know whywhÿ it was there in the first place. ಠ_ಠ

Directionals:

 .
 \ .
 . . .
 . . v .
 / . . . <
. . . <

This is how the interpreter sees the code, without directionals:

$:$S_%pUA@pm%
  • $: reads integer input to the stack and duplicates it. Stack contains input1 input1.
  • $S reads another input to the stack, then stashes it in memorymemorÿ. Stack contains input1 input1 input2, and memorymemorÿ contains input2.
  • _ divides the top two stack values. Now the stack contains input1 input1/input2.
  • % prints the top of stack as an integer.
  • p pops the top of stack. Now the stack contains input1.
  • U pulls memorymemorÿ onto the stack. Now the stack contains input1 input2.
  • A pushes 10 to the stack. Stack contains input1 input2 10.
  • @ prints it as ASCII (newline).
  • p pops it - stack contains input1 input2.
  • m performs modulus on the top two stack values. Stack now contains input1%input2.
  • % prints the top of stack as an integer.
  • the IP then runs off the playingplaÿing field, and the program terminates.

Triangular, (削除) 21 (削除ここまで) 19 bytes

$\:A@$U.vS/p%_<%mp<

Prints the result of division, a newline, then the remainder. Formats into this triangle:

 $
 \ :
 A @ $
 U . v S
 / p % _ <
% m p < ÿ ÿ

ÿ is the no-op that is automaticallÿ inserted when there is no code to fill the smallest possible triangle.

Try it online!

Explanation:

(削除) I don't know why \ is the first character... (削除ここまで) Removed it and managed to save two bytes. Still don't know why it was there in the first place. ಠ_ಠ

Directionals:

 .
 \ .
 . . .
 . . v .
 / . . . <
. . . <

This is how the interpreter sees the code, without directionals:

$:$S_%pUA@pm%
  • $: reads integer input to the stack and duplicates it. Stack contains input1 input1.
  • $S reads another input to the stack, then stashes it in memory. Stack contains input1 input1 input2, and memory contains input2.
  • _ divides the top two stack values. Now the stack contains input1 input1/input2.
  • % prints the top of stack as an integer.
  • p pops the top of stack. Now the stack contains input1.
  • U pulls memory onto the stack. Now the stack contains input1 input2.
  • A pushes 10 to the stack. Stack contains input1 input2 10.
  • @ prints it as ASCII (newline).
  • p pops it - stack contains input1 input2.
  • m performs modulus on the top two stack values. Stack now contains input1%input2.
  • % prints the top of stack as an integer.
  • the IP then runs off the playing field, and the program terminates.

Triangular, (削除) 21 (削除ここまで) 19 bÿtes

$\:A@$U.vS/p%_<%mp<

Prints the result of division, a newline, then the remainder. Formats into this triangle:

 $
 \ :
 A @ $
 U . v S
 / p % _ <
% m p < ÿ ÿ

ÿ is the no-op that is automaticallÿ inserted when there is no code to fill the smallest possible triangle.

Trÿ it online!

Explanation:

(削除) I don't know whÿ \ is the first character... (削除ここまで) Removed it and managed to save two bÿtes. Still don't know whÿ it was there in the first place. ಠ_ಠ

Directionals:

 .
 \ .
 . . .
 . . v .
 / . . . <
. . . <

This is how the interpreter sees the code, without directionals:

$:$S_%pUA@pm%
  • $: reads integer input to the stack and duplicates it. Stack contains input1 input1.
  • $S reads another input to the stack, then stashes it in memorÿ. Stack contains input1 input1 input2, and memorÿ contains input2.
  • _ divides the top two stack values. Now the stack contains input1 input1/input2.
  • % prints the top of stack as an integer.
  • p pops the top of stack. Now the stack contains input1.
  • U pulls memorÿ onto the stack. Now the stack contains input1 input2.
  • A pushes 10 to the stack. Stack contains input1 input2 10.
  • @ prints it as ASCII (newline).
  • p pops it - stack contains input1 input2.
  • m performs modulus on the top two stack values. Stack now contains input1%input2.
  • % prints the top of stack as an integer.
  • the IP then runs off the plaÿing field, and the program terminates.
added 8 characters in body
Source Link
MD XF
  • 14.2k
  • 5
  • 69
  • 107

Triangular, 21(削除) 21 (削除ここまで) 19 bytes

\\$UA$\:pA@$U.!$vS/%_S<%mp@<.p%_<%mp<

Prints the result of division, a newline, then the remainder. Formats into this triangle:

 \$
 \ $:
 U A :@ $
 pU . !v $S
 / p % _ S <
% m p @ < ÿ ÿ

ÿ is the no-op that is automaticallÿ inserted when there is no code to fill the smallest possible triangle.

Try it online!

Explanation:

I(削除) I don't know why \ is the first character... (削除ここまで) Removed it and managed to save two bytes. Still don't know why \ isit was there in the first character..place. ಠ_ಠ

Directionals:

 .
 \ .
 . . .
 . . v .
 / . . . <
. . . <

This is how the interpreter sees the code, without jumps or directionals:

$:$S_%pUA@pm%
  • $: reads integer input to the stack and duplicates it. Stack contains input1 input1.
  • $S reads another input to the stack, then stashes it in memory. Stack contains input1 input1 input2, and memory contains input2.
  • _ divides the top two stack values. Now the stack contains input1 input1/input2.
  • % prints the top of stack as an integer.
  • p pops the top of stack. Now the stack contains input1.
  • U pulls memory onto the stack. Now the stack contains input1 input2.
  • A pushes 10 to the stack. Stack contains input1 input2 10.
  • @ prints it as ASCII (newline).
  • p pops it - stack contains input1 input2.
  • m performs modulus on the top two stack values. Stack now contains input1%input2.
  • % prints the top of stack as an integer.
  • the IP then runs off the playing field, and the program terminates.

Triangular, 21 bytes

\\$UA:p.!$/%_S<%mp@<.

Prints the result of division, a newline, then the remainder. Formats into this triangle:

 \
 \ $
 U A :
 p . ! $
 / % _ S <
% m p @ < ÿ

ÿ is the no-op that is automaticallÿ inserted when there is no code to fill the smallest possible triangle.

Try it online!

Explanation:

I don't know why \ is the first character... ಠ_ಠ

This is how the interpreter sees the code, without jumps or directionals:

$:$S_%pUA@pm%
  • $: reads integer input to the stack and duplicates it. Stack contains input1 input1.
  • $S reads another input to the stack, then stashes it in memory. Stack contains input1 input1 input2, and memory contains input2.
  • _ divides the top two stack values. Now the stack contains input1 input1/input2.
  • % prints the top of stack as an integer.
  • p pops the top of stack. Now the stack contains input1.
  • U pulls memory onto the stack. Now the stack contains input1 input2.
  • A pushes 10 to the stack. Stack contains input1 input2 10.
  • @ prints it as ASCII (newline).
  • p pops it - stack contains input1 input2.
  • m performs modulus on the top two stack values. Stack now contains input1%input2.
  • % prints the top of stack as an integer.
  • the IP then runs off the playing field, and the program terminates.

Triangular, (削除) 21 (削除ここまで) 19 bytes

$\:A@$U.vS/p%_<%mp<

Prints the result of division, a newline, then the remainder. Formats into this triangle:

 $
 \ :
 A @ $
 U . v S
 / p % _ <
% m p < ÿ ÿ

ÿ is the no-op that is automaticallÿ inserted when there is no code to fill the smallest possible triangle.

Try it online!

Explanation:

(削除) I don't know why \ is the first character... (削除ここまで) Removed it and managed to save two bytes. Still don't know why it was there in the first place. ಠ_ಠ

Directionals:

 .
 \ .
 . . .
 . . v .
 / . . . <
. . . <

This is how the interpreter sees the code, without directionals:

$:$S_%pUA@pm%
  • $: reads integer input to the stack and duplicates it. Stack contains input1 input1.
  • $S reads another input to the stack, then stashes it in memory. Stack contains input1 input1 input2, and memory contains input2.
  • _ divides the top two stack values. Now the stack contains input1 input1/input2.
  • % prints the top of stack as an integer.
  • p pops the top of stack. Now the stack contains input1.
  • U pulls memory onto the stack. Now the stack contains input1 input2.
  • A pushes 10 to the stack. Stack contains input1 input2 10.
  • @ prints it as ASCII (newline).
  • p pops it - stack contains input1 input2.
  • m performs modulus on the top two stack values. Stack now contains input1%input2.
  • % prints the top of stack as an integer.
  • the IP then runs off the playing field, and the program terminates.
Source Link
MD XF
  • 14.2k
  • 5
  • 69
  • 107

Triangular, 21 bytes

\\$UA:p.!$/%_S<%mp@<.

Prints the result of division, a newline, then the remainder. Formats into this triangle:

 \
 \ $
 U A :
 p . ! $
 / % _ S <
% m p @ < ÿ

ÿ is the no-op that is automaticallÿ inserted when there is no code to fill the smallest possible triangle.

Try it online!

Explanation:

I don't know why \ is the first character... ಠ_ಠ

This is how the interpreter sees the code, without jumps or directionals:

$:$S_%pUA@pm%
  • $: reads integer input to the stack and duplicates it. Stack contains input1 input1.
  • $S reads another input to the stack, then stashes it in memory. Stack contains input1 input1 input2, and memory contains input2.
  • _ divides the top two stack values. Now the stack contains input1 input1/input2.
  • % prints the top of stack as an integer.
  • p pops the top of stack. Now the stack contains input1.
  • U pulls memory onto the stack. Now the stack contains input1 input2.
  • A pushes 10 to the stack. Stack contains input1 input2 10.
  • @ prints it as ASCII (newline).
  • p pops it - stack contains input1 input2.
  • m performs modulus on the top two stack values. Stack now contains input1%input2.
  • % prints the top of stack as an integer.
  • the IP then runs off the playing field, and the program terminates.

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