Skip to main content
1 of 2
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

Rockstar, 97 bytes

It should be possible to do this without the cut for 91 bytes but, for some reason, the inner loop is preventing that.

listen to N
X's 0
while N-X
build X up
O's 1
cut O
while X-O
rock O+1 in O

join O with " "
say O

Try it (Code will need to be pasted in)

listen to N         :Read input string into variable N
X's 0               :Initialise X as 0
while N-X           :While X is less than N
build X up          :  Increment X
O's 1               :  Initialise O as 1
cut O               :  Split O to an array
while X-O           :  While the length of O is less than X
rock O+1 in O       :    Push the length of O incremented by 1 to O
                    :  End while loop
join O with " "     :  Join O with spaces
say O               :  Output O
Shaggy
  • 43.5k
  • 4
  • 36
  • 94