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

deleted 16 characters in body
Source Link
Aiden Chow
  • 14.5k
  • 1
  • 22
  • 61

Piet + ascii-piet, 16 bytes (×ばつ4=16 codels)

tabR Smm Amtqa

Try Piet online! Try Piet online!

How it works

The code simply follows the border and then stops at the 3-cell L-shaped region. Basically uses the well-known formula, because setting up a loop here costs too many cells due to the necessary roll command.

Command Stack
inN [n]
dup 1 + [n n+1]
* 2 / [n*(n+1)/2]
outN []

This layout saves two black cells over the following linear, more straightforward (pun intended) layout:

Piet + ascii-piet, 18 bytes (×ばつ9=18 codels)

tabrsaqtM a mm

Try Piet online! Try Piet online!

Piet + ascii-piet, 16 bytes (×ばつ4=16 codels)

tabR Smm Amtqa

Try Piet online!

How it works

The code simply follows the border and then stops at the 3-cell L-shaped region. Basically uses the well-known formula, because setting up a loop here costs too many cells due to the necessary roll command.

Command Stack
inN [n]
dup 1 + [n n+1]
* 2 / [n*(n+1)/2]
outN []

This layout saves two black cells over the following linear, more straightforward (pun intended) layout:

Piet + ascii-piet, 18 bytes (×ばつ9=18 codels)

tabrsaqtM a mm

Try Piet online!

Piet + ascii-piet, 16 bytes (×ばつ4=16 codels)

tabR Smm Amtqa

Try Piet online!

How it works

The code simply follows the border and then stops at the 3-cell L-shaped region. Basically uses the well-known formula, because setting up a loop here costs too many cells due to the necessary roll command.

Command Stack
inN [n]
dup 1 + [n n+1]
* 2 / [n*(n+1)/2]
outN []

This layout saves two black cells over the following linear, more straightforward (pun intended) layout:

Piet + ascii-piet, 18 bytes (×ばつ9=18 codels)

tabrsaqtM a mm

Try Piet online!

added 140 characters in body
Source Link
Bubbler
  • 79.3k
  • 5
  • 162
  • 484

Piet + ascii-piet, 16 bytes (×ばつ4=16 codels)

tabR Smm Amtqa

Try Piet online!

How it works

The code simply follows the border and then stops at the 3-cell L-shaped region. Basically uses the well-known formula, because setting up a loop here costs too many cells due to the necessary roll command.

Command Stack
inN [n]
dup 1 + [n n+1]
* 2 / [n*(n+1)/2]
outN []

This layout saves two black cells over the following linear, more straightforward (pun intended) layout:

Piet + ascii-piet, 18 bytes (×ばつ9=18 codels)

tabrsaqtM a mm

Try Piet online!

Piet + ascii-piet, 16 bytes (×ばつ4=16 codels)

tabR Smm Amtqa

Try Piet online!

How it works

The code simply follows the border and then stops at the 3-cell L-shaped region. Basically uses the well-known formula, because setting up a loop here costs too many cells due to the necessary roll command.

Command Stack
inN [n]
dup 1 + [n n+1]
* 2 / [n*(n+1)/2]
outN []

This layout saves two black cells over the following linear, more straightforward (pun intended) layout:

Piet + ascii-piet, 18 bytes (×ばつ9=18 codels)

tabrsaqtM a mm

Try Piet online!

Piet + ascii-piet, 16 bytes (×ばつ4=16 codels)

tabR Smm Amtqa

Try Piet online!

How it works

The code simply follows the border and then stops at the 3-cell L-shaped region. Basically uses the well-known formula, because setting up a loop here costs too many cells due to the necessary roll command.

Command Stack
inN [n]
dup 1 + [n n+1]
* 2 / [n*(n+1)/2]
outN []

This layout saves two black cells over the following linear, more straightforward (pun intended) layout:

Piet + ascii-piet, 18 bytes (×ばつ9=18 codels)

tabrsaqtM a mm

Try Piet online!

Source Link
Bubbler
  • 79.3k
  • 5
  • 162
  • 484

Piet + ascii-piet, 16 bytes (×ばつ4=16 codels)

tabR Smm Amtqa

Try Piet online!

How it works

The code simply follows the border and then stops at the 3-cell L-shaped region. Basically uses the well-known formula, because setting up a loop here costs too many cells due to the necessary roll command.

Command Stack
inN [n]
dup 1 + [n n+1]
* 2 / [n*(n+1)/2]
outN []

This layout saves two black cells over the following linear, more straightforward (pun intended) layout:

Piet + ascii-piet, 18 bytes (×ばつ9=18 codels)

tabrsaqtM a mm

Try Piet online!

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