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

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

CursorCoercer
  • 5.6k
  • 12
  • 27