Skip to main content
deleted 492 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

Rockstar, 9797 93 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
cutY's O1
while X-OY
rock O+1let inY O
be+1
joinlet O with "be+" ""+Y

say O

Try it (Code will need to be pasted in)

Original, 97 bytes

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

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

Rockstar, 97 93 bytes

listen to N
X's 0
while N-X
build X up
O's 1
Y's 1
while X-Y
let Y be+1
let O be+" "+Y

say O

Try it (Code will need to be pasted in)

Original, 97 bytes

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
Source Link
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