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

added 368 characters in body
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

Charcoal, (削除) 1618 (削除ここまで) 911 bytes

(削除) 16 (削除ここまで) 9 bytes if trailing whitespaces were allowed: try it online .

WS«P↘ιM3↓UTWS«P↘ιM3↓

My first Charcoal answer. Thanks to @DLosc for suggestion P and M instead of using S and J (Jump) to go back to the start of the line (and three down).

Try it online (verbose) Try it online (verbose) or Try it online (pure) Try it online (pure).

Explanation:

Disable trailing spaces in the output:

ToggleTrim();
UT

Loop while there is still a next input-string:

While(InputString()){ ... }
WS« ...

Print this string without moving the cursor in a down-right direction:

Multiprint(:DownRight, i);
P↘ι

And then move three positions down for the next iteration:

Move(3, :Down);
M3↓

Charcoal, (削除) 16 (削除ここまで) 9 bytes

WS«P↘ιM3↓

My first Charcoal answer. Thanks to @DLosc for suggestion P and M instead of using S and J (Jump) to go back to the start of the line (and three down).

Try it online (verbose) or Try it online (pure).

Explanation:

Loop while there is still a next input-string:

While(InputString()){ ... }
WS« ...

Print this string without moving the cursor in a down-right direction:

Multiprint(:DownRight, i);
P↘ι

And then move three positions down for the next iteration:

Move(3, :Down);
M3↓

Charcoal, (削除) 18 (削除ここまで) 11 bytes

(削除) 16 (削除ここまで) 9 bytes if trailing whitespaces were allowed: try it online .

UTWS«P↘ιM3↓

My first Charcoal answer. Thanks to @DLosc for suggestion P and M instead of using S and J (Jump) to go back to the start of the line (and three down).

Try it online (verbose) or Try it online (pure).

Explanation:

Disable trailing spaces in the output:

ToggleTrim();
UT

Loop while there is still a next input-string:

While(InputString()){ ... }
WS« ...

Print this string without moving the cursor in a down-right direction:

Multiprint(:DownRight, i);
P↘ι

And then move three positions down for the next iteration:

Move(3, :Down);
M3↓
Commonmark migration
Source Link

#Charcoal , (削除) 16 (削除ここまで) 9 bytes

Charcoal , (削除) 16 (削除ここまで) 9 bytes

WS«P↘ιM3↓

My first Charcoal answer. Thanks to @DLosc for suggestion P and M instead of using S and J (Jump) to go back to the start of the line (and three down).

Try it online (verbose) or Try it online (pure).

Explanation:

Loop while there is still a next input-string:

While(InputString()){ ... }
WS« ...

Print this string without moving the cursor in a down-right direction:

Multiprint(:DownRight, i);
P↘ι

And then move three positions down for the next iteration:

Move(3, :Down);
M3↓

#Charcoal , (削除) 16 (削除ここまで) 9 bytes

WS«P↘ιM3↓

My first Charcoal answer. Thanks to @DLosc for suggestion P and M instead of using S and J (Jump) to go back to the start of the line (and three down).

Try it online (verbose) or Try it online (pure).

Explanation:

Loop while there is still a next input-string:

While(InputString()){ ... }
WS« ...

Print this string without moving the cursor in a down-right direction:

Multiprint(:DownRight, i);
P↘ι

And then move three positions down for the next iteration:

Move(3, :Down);
M3↓

Charcoal , (削除) 16 (削除ここまで) 9 bytes

WS«P↘ιM3↓

My first Charcoal answer. Thanks to @DLosc for suggestion P and M instead of using S and J (Jump) to go back to the start of the line (and three down).

Try it online (verbose) or Try it online (pure).

Explanation:

Loop while there is still a next input-string:

While(InputString()){ ... }
WS« ...

Print this string without moving the cursor in a down-right direction:

Multiprint(:DownRight, i);
P↘ι

And then move three positions down for the next iteration:

Move(3, :Down);
M3↓
Updated explanation and post format
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

#Charcoal, (削除) 16 (削除ここまで) 9 bytes (non-competing)

WS«P↘ιM3↓

My first Charcoal answer. Thanks to @DLosc for suggestion P and M instead of using S and J (Jump) to go back to the start of the line (and twothree down).

Try it online (verbose) or Try it online (pure).

Explanation:

Try it here. Loop while there is still a next input-string:

WS« Loop while we have inputs, and read them as string While(implicit stored in ιInputString()
 P Without moving the cursor-position,
 ↘ι output this input in a top-left to down-right diagonal direction
 M3↓ Move the cursor){ three... down}
 End of loop (implicit after we encounter an emptyWS« input)...

Here is a copy of the explanation from TIO when usingPrint this string without moving the argument -acursor in a down-right direction:

Program
└W: While
 ├S: Input string
 └Program
 ├P: Multiprint
 │├Multidirectional
 ││└↘(: DownDownRight, Righti);
 │└ι: Identifier ιP↘ι
 └M: 

And then move three positions down for the next iteration:

Move
 ├3: Number (3, └↓:Down);
M3↓

#Charcoal, (削除) 16 (削除ここまで) 9 bytes (non-competing)

WS«P↘ιM3↓

My first Charcoal answer. Thanks to @DLosc for suggestion P and M instead of using S and J (Jump) to go back to the start of the line (and two down).

Explanation:

Try it here.

WS« Loop while we have inputs, and read them as string (implicit stored in ι)
 P Without moving the cursor-position,
 ↘ι output this input in a top-left to down-right diagonal direction
 M3↓ Move the cursor three down
 End of loop (implicit after we encounter an empty input)

Here is a copy of the explanation from TIO when using the argument -a:

Program
└W: While
 ├S: Input string
 └Program
 ├P: Multiprint
 │├Multidirectional
 ││└↘: Down Right
 │└ι: Identifier ι
 └M: Move
 ├3: Number 3 └↓:Down

#Charcoal, (削除) 16 (削除ここまで) 9 bytes

WS«P↘ιM3↓

My first Charcoal answer. Thanks to @DLosc for suggestion P and M instead of using S and J (Jump) to go back to the start of the line (and three down).

Try it online (verbose) or Try it online (pure).

Explanation:

Loop while there is still a next input-string:

While(InputString()){ ... }
WS« ...

Print this string without moving the cursor in a down-right direction:

Multiprint(:DownRight, i);
P↘ι

And then move three positions down for the next iteration:

Move(3, :Down);
M3↓
Now that I know how to loop over a list, I've been able to golf it by 7 bytes.
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394
Loading
I knew I was forgetting something.. Added code-page to bytes
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394
Loading
Changed explanation and added Charcoal wiki link to header
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394
Loading
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394
Loading

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