3 added 139 characters in body
source | link

Japt, 6969 62 bytes

-7 bytes thanks to @Shaggy

X=Y=U®ç'x +SpUrw
®ç'x -ZÃp'-pUrw¹·W=Ul+SpZnUrwÃpQpUrw¹·
V
l o m{X=z®V=z d" x""x " z3ÃuY W¯WbWgJz3ÃuW
X¯XbXgJ)Ä ·

Learning Japt and wanted to try out a more complicated challenge. Outputs with xs and "s instead of asterisks;asterisks and dashes; takes input as an array of numbers. Assumes sorting will be complete within input.length steps; correct me if that is ever not the case.

Try it online!Try it online!

X=Y=U®   ç'x +SpUrw -ZÃ p'-pUrw¹·   // implicit: U = input array
X=Y=UmZ{Zç'x +SpUrw -Z} p'-pUrw) qR // create and save the initial state

X=Y=         // implicit: U = input array
 ®   ç'x +SpZnUrwà pQpUrw¹ ·  // implicit: V = this line
UmZ{Zç'x +SpZnUrw} pQpUrw) qR // set X and Y to...ungolfed
    UmZ{              }             // U mapped by the function:
        Zç'x                        //   "x" times this item
             +SpUrw -Z +SpZnUrw             //   plus " " times the max of the input array (Urw) minus this itemvalue (Z)
                        p'-pUrwpQpUrw)    // push "-" (Q) times the max
                                 qR // join with newlines

W=Ul o m{X=zV d" x""x " z3Ã uY
W=Ul o m{X=z d" x""x " z3} uY       // create array of gravity sort steps

W=    // implicit: W = this line

 l o ®   V=z d" x""x " z3Ã uW // implicit: X = this line
Ul o mZ{ZV=z d" x""x " z3} uW // set W to...ungolfed
  Ul o                              //   the array of the range [0, U.length)
       mmZ{Z                }          //   mapped by the no-arg function:
         X=z      V=z                  //     set XV to itself rotated 90deg
             d" x""x "              //     replace all " x" with "x " to "fall"
                       z3           //     rotate back to normal
                           uY      uW //   add Y W(the original) to the start

W¯  WbWgJX¯XbXgJ  ·
Ws0,WbWgJ)+1 qR                  // implicit: return this line
Xs0,XbXgJ)+1 qR // remove repeated final steps and output

Ws0,        // ungolfed
Xs0,                          // get the substring of WX from 0 to...
    WbWgJXbXgJ)+1                        // the first index of the last item, plus one
             qR                     // join with newlines

Japt, 69 bytes

X=Y=U®ç'x +SpUrw -ZÃp'-pUrw¹·W=Ul o m{X=z d" x""x " z3ÃuY W¯WbWgJ)Ä ·

Learning Japt and wanted to try out a more complicated challenge. Outputs with xs instead of asterisks; takes input as an array of numbers. Assumes sorting will be complete within input.length steps; correct me if that is ever not the case.

Try it online!

X=Y=U®   ç'x +SpUrw -ZÃ p'-pUrw¹·   // implicit: U = input array
X=Y=UmZ{Zç'x +SpUrw -Z} p'-pUrw) qR // create and save the initial state

X=Y=                                // set X and Y to...
    UmZ{              }             // U mapped by the function:
        Zç'x                        //   "x" times this item
             +SpUrw -Z              //   plus " " times the max of the input array (Urw) minus this item (Z)
                        p'-pUrw)    // push "-" times the max
                                 qR // join with newlines

W=Ul o m{X=z d" x""x " z3Ã uY
W=Ul o m{X=z d" x""x " z3} uY       // create array of gravity sort steps

W=                                  // set W to...
  Ul o                              //   the array of the range [0, U.length)
       m{                }          //   mapped by the no-arg function:
         X=z                        //     set X to itself rotated 90deg
             d" x""x "              //     replace all " x" with "x " to "fall"
                       z3           //     rotate back to normal
                           uY       //   add Y (the original) to the start

W¯  WbWgJ  ·
Ws0,WbWgJ)+1 qR                     // remove repeated final steps and output

