Skip to main content
saved 2 bytes
Source Link
CursorCoercer
  • 5.6k
  • 12
  • 27

Hexagony, 1414 12 bytes

?(}1{?@_.=@)<!'(<>._>*' 

Try it online!Try it online!

Layed out

 ?( } 1? {@ ._ =. @) !< '! (> <* >' . _. . . . . . 

Explanation

?}1 take input in the initial cell, and put 1 in the cell to its right.

!'(}? output 1some irrelevant operations initially, return tothen get the initial cell and decrementinput

< branch, if 0 go to @ and terminate, otherwise point the IP southeast

{'_(_ go todecrement the rightinput cell again but flipped, reflect IP toand redirect the IP northeast

(=1}*)! flipmove the MP back to how it was last time, decrement and add 1the cell to the right, keeping thisset that cell atto 1 stilland print that out

>_> goredirect the IP back to east travel

*' irrelevant operation, restartthen move the loopMP back to the input cell

this then loops back to the branch command

Hexagony, 14 bytes

?}1{.=@!'(<>._ 

Try it online!

Layed out

 ? } 1 { . = @ ! ' ( < > . _ . . . . . 

Explanation

?}1 take input in the initial cell, and put 1 in the cell to its right.

!'( output 1, return to the initial cell and decrement

< branch, if 0 go to @ and terminate, otherwise point the IP southeast

{'_ go to the right cell again but flipped, reflect IP to the northeast

(=1 flip the MP back to how it was last time, decrement and add 1, keeping this cell at 1 still

> go back to east travel, restart the loop

Hexagony, 14 12 bytes

(}?@_.)<!>*' 

Try it online!

Layed out

 ( } ? @ _ . ) < ! > * ' . . . . . . . 

Explanation

(}? some irrelevant operations initially, then get the input

< branch, if 0 go to @ and terminate, otherwise point the IP southeast

(_ decrement the input cell and redirect the IP northeast

}*)! move the MP to the cell to the right, set that cell to 1 and print that out

_> redirect the IP back east

*' irrelevant operation, then move the MP back to the input cell

this then loops back to the branch command

Source Link
CursorCoercer
  • 5.6k
  • 12
  • 27

Hexagony, 14 bytes

?}1{.=@!'(<>._ 

Try it online!

Layed out

 ? } 1 { . = @ ! ' ( < > . _ . . . . . 

Explanation

?}1 take input in the initial cell, and put 1 in the cell to its right.

!'( output 1, return to the initial cell and decrement

< branch, if 0 go to @ and terminate, otherwise point the IP southeast

{'_ go to the right cell again but flipped, reflect IP to the northeast

(=1 flip the MP back to how it was last time, decrement and add 1, keeping this cell at 1 still

> go back to east travel, restart the loop