Skip to main content
deleted 52 characters in body
Source Link
LyricLy
  • 3.7k
  • 2
  • 19
  • 40

Ly, 58 bytes

(50)[>0(255)?<1-]>ar&s&ulrns>1<[L[>"\n"ou;]ppl>1+<]"\n"o0u

Try it online!Try it online!

Outputs a space-separated list of scores, then the position of the given input after a newline.

Explanation:

(50)[>0(255)?<1-]>    # simple loop to create list of 50 scores
ar&s&ulr              # arrange the list, reverse it, print it, then reverse it back
ns                    # take input and save it
>1<                   # prepare counter
[                     # while the stack is not empty
    L[>"\n"ou;]       # check if the value is lower than the input, if so, output a newline and the counter, then terminate
    ppl>1+<           # otherwise, pop a value off the stack and increase the counter
]
"\n"o0u               # output a newline and 0 if we finished the loop without terminating

Ly, 58 bytes

(50)[>0(255)?<1-]>ar&s&ulrns>1<[L[>"\n"ou;]ppl>1+<]"\n"o0u

Try it online!

Outputs a space-separated list of scores, then the position of the given input after a newline.

Explanation:

(50)[>0(255)?<1-]>    # simple loop to create list of 50 scores
ar&s&ulr              # arrange the list, reverse it, print it, then reverse it back
ns                    # take input and save it
>1<                   # prepare counter
[                     # while the stack is not empty
    L[>"\n"ou;]       # check if the value is lower than the input, if so, output a newline and the counter, then terminate
    ppl>1+<           # otherwise, pop a value off the stack and increase the counter
]
"\n"o0u               # output a newline and 0 if we finished the loop without terminating

Ly, 58 bytes

(50)[>0(255)?<1-]>ar&s&ulrns>1<[L[>"\n"ou;]ppl>1+<]"\n"o0u

Try it online!

Outputs a space-separated list of scores, then the position of the given input after a newline.

Explanation:

(50)[>0(255)?<1-]>    # simple loop to create list of 50 scores
ar&s&ulr              # arrange the list, reverse it, print it, then reverse it back
ns                    # take input and save it
>1<                   # prepare counter
[                     # while the stack is not empty
    L[>"\n"ou;]       # check if the value is lower than the input, if so, output a newline and the counter, then terminate
    ppl>1+<           # otherwise, pop a value off the stack and increase the counter
]
"\n"o0u               # output a newline and 0 if we finished the loop without terminating
Source Link
LyricLy
  • 3.7k
  • 2
  • 19
  • 40

Ly, 58 bytes

(50)[>0(255)?<1-]>ar&s&ulrns>1<[L[>"\n"ou;]ppl>1+<]"\n"o0u

Try it online!

Outputs a space-separated list of scores, then the position of the given input after a newline.

Explanation:

(50)[>0(255)?<1-]>    # simple loop to create list of 50 scores
ar&s&ulr              # arrange the list, reverse it, print it, then reverse it back
ns                    # take input and save it
>1<                   # prepare counter
[                     # while the stack is not empty
    L[>"\n"ou;]       # check if the value is lower than the input, if so, output a newline and the counter, then terminate
    ppl>1+<           # otherwise, pop a value off the stack and increase the counter
]
"\n"o0u               # output a newline and 0 if we finished the loop without terminating