Ws0,                                // get the substring of W from 0 to...
    WbWgJ)+1                        // the first index of the last item, plus one
             qR                     // join with newlines

Japt, 69 62 bytes

-7 bytes thanks to @Shaggy


®ç'x +SpZnUrwÃpQpUrw¹·
V
l o ®V=z d" x""x " z3ÃuW
X¯XbXgJ)Ä ·

Learning Japt and wanted to try out a more complicated challenge. Outputs with xs and "s instead of asterisks and dashes; takes input as an array of numbers. Assumes sorting will be complete within input.length steps; correct me if that is ever not the case.

Try it online!

                              // implicit: U = input array
 ®   ç'x +SpZnUrwà pQpUrw¹ ·  // implicit: V = this line
UmZ{Zç'x +SpZnUrw} pQpUrw) qR // ungolfed
UmZ{             }            // U mapped by the function:
    Zç'x                      //   "x" times this item
         +SpZnUrw             //   plus " " times the max of the input array (Urw) minus this value (Z)
                   pQpUrw)    // push " (Q) times the max
                           qR // join with newlines

V                             // implicit: W = this line

 l o ®   V=z d" x""x " z3Ã uW // implicit: X = this line
Ul o mZ{ZV=z d" x""x " z3} uW // ungolfed
Ul o                          // the array of the range [0, U.length)
     mZ{Z                }    // mapped by the no-arg function:
         V=z                  //   set V to itself rotated 90deg
             d" x""x "        //   replace all " x" with "x " to "fall"
                       z3     // rotate back to normal
                           uW // add  W(the original) to the start

X¯XbXgJ)Ä ·                   // implicit: return this line
Xs0,XbXgJ)+1 qR               // ungolfed
Xs0,                          // get the substring of X from 0 to...
    XbXgJ)+1                  // the first index of the last item, plus one
             qR               // join with newlines
2 added 103 characters in body
source | link

Learning Japt and wanted to try out a more complicated challenge. Outputs with xs instead of asterisks; takes input as an array of numbers. Assumes sorting will be complete within input.length steps; correct me if that is ever not the case.

Learning Japt and wanted to try out a more complicated challenge. Outputs with xs instead of asterisks; takes input as an array of numbers.

Learning Japt and wanted to try out a more complicated challenge. Outputs with xs instead of asterisks; takes input as an array of numbers. Assumes sorting will be complete within input.length steps; correct me if that is ever not the case.

1
source | link

Japt, 69 bytes

X=Y=U®ç'x +SpUrw -ZÃp'-pUrw¹·W=Ul o m{X=z d" x""x " z3ÃuY W¯WbWgJ)Ä ·

Learning Japt and wanted to try out a more complicated challenge. Outputs with xs instead of asterisks; takes input as an array of numbers.

Try it online!

Explanation

X=Y=U®   ç'x +SpUrw -ZÃ p'-pUrw¹·   // implicit: U = input array
X=Y=UmZ{Zç'x +SpUrw -Z} p'-pUrw) qR // create and save the initial state

X=Y=                                // set X and Y to...
    UmZ{              }             // U mapped by the function:
        Zç'x                        //   "x" times this item
             +SpUrw -Z              //   plus " " times the max of the input array (Urw) minus this item (Z)
                        p'-pUrw)    // push "-" times the max
                                 qR // join with newlines

W=Ul o m{X=z d" x""x " z3Ã uY
W=Ul o m{X=z d" x""x " z3} uY       // create array of gravity sort steps

W=                                  // set W to...
  Ul o                              //   the array of the range [0, U.length)
       m{                }          //   mapped by the no-arg function:
         X=z                        //     set X to itself rotated 90deg
             d" x""x "              //     replace all " x" with "x " to "fall"
                       z3           //     rotate back to normal
                           uY       //   add Y (the original) to the start

W¯  WbWgJ)Ä  ·
Ws0,WbWgJ)+1 qR                     // remove repeated final steps and output

Ws0,                                // get the substring of W from 0 to...
    WbWgJ)+1                        // the first index of the last item, plus one
             qR                     // join with newlines