text:
All Aboard the ASCII Train
All Aboard the ASCII Train!
    o O O   ___     ___     ___     ___     ___     ___     ___     ___     ___
   o       | C |   | O |   | D |   | E |   |   |   | G |   | O |   | L |   | F |
  TS__[O]  |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|
 {======|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
./o--000'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'

You best be prepared to ride the train, because you're about to build the train you'll be riding on. Given a string s, output a fully formed train as depicted above. The first thing output is always the engine that'll be tugging your string along, as depicted alone below:
    o O O
   o
  TS__[O]
 {======|
./o--000'

Following the locomotive are rail-cars containing each character of your precious cargo. To save confusion when unloading, your company has tasked you with labeling the outside of these cars. The cars in question will always look like this:
   ___
  | # |
  |___|
_|"""""|
"`-0-0-'

Where the # is representative of the character that is inside the "cargo" hold. Chaining the engine to each car is also part of your job, as you've been tasked with overseeing the fluidity and success of this entire shipment. So, once you've labeled all the cars and got the engine on the tracks, you must ensure that the train is assembled and ready to roll.
Rules

The only input your program should take is a single string.
The engine must always be output, even if your shipment is empty.
Each car can only hold one character, don't push your luck you may damage the goods.
You need only support the following printable ASCII characters:
_-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
If you end up doing more, that's fine too, but this is the bare minimum.
1-2 trailing spaces are acceptable, as is a single trailing newline.
This is code-golfascii-art, shortest byte-count wins.

Vaguely related.

I don't think this is actually [tag:kolmogorov-complexity].  Based on this meta post this question is certainly on the line between fitting and not fitting our definition and I would personally say that it does not fit the tag similar to this question which also asks for a type of string wrapping.

This is beautiful [tag:ascii-art]

@WheatWizard it's a mixture of multiple genres. The engine would fall under kolmogrov complexity, the whole thing under ASCII-Art and it probably also falls a little bit into string manipulation.

I was under the impression that compressing the actual pattern of the train would be worthy of the tag; but I'll just remove it to stop the argument.

Can the input contain newlines? If so, what label should be placed on the train cars? (Trying to label them with a newline would cause them to fall apart.)

@ais523 don't worry about newlines or tabs, or anything else that would be beyond a single space.

Could this fit under [tag:string]?

I'm going to attempt a BrainF*** solution; can I take the number of letters in the string first?

@HyperNeutrino yes.

05AB1E, 101 99 bytes
Naive first attempt.
"    o O O   o"ð7×"TS__[O] {======|./o--000'"J5ä¹v… _ €ÐJy“ | ÿ |   |___| _|"""""|"`-0-0-'“«5ä})øJ»

Try it online!

Well, the code doesn't resemble a train, but it's winning now.

JavaScript (ES6), 149 144 bytes
s=>`    o O Oa   ___
   o     a  | $& |
  TS__[O]a  |___|
 {======|a_|"""""|
./o--000'a"\`-0-0-'`.replace(/a(.*)/g,(_,c)=>s.replace(/./g,c))

I don't think the engine itself can be compressed, but perhaps it's possible.
Test snippet

let f =

s=>`    o O Oa   ___
   o     a  | $& |
  TS__[O]a  |___|
 {======|a_|"""""|
./o--000'a"\`-0-0-'`.replace(/a(.*)/g,(_,c)=>s.replace(/./g,c))

O.innerHTML = f("CODE GOLF")
<input value="CODE GOLF" oninput="O.innerHTML=f(this.value.replace(/\n/g,'<br>'))">

Lots of repeated characters, should be possible to squeeze some more bytes out of it.

One can almost see the train packed in the source code :-)

Upvoted primarily becuase the code resembles a train

Bonus points because it runs right there in the browser!

PHP, 218 211 204 187 183 bytes
    o O O<?for(;$y<5;print"\n".["   o     ","  TS__[O]"," {======|","./o--000'"][+$y++])for($p=0;$c=a&$argn[$p++];)echo["   ___  ","  | $c | ","  |___| ",'_|"""""|',"\"`-0-0-'"][+$y];

Takes input from STDIN; run with -nR.
Compressing the engine or wagon would require more code to decompress than it saves on storage.
I see no more potential here.

a&$c=$argn  instead of ""<$c=$argv[1]

@JörgHülsermann Yea this post was ancient. :)

Befunge, 276 270 bytes
p1p~:7>7+#:`#~_$:v
>#p0p10:p00:+1g00_v#:
v"!!```!!!"v>0p01g\-0g1+53p
v"!}!#!}!!"v0 p115<
v"!}```}!!"v^:-1<
v"}#####}`">00g:|
>"(.1.1.a#"^+<v1<
v"P!P!p!!! "v5>g00p
v"!!!!!p!!!"v6
v"^P\``TU!!"vp
v"}>>>>>>|!"v+
>"(111..p0/"v6
v-1:g110">>"<g
>:11p!#v_p011^
#-:#1_@>$$$$>,#

Try it online!
Explanation
The car and engine are encoded as two sets of five strings on lines 3 to 12. The character values are off by 1 so as to avoid having to deal with the double quotes which can't be used in a Befunge string.
The code works by building up the full set of characters needed to render the train on the stack. For each line of output, an appropriate car string is first added to the stack, repeated as many times as necessary for the cargo, and then one copy of the appropriate engine string.
After each line has been constructed, a pair of the down arrows to left of the strings is replaced with a right arrow, so the next iteration of the loop follows a different path through the code, using a different pair of strings for the car and engine.
Once all the data has been built up on the stack, there's a final rendering loop which writes out the characters, subtracting 1 each time to account for the initial encoding.
As a bonus, the source is designed in the shape of a gun turret, in case the train comes under attack. Golfers destroyed my gun turret.

Golfers destroyed my gun turret, LOL. +1. Yet, it's beating C# and Java.

Python 2, 176 bytes
lambda i:'\n'.join(map(''.join,zip(*[["    o O O","   o     ","  TS__[O]"," {======|","./o--000'"]]+[["   ___  ",'  | '+x+' | ',"  |___| ",'_|"""""|',"\"`-0-0-'"]for x in i])))

Example:
print f('Python')

gives
    o O O   ___     ___     ___     ___     ___     ___
   o       | P |   | y |   | t |   | h |   | o |   | n |
  TS__[O]  |___|   |___|   |___|   |___|   |___|   |___|
 {======|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
./o--000'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'

Powershell, 167 166 Bytes
$l=($a=$args[0]).Length;"    o O O"+"   ___  "*$l;"   o     "+($a[0..$l]|%{"  | $_ |"});"  TS__[O]"+"  |___| "*$l;" {======|"+'_|"""""|'*$l;"./o--000'"+'"`-0-0-'''*$l

Example:
.\train.ps1 "PowerShell!"
    o O O   ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___
   o       | P |   | o |   | w |   | e |   | r |   | S |   | h |   | e |   | l |   | l |   | ! |
  TS__[O]  |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|
 {======|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
./o--000'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'

Possibly Invalid! If run with no args at all it will try and print one empty string, and look like:
    o O O
   o       |  |
  TS__[O]
 {======|
./o--000'

If run with an empty input string it will return correctly however:
.\train.ps1 ""
    o O O
   o
  TS__[O]
 {======|
./o--000'

(kinda) Ungolfed:
$l=($a=$args[0]).Length
"    o O O"+"   ___  "*$l
"   o     "+($a[0..$l]|%{"  | $_ |"})
"  TS__[O]"+"  |___| "*$l
" {======|"+'_|"""""|'*$l
"./o--000'"+'"`-0-0-'''*$l

shortest compression in Powershell is going to be +'c'*x where c is the char and x is the number of repetitions, and that's only for trailing or leading repetitions, any center-string repetitions will require an extra + and an extra " - so there's no point in this where I can see compression saving any space, and the only repeated char set is ___ which is only 3 chars.
Explanation:
$l=($a=$args[0]).Length Take the first arg, put it into $a, then take the length of $a and put it into $l, these are the only variables you need.
"    o O O"+"   ___  "*$l most of the other bits follow this format of the left-part and then the right part times the number of required chars.
"   o     "+([char[]]$a|%{"  | $_ |"}) loop (|%{}) through $a as a char array, so foreach (char $_ in $a) for a non-pipeline version, then put the char into the text.
this is an extremely simple approach, but because I can't find a good way to compress the strings past this it seems like the most useful.
saved 1 Byte thanks to briantist! and here I was thinking this wouldn't get any shorter..

You didn't have to handle no args :).

@carusocomputing yay, thanks for letting me know.

Nice! You can save 1 byte by changing [char[]]$a to $a[0..$l]  :)

ah was using char array before I declared $l and totally forgot about it. thanks for that!

Java, 361 bytes
class C {static void main(String[]v){Scanner q = new Scanner(System.in);String i = q.nextLine();String[] t = {"    o O O   ", "   o       ", "  TS__[O]  ", " {======|", "./o--000'",};for (char c: i.toCharArray()) {t[0]+="___     ";t[1]+="| # |   ".replace('#',c);t[2]+="|___|   ";t[3]+="_|\"\"\"\"\"|";t[4]+="\"`-0-0-'";}for(String p:t) System.out.println(p);}}

class C {
    static void main(String[]v)  {
        Scanner q = new Scanner(System.in);
        String i = q.nextLine();
        String[] t = {
                "    o O O   ",
                "   o       ",
                "  TS__[O]  ",
                " {======|",
                "./o--000'",
        };
        for (char c: i.toCharArray()) {
            t[0]+="___     ";
            t[1]+="| # |   ".replace('#',c);
            t[2]+="|___|   ";
            t[3]+="_|\"\"\"\"\"|";
            t[4]+="\"`-0-0-'";
        }
        for(String p:t)
            System.out.println(p);

    }
}

Example
java
    o O O   ___     ___     ___     ___
   o       | j |   | a |   | v |   | a |
  TS__[O]  |___|   |___|   |___|   |___|
 {======|_|"""""|_|"""""|_|"""""|_|"""""|
./o--000'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'

I know it's been halve a year, but you can golf quite a bit (also by removing spaces): interface C{static void main(String[]v){String n="\n",b="    o O O   ",c="   o       ",d="  TS__[O]  ",e=" {======|",f="./o--000'";for(String x:new java.util.Scanner(System.in).nextLine().split("")){b+="___     ";c+="| "+x+" |   ";d+="|___|   ";e+="_|\"\"\"\"\"|";f+="\"`-0-0-'";}System.out.print(b+n+c+n+d+n+e+n+f);}} (318 bytes) Or even more if you replace new java.util.Scanner(System.in).nextLine() with v[0] as alternative input (279 bytes) Try it here.

Perl, 137 bytes
132 bytes of code + 5 bytes for-pF flags.
ascii_train.pl:
#!/usr/bin/perl -apF
s/./  | $& | /g;$_="    o O O!   ___
   o     $_
  TS__[0]!  |___|
 {======|!".'_|"""""|'."
./o--000'!\"`-0-0-'";s/!(.*)/$1x@F/ge

Note that I added -a flag in the code, but it's only because old versions of Perl require -a when -F is used.
To run it:
echo -n "code-golf" | perl ascii_train.pl

The input must be supplied without a final newline (with echo -n for instance).
Explanations:
From what I've seen, it's roughly the same idea as ETHProduction's JavaScript answer.
There isn't a lot going on: sadly the patterns are a bit to short to make x operator worth being used.
First, s/./  | $& | /g surrounds each character of the input with | (and spaces) to form the second level of the train.
Then inside that long string, everything between a ! and a newline is a pattern we wish to repeat to construct the cars. That repetition is done thanks to the regex s/!(.*)/$1x@F/ge. (I used ! because the input can't contain it).

SOGL V0.12, 57 56 bytes
Τ¡ā↓mΛC┌─⁵℮Ƨ⅛□→(š;∞⅟¹°⅔Ζ‽ζ÷⁴‘9n,{"s=Ο!NθæιžGš‼t╬¼Xg`‘8n┼

Try it Here!
Explanation:
..‘             push a compressed string of the locomotive in a single line
   9n           split in line lengths of 9
     ,{         for each character in the input
       "..‘       push a compressed string of a wagon in a single line
           8n     split to line lengths of 8
             ┼    add horizontally

C# 221 bytes
nothing special happening here.. just creating each line and join them with new lines.
s=>{var t=new[]{"    o O O","   o     ","  TS__[O]"," {======|","./o--000'"};foreach(var c in s){t[0]+="   ___  ";t[1]+=$"  | {c} | ";t[2]+="  |___| ";t[3]+="_|\"\"\"\"\"|";t[4]+="\"`-0-0-'";}return string.Join("\n",t);};

C#, 277 Bytes
Golfed:
string T(string s){var o=new string[]{"     o O O","   o        ","   TS__[O]","  {======|","./ o--000'" };for(int i=0;i<s.Length;i++){o[0]+="   ___  ";o[1]+="| # |   ".Replace("#",s[i]+"");o[2]+="  |___| ";o[3]+="_|\"\"\"\"\"|";o[4]+="\"`-0-0-'";}return string.Join("\r\n",o);

Ungolfed:
public string T(string s)
{
  var o = new string[] { "     o O O", "   o        ", "   TS__[O]",
    "  {======|", "./ o--000'" };

  for (int i = 0; i < s.Length; i++)
  {
    o[0] += "   ___  ";
    o[1] += "| # |   ".Replace("#", s[i] + "");
    o[2] += "  |___| ";
    o[3] += "_|\"\"\"\"\"|";
    o[4] += "\"`-0-0-'";
  }

  return string.Join("\r\n", o);
}

Testing:
Console.Write(new AllAboardTheASCIITrain().T(""));

     o O O
   o
   TS__[O]
  {======|
./ o--000'

And...
Console.Write(new AllAboardTheASCIITrain().T("Programming Puzzles & Code Golf"));

     o O O   ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___
   o        | P |   | r |   | o |   | g |   | r |   | a |   | m |   | m |   | i |   | n |   | g |   |   |   | P |   | u |   | z |   | z |   | l |   | e |   | s |   |   |   | & |   |   |   | C |   | o |   | d |   | e |   |   |   | G |   | o |   | l |   | f |
   TS__[O]  |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|
  {======|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
./ o--000'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'

C (clang), 217 212 208 193 bytes
f(*t){for(char*p,d[]="    o O O   o       TS__[O] {======|./o--000'   ___    | C |   |___| _|\"\"\"\"\"|\"`-0-0-'",i=0;i<5;i+=puts(""))for(write(1,d+i*9,9),p=t;d[57]=*p++;)write(1,d+45+i*8,8);}

-4 bytes thanks to ceilingcat!!
Try it online!

@ceilingcat, thanks, this one really needed more golfing. Is there a wide character version of write?

Perhaps not exactly what you want but there is wprintf()

Jq 1.5, 178 bytes
[["    o O O   o       TS__[O] {======|./o--000'"|_nwise(9)]]+[range(length)as$i|[.[$i:$i+1]|"   ___    | \(.) |   |___| _|\"\"\"\"\"|\"`-0-0-'"|_nwise(8)]]|transpose|map(add)[]

Expanded
# engine
def E:"    o O O   o       TS__[O] {======|./o--000'"|_nwise(9);

# car (note string interpolation)
def C:"   ___    | \(.) |   |___| _|\"\"\"\"\"|\"`-0-0-'"|_nwise(8);

  # generate train
  [[E]] + [range(length) as $i| [.[$i:$i+1] |C]]

  # combine rows and concatenate strings
| transpose | map(add)[]

Sample run
$ jq -MRr train.jq <<< "golf"
    o O O   ___     ___     ___     ___
   o       | g |   | o |   | l |   | f |
  TS__[O]  |___|   |___|   |___|   |___|
 {======|_|"""""|_|"""""|_|"""""|_|"""""|
./o--000'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'

$ wc -c < train.jq
  178

Try it online

Excel VBA, 218 Bytes
Anonymous VBE immediate window function that takes input from range [A1] and outputs to the VBE immediate window
[B1]=[Len(A1)]:?"    o O O"[Rept("   ___  ",B1)]:?"   o     ";:For i=1To[B1]:?"  | "Mid([A1],i,1)" | ";:Next:?:?"  TS__[O]"[Rept("  |___| ",B1)]:?" {======|"[Rept("_|""""""""""|",B1)]:?"./o--000'"[Rept("""`-0-0-'",B1)]

Formatted for readability
[B1]=[Len(A1)]
?"    o O O"[Rept("   ___  ",B1)]
?"   o     ";:For i=1To[B1]:?"  | "Mid([A1],i,1)" | ";:Next:?:
?"  TS__[O]"[Rept("  |___| ",B1)]:
?" {======|"[Rept("_|""""""""""|",B1)]:
?"./o--000'"[Rept("""`-0-0-'",B1)]

Sample Output
    o O O   ___     ___     ___     ___     ___     ___     ___     ___     ___     ___     ___
   o       | V |   | B |   | A |   |   |   | E |   | x |   | p |   | r |   | e |   | s |   | s |
  TS__[O]  |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|   |___|
 {======|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
./o--000'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Magic popcount numbers
There’s a famous tricky algorithm for counting the number of set bits in a 32-bit unsigned integer:
int popcount(unsigned x) {
   x = (x & 0x55555555) + ((x >> 1) & 0x55555555);
   x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
   x = (x & 0x0F0F0F0F) + ((x >> 4) & 0x0F0F0F0F);
   x = (x & 0x00FF00FF) + ((x >> 8) & 0x00FF00FF);
   x = (x & 0x0000FFFF) + ((x >>16) & 0x0000FFFF);
   return x;
}

I won’t explain it here. But imagine similar code for 512-bit integers! The hexadecimal constants would be huge, and form a pretty pattern. Your task is simply to print this exact output:
0x55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
0x33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f
0x00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff
0x0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff
0x00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff
0x0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff
0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000000000000000000000000ffffffffffffffffffffffffffffffff
0x0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

No trailing spaces, please — though a single trailing newline is optional.
This is code-golf, so the shortest answer (in bytes) wins.

Are we allowed to take input (as in something like 0x0x0x0x0x0x0x0x0x)?

@ouflak No. ———

05AB1E, 26 22 21 bytes
05AB1E uses the CP-1252 encoding.
9F„0x0NÍo×9ooNoo>÷hJ,

Try it online!
Explanation
9F                      # for N in [0 ... 8]
  „0x                   # push the string "0x"
     0NÍo×              # push 2**(N-2) zeroes
          9oo           # 2**2**9
                 ÷      # //
             Noo>       # (2**2**N+1)
                  h     # converted to base-16
                   J    # join everything to string
                    ,   # print with a newline

Other versions that might be improved
9F9ooNoo>÷h¾6o×J7o£R…0xÿ,
9F9ooNoo>÷h0žy×ìR7o£R…0xÿ,
9FX0No×1No×JCh7o×1K7o£…0xÿ,
8ÝovX0y×1y×JCh7o×1K7o£…0xÿ,
9F1NoÅ0D>)˜JCh1K7o×7o£…0xÿ,

Python 2, 52 49 46 bytes
The kth number is given by 2**512/(2**2**k + 1). This is for a 512 bit number, so it's trivial to extend the pattern to different widths.
l=2;exec"print'0x%0128x'%(2**512/-~l);l*=l;"*9

3 bytes saved thanks to Dennis.
3 bytes saved thanks to xnor.

The advantages of arbitrary-precision integers...

Nice. This saves a few bytes.

Shorter to keep squaring: l=2;exec"print'0x%0128x'%(2**512/-~l);l*=l;"*9

It warms my heart to see Python in the vote-lead :)

Shouldn't the formula be 2**512/(2**2**k + 1)?

@Mego Oops, fixed. The program did use the correct formula though.

@orlp Yep, I noticed that, which had me very confused for much longer than I should've been.

Curious: how did you figure out the formula and why does it work? Explanation would be cool :)

@TuukkaX I just have a lot of experience with bit twiddling hacks. I used Wolfram Alpha a lot to simplify sums and such. But basically I made the pattern 01010101, 00010001, 00000001, and then multiplied those by 1, 11, 1111 to get the correct binary patterns. For example 01010101 you can get the formula for a certain width w by doing sum 2^(2*k) for k = 0, w/2 - 1 and finding out it's (2**w - 1)/3.

Use %#0130x: l=2;exec"print'%#0130x'%(2**512/-~l);l*=l;"*9

PHP, 111 110 108 bytes
One byte saved thanks to @user59178.
<?=($p=str_pad)("0x",130,5).$p($s="\n0x",131,3);for($x=1;$x<65;$x*=2)echo($p($s,131,$p(0,$x,0).$p(f,$x,f)));

What´s the pattern for 1024 bits? :D

You can save a byte by using $x<65 rather than $i++<7. This time I tested it and everything.

Vim, 32 bytes
i5<CR>3<Esc>qqYpVrf$<C-V>{yPG1vr0q6@q<C-V>{I0x<Esc>
I only need to manually write the first 5 and 3, and the macro takes care of the rest, "doubling the bit count" each time it runs. The order of the steps in the macro is a bit weird (make a new f line, block-wise copy, reuse the visual block size to put 0s in the f line), but it's the fastest variant I've found.

J, 46 34 bytes
I'm working on golfing this, but this baby likes to stay at 46 bytes... Not anymore! -12 bytes thanks to miles!
'0x',"1'5','3','0f'(128$#)"{~2^i.7

Try it online! :D
Result
   '0x',"1'5','3','0f'(128$#)"{~2^i.7
0x55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
0x33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f
0x00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff
0x0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff
0x00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff
0x0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff
0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000000000000000000000000ffffffffffffffffffffffffffffffff
0x0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

For this answer, I needed (ideally) a verb with rank 0 1 so as to use it in the u"v definition of rank; however, miles observed that 0 _ was sufficient for the task at hand.
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│= │< │<.│<:│> │>.│>:│+ │+.│+:│* │*.│*:│_ 0 0│_ 0 0│0 0 0│0 0 0│0 0 0│0 0 0│0 0 0│0 0 0│0 0 0│0 0 0│0 0 0│0 0 0│0 0 0│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│- │-.│-:│% │%.│%:│^ │^.│$ │$.│$:│~.│~:│0 0 0│0 _ _│0 _ _│0 0 0│2 _ 2│0 0 0│0 0 0│0 0 0│_ 1 _│_ _ _│_ _ _│_ 0 0│_ 0 0│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│| │|.│, │,.│,:│; │;:│# │#.│#:│! │/:│\:│0 0 0│_ 1 _│_ _ _│_ _ _│_ _ _│_ _ _│1 _ _│_ 1 _│1 1 1│_ 1 0│0 0 0│_ _ _│_ _ _│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│[ │[:│] │{ │{.│{:│}.│}:│".│":│? │?.│a │_ _ _│_ _ _│_ _ _│1 0 _│_ 1 _│_ 0 0│_ 1 _│_ 0 0│1 _ _│_ 1 _│0 0 0│_ 0 0│_ _ _│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│A │A.│b │C │C.│d │D │e │e.│E │E.│f │H │_ _ _│1 0 _│_ _ _│_ _ _│1 1 _│_ _ _│_ _ _│_ _ _│_ _ _│_ _ _│0 _ _│_ _ _│_ _ _│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│i │i.│i:│I │I.│j │j.│L │L.│M │o │o.│p │_ _ _│1 _ _│0 _ _│_ _ _│1 _ _│_ _ _│0 0 0│_ _ _│_ 0 0│_ _ _│_ _ _│0 0 0│_ _ _│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│p.│p:│q │q:│r │r.│s │s:│S │t │T │u:│x:│1 1 0│0 _ _│_ _ _│0 0 0│_ _ _│0 0 0│_ _ _│_ _ _│_ _ _│_ _ _│_ _ _│_ _ _│_ _ _│
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘

Here you see a bunch of verbs' string representations with their respective ranks. This is the script I used to generate it.

A verb with rank 0 _ is fine here. You can shorten it to 34 bytes with '0x',"1'5','3','0f'(128$#)"{~2^i.7

@miles Huh. I thought I tried that... cool! and I forgot about J's auto-row-fill feature, thanks again!

Retina, 43 bytes
:`
0x128$*5
:`5
3
;{:`33
0f
0(f+)(0+)
0$2$1

Try it online!
Explanation
This makes a lot of use of the generally underused : option which lets you print intermediate results, because it's a lot shorter to modify a single line than to build up the whole output.
:`
0x128$*5

This replaces the empty input with 0x followed by 128 5s and prints it to generate the first line.
:`5
3

This one replaces the 5s with 3s to generate the second line and prints it as well.
;{:`33
0f

This is the last special-cased line and it turns every two 3s into 0f to generate the third line. This also starts a loop through the last two stages ({). However, this stage won't do anything after the first iteration except print the current state. The ; suppresses the output at the very end of the program to avoid duplicating the last line.
0(f+)(0+)
0$2$1

This substitution now transforms each line into the next, by swapping every other pair of fs and 0s. The "every other pair" condition is enforced by matching a zero in front of the f, which makes it impossible to match consecutive pairs since matches cannot overlap.

Pyth, 26 bytes
V9%"0x%0128x"/^2 512h^2^2N

Port of my Python answer.

JavaScript (Firefox 30+), 139 113 112 92 83 80 bytes
_=>[for(x of"970123456")(f=y=>y--?f(y)+(x>6?x-4:y>>x&1&&'f'):'0x')(128)].join`
`

Finally hit the recursive sweet spot :-) Uses a handy-dandy string comprehension to save 3 bytes over .map:
_=>[..."970123456"].map(x=>(f=y=>y--?f(y)+(x>6?x-4:y>>x&1&&'f'):'0x')(128)).join`
`

.replace is also 83 bytes:
_=>"970123456".replace(/./g,x=>(f=y=>y--?f(y)+(x>6?x-4:y>>x&1&&'f'):'0x')(128)+`
`)

If a leading newline were allowed, this would also be 80 bytes:
_=>"970123456".replace(/./g,x=>(f=y=>y--?f(y)+(x>6?x-4:y>>x&1&&'f'):`
0x`)(128))

Actually, 25 bytes
9r`╙╙u9╙╙\#"0x%0128x"%`Mi

Try it online!
This solution uses the fact that f(n) = 2**512//(2**2**n + 1) (where // is floored division) to compure the values.
Explanation:
9r`╙╙u9╙╙\#"0x%0128x"%`Mi
9r`╙╙u9╙╙\#"0x%0128x"%`M   for n in range(1, 10):
      9╙╙\                   2**2**9//
   ╙╙u                                (2**2**n + 1)
          #"0x%0128x"%       pad with zeroes to 128 digits, prefix with "0x"
                        i  flatten and implicitly print

Python 2, 60 bytes
k=1
exec"print'0x%0128x'%int(256/k*('0'*k+'1'*k),2);k*=2;"*9

Try it online!

Bubblegum, 65 bytes
00000000: c5cb 4501 0441 1043 d17b d4fc 254b d110  ..E..A.C.{..%K..
00000010: f7cb 9761 9e7a 8d45 e451 4ce4 564c 04d7  ...a.z.E.QL.VL..
00000020: 2e11 b02b 8f08 80df aa5e 11fe fc77 762c  ...+.....^...wv,
00000030: 428b 5b8e ae8b 30c1 13b6 ce8b b091 377a  B.[...0.......7z
00000040: 01                                       .

Obligatory Bubblegum answer.

Haskell, 84 72 bytes
Porting @orlp's answer:
import Text.Printf
mapM(\n->printf"0x%0128x\n"$div(2^2^9)$2^2^n+1)[0..8]

94 byte alternatives without the power of Text.Printf:
import Data.List
mapM(putStrLn.("0x"++))$transpose$("53"++).reverse<$>sequence(["0f"]<*[1..7])

r=[0..127]
mapM(putStrLn.("0x"++))$('5'<$r):('3'<$r):[["0f"!!mod(div x(2^y))2|x<-r]|y<-[0..6]]

@nimi whoops, must have had loaded Control.Monad in the REPL. Fixed.

Batch, 216 bytes
@echo off
set s=5
call:c
set s=3
call:c
set a=0
set b=f
for /l %%i in (1,1,7)do call:l %%i
exit/b
:l
set s=%a%%b%
:c
for /l %%j in (0%1,1,6)do call set s=%%s%%%%s%%
echo 0x%s%
set a=%a%%a%
set b=%b%%b%

JavaScript (ES6), 74 72 70 bytes
Includes the optional trailing newline.
f=(i=1152)=>i--?f(i)+(i&127?'':`
0x`)+('53'[y=i>>7]||i&1<<y-2&&'f'):''

f=(i=1152)=>i--?f(i)+(i&127?'':`
0x`)+('53'[y=i>>7]||i&1<<y-2&&'f'):''

console.log(f())

Ruby, 66 60 45 bytes
x=2;9.times{puts"0x%0128x"%(2**512/-~x);x*=x}

Try it online!
Idea stolen from orlp

PowerShell v2+, 68 bytes
5,3|%{"0x"+"$_"*128}
($a=1)..7|%{"0x"+('0'*$a+'f'*$a)*(128/($a*=2))}

PowerShell doesn't have arbitrary precision integers without using [bigint] calls, and those can't be easily converted to hexadecimal, so we're instead treating this as a string-based challenge.
The first line handles the repeating 5 and 3 by just doing a string multiplication out to 128 characters and tacking a 0x on the front.
The next line loops from $a=1 to 7, each iteration outputting another string. Again we have the 0x tacked onto the front, and we're doing string multiplication in the middle to construct the appropriate number of 0 and f concatenated together, and then doing string multiplication of that out to the appropriate number of characters. Note we're using variable $a here, and not the loop counter $_, so we can properly scale (otherwise we'd need to loop like 1,2,4,8,16,32,64|%{...}, which is longer).
The resulting strings are left on the pipeline, and output via implicit Write-Output happens at program completion, with a newline between elements.

V, 43 bytes
64i0fòYpÓ¨¨0«©¨f«©©û2}/²²³³òdd{3ÄÒ5jÒ3Îi0x

Try it online!
This uses one of the longest compressed regexes I've ever needed in a V answer. Here is the more readable version, where I added a byte for readable regexes, and changed the unprintable escape character to <esc>
64i0f<esc>òYpÓö((0+)(f+)){2}/²²³³òdd{3ÄÒ5jÒ3Îi0x

Explanation (using the readable version):
64i0f<esc>                                          " Insert 64 "0f"s and escape to normal mode
          ò                      ò                  " Recursively:
           Yp                                       "   Duplicate this line
             Ó                                      "   Substitute:
              ö                                     "     (Optionally Turn the readable version on)
               ((0+)(f+))                           "     One or more '0's followed by one or more 'f's
                         {2}                        "     Repeated twice
                            /                       "   With:
                             ²²                     "     The second capture group twice (the '0's)
                               ³³                   "     Followed by the third capture group twice (the 'f's)
                                                    "   Once the search is not found, the loop will break
                                  dd                " Delete a line (because we have one too many)
                                    {               " Move to the first line
                                     3Ä             " Make three copies of this line
                                       Ò5           " Replace the first one with '5's
                                         jÒ3        " Move down a line and replace the second with '3's
                                            Î       " On every line:
                                             i0x    "   Insert a '0x'

Pyth - 31 30 bytes
To get pattern except for the 3's and 5's it cumulative reduces, each time doubling the chunks.
jm+"0x".[dd128+`3+`5.u.iNN6"0f

Try it online here.

Vim 72 bytes
i0x128a5Ypll128r3o0x64a0fa0Ypqqffdt0fft0p@qq@qqwYp@qq@w@w@w@w:%s/0$

TryItOnline!
Unprintables:
i0x^[128a5^[Ypll128r3o0x^[64a0f^[a0^[Ypqqffdt0fft0p@qq@qqwYp@qq@w@w@w@w:%s/0$

The 4 @ws at the end are bugging me, but because I was relying on the @q to fail out at the end of a line, it fails out the @w as well.  I might try just running q 32 times and seeing if it messes up the later lines.

GNU sed 4.2.2, 77
s/^/0x5/
:
s/x5{,127}$/&5/
t
p
y/5/3/
p
s/33/0f/gp
:a
s/(f+)(0+f+)/\2\1/gp
ta

Try it online.

C, 146 bytes
#define F for(i=0;++i<129;)s[i+1]=
#define P ;puts(s);
i,j;f(){char s[131]={'0','x'};F'5'P F'3'P for(j=1;(j*=2)<129;){F(i-1)%j<j/2?'0':'f'P}}

Ungolfed:
#define F for(i=0;++i<129;)s[i+1]=
#define P ;puts(s);
i,j;f(){
  char s[131]={'0','x'};
  F'5'P
  F'3'P
  for(j=1;(j*=2)<129;){
    F(i-1)%j<j/2?'0':'f'P
  }
}

133 bytes

@ceilingcat Easy save

brainfuck, 211 bytes
+++++++>++>>-[>>>>+<<++<+<-----]>--->>++++++++++>++<<<<<<[->----[>+++<--]>-->.<.++++++++[->>>>.<<<<]>>>.>--[<]<<]+<[->>----[>+++<--]>-->.<.++++++++[<<[>+>->.<<<-]>[<+>>->>.<<<-]>]>>>.<<<<[-<+>]<[->++<]>[-<+>]<<]

Try it online!

197 bytes through some different loop checks. I'm pretty sure the x generator can be moved outside the loop now

C#, 168 bytes
()={string R="",o="0",f="f";for(int i=0,j;i<9;i++){R+="0x";if(i>2){o+=o;f+=f;}for(j=0;j<128;){R+=i<1?"5":i<2?"3":o+f;j+=i>1?(int)Math.Pow(2,i-1):1;}R+="\n";}return R;};

///, 193 bytes
/*/\/\///X/
0x*F/5555*G/FFFF*T/3333*U/TTTT*o/0f0f*1/oooo*t/00ff*2/tttt*g/0000*h/ffff*4/ghgh*6/gghh*7/gggg*8/hhhh*9/7788/0xGGGGGGGGXUUUUUUUUX11111111X22222222X44444444X66666666X78787878X99X77988

Try it online!

Stax, 19 bytes
⌡hÅék╝94"ºé♪╛#V┐5í╒

Run and debug it
Unpacked, ungolfed, and commented, it looks like this.
512r        [0..511]
{:Brm       convert each to bits and reverse each
M           transpose matrix, filling missing elements in rectangle with zero
m           map over each element of array, using the rest of the program.  outputs implicitly.
  4/        split bits into groups of 4
  {:b|Hm    convert each 4-bit binary number to single digit hex string
  .0xp      print "0x" without newline

Run this one

JavaScript (Node.js), 72 bytes
n=1n<<512n;f=(i=2n)=>i-n?`
0x`+(n/-~i+n).toString(16).slice(1)+f(i*i):''

Try it online!
JavaScript (Node.js), 69 bytes from Arnauld's
f=(i=4608)=>i?f(i-=4)+(i&508?'':`
0x`)+('53'[y=i>>9]||i&1<<y&&'f'):''

Try it online!

Vyxal j, 136 bitsv1, 17 bytes
‛0x53f‛0f6ʀE•J₇vẎ+

Try it Online!
Math? No we don't do that here. We do string manipulation instead.
Explained
‛0x53f‛0f6ʀE•J₇vẎ+
      ‛0f           # The string "0f"...
            •       # with each character repeated n times...
         6ʀE        # for each n in [2**x for x in range(0, 7)].
             J      # Appended to...
   53f              # the list [5, 3].
# The top of the stack is [5, 3, "0f", "00ff", "0000ffff", ...]
              ₇vẎ   # Take the first 128 items of each item.
                    # This reuses previous digit/chars if the item isn't long enough
‛0x              +  # Add the string "0x" to each item
# The j flag joins on newlines before printing

 Created with the help of Luminespire at https://vyxal.github.io/Luminespire

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Alphabetize Integers
Alphabetize Integers
For a given set of numbers, put them in alphabetical order when they are spelled out (i.e. 1: one, 2: two, 90: ninety, 19: nineteen). Your code should work for the range [-999999, 999999]. Output must have a delimiter between numbers. A space will work, as will a space and a comma as shown in the examples below. Input can be an array of integers, a string of delimited numbers, or however you see fit. All integers are assumed to be unique.
Numbers are not hyphenated for the purposes of this challenge and spaces are alphabetized before any other characters. Negative numbers are assumed to be expressed by using the word minus. For example, four would precede four thousand and the number -40 would be sorted using the string minus forty. Assume all numbers will be solely comprised of number words and no conjunctions (e.g. use two thousand forty two instead of two thousand and forty two).

Test Cases
Single Digit Integers:
Input:
1, 2, 3, 4, 5

Output:
5, 4, 1, 3, 2

Multiple Digit Integers:
Input:
-1002, 5, 435012, 4, 23, 81, 82

Output:
81, 82, 5, 4, 435012, -1002, 23

Spaces between words, no hyphens, commas or "and":
Input:
6, 16, 60, 64, 600, 6000, 60000, 60004, 60008, 60204, 60804

Output:
6, 600, 6000, 16, 60, 64, 60000, 60008, 60804, 60004, 60204

Remember, this is code-golf, so the code with the fewest bytes wins. No loopholes allowed!

Here is the link to the relevant sandbox post.

Will the input ever contain more than one of a single integer?

@ETHproductions No, it will not. I'll specify that in the question.

Welcome to PPCG. Nice avatar. :D Nice first question.

@TimmyD Thanks! I'm looking forward to PowerShell-ing everything I can around here.

Will the input ever contain a zero?

@ETHproductions Yes. All numbers for the range [-999999,999999].

I was reading the Wayside School series to my kids and A Wonderful Teacher (the second chapter 19 in Wayside School is Falling Down) inspired me to write a challenge to output the names of all the numbers zero to one million in alphabetical order. I'd say this already covers that challenge with only a few tweaks. I wonder if Miss Zarves would accept the output as an answer...

JavaScript (ES6), 189 179 186 bytes

let f =

a=>a.sort((x,y)=>!x-!y||(X=q(x),Y=q(y),X>Y)-(X<Y),q=n=>n<0?"L"+q(-n):n>999?q(n/1e3)+"Z"+q(n%1e3):n>99?q(n/100)+"K"+q(n%100):n>19?"  cYHFVSCO"[n/10|0]+q(n%10):"0PdaIGTQAMWDbXJEURBN"[n|0])

let g = a => console.log(`[${f(a)}]`)

g([1,2,3,4,5])
g([-1002,5,435012,4,23,81,82])
g([0,1000,1100])
<input id=I value="1 2 3 4 5"><button onclick="g(I.value.match(/\d+/g)||[])">Run</button>

The basic idea is to convert each input number into a short string that's in the correct lexographical position compared to all other number-string pairs. Here's the dictionary used: (Don't run the snippet; it's just used to hide the long list.)

A eight
B eighteen
C eighty
D eleven
E fifteen
F fifty
G five
H forty
I four
J fourteen
K hundred
L minus
M nine
N nineteen
O ninety
P one
Q seven
R seventeen
S seventy
T six
U sixteen
V sixty
W ten
X thirteen
Y thirty
Z thousand
a three
b twelve
c twenty
d two

This creates a very concise way of mapping each number to its lexographically correct position. That's what the recursive q function does:
q(-X)        => "L" + q(X)
q(XYYY)      => q(X) + "Z" + q(YYY)
q(XYY)       => q(X) + "K" + q(YY)
q(XY >= 20)` => "  cYHFVSCO"[X] + q(Y)
q(X)         => "0PdaIGTQAMWDbXJEURBN"[X]

The 0 at the beginning of the string is to ensure that e.g. 100 (one hundred, converted to PK0) is sorted before 101 (one hundred one, converted to PKP). This creates an odd scenario where 0 (zero) is sorted to the front of the array, so to get around this, in the sorting function we first sort any zeroes to the right with !x-!y||(....

Looks like it doesn't work for [1100, 1000]. I would expect the output to be 1000 (one thousand), 1100 (one thousand one hundred), but the output is the same order as input.

@milk Hmm... I'm not sure why this happens, but I'll look into it.

@milk Ah, 1000 is being parsed as one thousand zero; I'll fix this momentarily. Must we support 0 on its own though? It's a unique case that will add 15 bytes or so to my code.

Inform 7, 214 201 118 bytes
Inform 7 is an absolutely terrible language for golfing, so I wanted to give it a chance here.
Indentation should use tab (\t) characters, but HTML doesn't like those. Conversely, Inform doesn't like spaces for indentation, so you'll have to replace the spaces with tabs if you copy-paste the code from here to test it. Or just copy-paste from the Markdown source instead.
Golfed:

To X:
    repeat through Table 1:
        now Q entry is "[R entry in words]";
    sort Table 1 in Q order;
    say "[R in Table 1]".

Input should be an Inform table, like so (with \t between the columns):

Table 1
R (number)  Q (text)
-1002
5
435012
4
23
81
82

Output:

81, 82, 5, 4, 435012, -1002, 23

This function runs through the table once, adding a textual representation of each number in a new column. Then it sorts the table rows according to the text column; in Inform, strings are sorted lexicographically. Finally, it prints out the original column in the new order. Conveniently, Inform 7's "crude but sometimes useful" format for printing out table columns turns out to be comma separated, exactly as requested.
Ungolfed, with boilerplate showing how to call the function:

To print the numbers in alphabetical order:
    repeat through the Table of Sortable Numbers:
        now the name entry is "[the index entry in words]";
    sort the Table of Sortable Numbers in name order;
    say "[the index column in the Table of Sortable Numbers]".

Table of Sortable Numbers
index (number)  name (text)
-1002
5
435012
4
23
81
82

There is a room.
When play begins: print the numbers in alphabetical order.

I'm slightly confused by this. Is words a reference of the spelled out versions of numbers, built into Inform 7?

@Pavel Indeed! "(number) in words" returns a string with a textual representation of the number. It conveniently uses "minus" for negative numbers, and while it puts hyphens between words, it does so consistently and alphabetizes hyphens before all letters (so the end result is the same).

+1 for the language choice. I'd have to check, but I suspect there are some golfing opportunities left, though; for example, does the parser really require all those "the" articles? And you'd have to ask the OP, but I don't see any obvious reason why " and " would not be a valid delimiter. Even if not, a single space is explicitly allowed, so just say "[R entry] " should suffice.

I'd say the "and" at the end is fine. I didn't say that the delimiters had to be uniform, so this is a perfectly acceptable answer. If I could give points for most interesting answer, I would give it to you. I really enjoy the readability of this language, even golfed. Nice job!

I finally got a chance to play with Inform7 a bit, and managed to re-golf your entry down to just 118 bytes. Since posting Inform code in comments doesn't work very well, I went ahead and edited it into your answer directly. I hope you don't mind, feel free to revert and/or tweak my edits any way you like if you do.

...and, unfortunately, I found a bug in the sorting: it turns out that hyphens do matter, e.g. for the comparison between 44 ("forty four") and 40004 ("forty thousand four"). This can be fixed with a string replacement like replace the text "-" in Q entry with " ", but that costs a lot of bytes. Also, it turns out that, to correctly sort the test case 40, 44, 40000, 40804, 40004 (which should sort in that order), you'll also need Use American dialect (to get rid of "and") and replace the text "," in Q entry with "" (to remove a comma from 40804. :(

Mathematica, 67 bytes
SortBy[#,#~IntegerName~"Words"~StringReplace~{","->"","-"->""}&]&

Unnamed function taking a list of integers as its argument and returning a list of integers as its value. #~IntegerName~"Words" is a built-in that changes an integer to its name in English. IntegerName sometimes has commas and hyphens in its output, so the StringReplace call gets rid of those. (Sadly the hyphen is actually the 3-byte character, 8208, in UTF-8.) Then SortBy sorts the original list alphabetically according to the value of the modified integer name.
A nice coincidence: IntegerName uses negative instead of minus in its output—but no word appearing in the names of any of the allowed numbers is alphabetically between those two words, so no replacement is needed!
(Hat tip to ngenisis for reminding me of Sortby.)

Kudos! I came very close to getting this solution, but that dash was giving me headaches!

Does your answer here actually use the correct hyphen? If I copy what you have here into Mathematica it doesn't replace the hyphens from IntegerName. The Wolfram documentation says that it is unicode character 2010.

Probably not, then—I tried to get the correct hyphen in this answer, but looks like I didn't succeed.

I cut your answer in half ;)

And then some... you make unnecessary modifications to the string.

Bash + GNU utils + bsdgames, 52

4 bytes saved thanks to @izabera.

sed 's/.*/echo `echo &|number`:&/e'|sort|sed s/.*://

I/O is newline-delimited lines.

The first sed expression replaces each numerical number with a shell command that outputs the word form of the number (as given by the bsdgames number utility), followed by a : then the numerical form of the number.
This is then sorted.
Then the second sed strips leading characters up to and including the :, leaving the numerical form sorted as required.

number correctly handles "minus", and its output is close enough to the specificed format that the sort works as required.  It does output "fourty-four" instead of "fourty four", but this shouldn't matter from the sorting perspective.
The bsdgames package may need installation:
sudo apt-get install bsdgames

The sed and sort utilities are almost certainly already in your distro.

-t: is useless and you can use number<<<&

@izabera Yes - thanks - I removed the -t:.  However, sed's eval feature runs commands using sh, so bash features like <<< won't work.

it works fine as long as your sh is bash :P

@izabera Nope - if bash as started as sh it tries to emulate Posix sh as much as possible, which means that bashisms such as <<< are turned off.  GNU sed's eval feature starts commands with /bin/sh -c ... and not /bin/bash -c ....  Have you tried this?

bash never turns off <<<, not even in posix mode

@izabera Sorry - I was mistaken.  I thought /bin/sh was symlinked to /bin/bash on my Ubuntu 16.04 VM, but its not  - it is symlinked to /bin/dash.  Conversely on my macOS machine it is /bin/bash and you're right - <<< does work in in sh.  But this answer won't work on macOS because of the dependency on bsdgames number which I don't want to jump through the hoops of to install on macOS.  I'm sure there are other Linux distros out there that will allow the <<< version of this answer, but I'm sticking with Ubuntu for now.

This answer appears to be locale-dependent: in the en_US.UTF-8 locale this correctly sorts 44 before 40004 for me (on Ubuntu), because in this locale sort apparently ignores the difference between hyphens and spaces. In the default C locale, however, it's broken, because in that locale all sorting is done in pure ASCII order, so that hyphen sorts after space.

Python + inflect, 97 91 89 bytes
from inflect import*
a={x:engine().number_to_words(x)for x in words}
sorted(a,key=a.get)

Used the inflect library to transform the words array of integers into their phonetic/string representation. Stored into a dictionary of k/v pairs where the keys were the numeric representation and values were the string representation. Returned the list of keys as sorted by values.
EDIT: Saved 5 and 3 bytes, thanks to ETHproductions and Alex.S!

Welcome to PPCG! You can golf this by removing spaces; for example, the second line can be a={x:inflect.engine().number_to_words(x)for x in words}.

You can save two bytes using from inflect import* and throwing out inflect. in the second line.

Alas, looks like this also fails to correctly sort the list 40, 44, 40000, 40804, 40004, 40204 (which should stay in that order).

Common Lisp, 113 bytes
No external libraries necessary.
(print(mapcar #'cdr(sort(loop for i in x collect(cons(format()"~r"i)i))(lambda(y z)(string-lessp(car y)(car z))))))

Output if x is '(1 2 3 4 5):
(5 4 1 3 2)

Mathematica, 30 bytes
The answer below outputs a pure function which will take a list of integers as an input and sort them by their alphabetic name. Just what the doctor ordered ;)
SortBy[#~IntegerName~"Words"&]

Here is the ungolfed version:
SortBy[IntegerName[#, "Words"]&]

And here is an example usage:
SortBy[#~IntegerName~"Words"&][{0,1,2,3,4,5,6,7,8,9,10}]

Which could also be written as
SortBy[#~IntegerName~"Words"&]@{0,1,2,3,4,5,6,7,8,9,10}

They produce identical outputs - in mathematica, f[x] is equivilant to f@x.
Outputs: {8, 5, 4, 9, 1, 7, 6, 10, 3, 2}

There is a much longer answer that another user posted in Mathematica. That answer tries to correct for some small differences between the way mathematica alphebatizes numbers to better conform to the way the OP stated numbers should be alphebatized, however the things they correct for don't affect sorting order, and my answer outputs identically to theirs:
MyF = SortBy[#~IntegerName~"Words"&];
TheirF = SortBy[#, #~IntegerName~"Words"~ StringReplace~{"," -> "", "-" -> ""} &] &;
MyF[Range[-999999, 999999]] == TheirF[Range[-999999, 999999]]
(*Outputs True*)

A great investigation!—unfortunately, they don't actually give the same order. TheirF correctly sorts 888 before 880,000, while MyF doesn't. Probably the issue is with the copy-pasting of the strange hyphen: your version of TheirF is probably replacing normal hyphens (of which there are none), while the actual version replaces the strange 3-byte Unicode hyphen. (It would still be interesting to see whether removing commas is necessary.)

I tested it on Range[999999]. Looks like eliminating the commas is unnecessary, but replacing "[Hyphen]" with "" is definitely necessary.


text:
Hilbertify an image
I like the Hilbert Curve.

Your task for this challenge is to take an image (strictly a square image where all the sides are a power of two pixels wide) and unravel it line by line in a zig-zagging fashion and ravel it back up in a pseudo-Hilbert curve.
Unraveling
To unravel you will start with the pixel in the upper left hand corner and travel right until you arrive at the edge of the image.  Once you have hit the edge of the image you will move down to the next row and begin traveling left until you hit the edge again.  You will continue unraveling row by row switching the direction each time so you get one continuous curve.  This should look like a well played game of snake
The result of unraveling should be an order of pixels that includes every pixel exactly once
Reraveling
Once you have an order for the pixels you will rearrange them on a new equally sized canvas following the path of a pseudo-Hilbert curve.  For a 2**n sized square image you should use the nth iteration of the pseudo-hilbert curve.  Each pixel will be placed in exactly one spot on the new canvas.  You should reravel the image so that the point originally in the top left (the start of our snake curve) will remain there and point in the bottom right (the end of our snake curve) will be placed in the top right.
I/O
Your program or function should take in an image of specified constraints via standard methods and output another image via standard methods.
Scoring
This is code-golf program with the fewest bytes wins.
Examples
Input

Output

Input

Output

Input

Output

I also recommend testing on a blank white or solid color image to make sure you are not missing any pixels.
Feel free to include your own results in your answers!

Is it okay to take an array of RGB values instead of an image as the input? What about output?

@JHM No you cannot.  You can choose whatever image format you want though, so if your language doesn't have builtin image support you can use an uncompressed .ppm file which is very similar to an array of RGB values.

Mathematica, 286 273 bytes
Image[Array[1,{l=Length@#,l}]~ReplacePart~Thread[#&@@@Split[#&@@@FoldList[Switch[#2,"-",#{1,I},"+",#/{1,I},"F",#+{ReIm@Last@#,0},_,#]&,{{1,1},I},Characters@Nest[StringReplace@{"L"->"+RF-LFL-FR+","R"->"-LF+RFR+FL-"},"L",Log2@l]]]->Join@@MapAt[Reverse,#,2;;;;2]]]&@*ImageData

Phew! Challenging but fun!
Explanation
ImageData

Convert an Image into an array of RGB values.
Array[1,{l=Length@#,l}]

Generate an l by l array with head 1, where the l is the length of the input (i.e. the width of the image).
This yields {{1[1, 1], 1[1, 2], ..., 1[1, L]}, {1[2, 1], ..., 1[2, L]}, ..., {1[L, 1], ..., 1[L, L]}} (l written in caps to reduce confusion)
StringReplace@{"L"->"+RF-LFL-FR+","R"->"-LF+RFR+FL-"}

A StringReplace function that replaces every "L" with "+RF-LFL-FR+" and "R" with "-LF+RFR+FL-"
Nest[ ... ,"L",Log2@l]

Apply the StringReplace function to the String "L", Log2[l] times.
Characters

Convert the resulting String into a List of characters.
Switch[#2,"-",#{1,I},"+",#/{1,I},"F",#+{ReIm@Last@#,0},_,#]&

An unnamed function that:

If the second input is "-", multiply the second element of the first input by I.
If the second input is "+", divide the second element of the first input by I.
If the second input is "F", increase the first input by the ReIm (separates the real and imaginary part of the input) of the second input.

FoldList[ ... ,{{1,1},I}, ... ]

Starting with {{1,1},I}, cumulatively apply the above unnamed function, using each element of the List of characters as the second input. This code yields the outputs of all iterations.
#&@@@Split[#&@@@ ... ]

Get rid of the second elements of each List and delete duplicates. (The steps up to this point generate a List of coordinates of the Hilbert curve)
Join@@MapAt[Reverse,#,2;;;;2]

Unravel the input RGB array (reverses every other row and flattens).
Thread[ ... -> ... ]

Create Rule objects, such that the first element in the first input (the coordinates of the Hilbert curve) is paired with the the first element of the second input (the unraveled image), the second element with the second input, and so on.
... ~ReplacePart~ ...

Apply those replacement Rules to the Array from the second step.
Image

Convert to the array of RGB values into an Image.
Sample in/out
Input:

Output:

Input:

Output:

Inverse function (266 253 bytes)
Image[MapAt[Reverse,Extract[#,#&@@@Split[#&@@@FoldList[Switch[#2,"-",#{1,I},"+",#/{1,I},"F",#+{ReIm@Last@b,0},_,#]&,{{1,1},I},Characters@Nest[StringReplace@{"L"->"+RF-LFL-FR+","R"->"-LF+RFR+FL-"},"L",Log2[l=Length@#]]]]]~Partition~l,2;;;;2]]&@*ImageData

Octave 234 Bytes
I=imread(input(''));w=rows(I);X=[0,3;1,2];for k=2:log2(w);n=numel(X);X=[X',rot90(X',2)+3*n;X+n,X+2*n];end;for k = 1:3;I(2:2:end,:,k)=fliplr(I(2:2:end,:,k));end[~,S]=sort(X(:));I(S+(0:w^2:2*w^2))=permute(I,[2 1 3]);imwrite(I,input(''))

File names of input and output images should be provided form standard input.
size of code without input/output is 194 bytes.
Explanation:
The base pattern of indices is:
X =
  0 3
  1 2

In each iteration 4 copies from result of the previous iteration made and some transformation applied to each copy then all blocks concatenated to form the current result.
X =[0,3;1,2];
for k = 2:log2(s)
    n=numel(X);
    X = [X',rot90(X',2)+3*n;X+n,X+2*n];
end

so we have:
block(1,1): X'
block(1,2): rot90(X',2)+3*n
block(2,1): X+n
block(2,2): X+2*n

0    1  | 14   15
3    2  | 13   12
--------|--------
4    7  |  8   11
5    6  |  9   10

Hilbert indices sorted and indexes of sorted elements returned:
[~,S]=sort(X(:));

Unraveling applied flipping all even rows:
for k = 1:3
    I(2:2:end,:,k) = fliplr(I(2:2:end,:,k));
end

Reraveling applied :
-S repeted for each channel
-permutation applied since in Octave data arranged column wise
I(S+(0:w^2:2*w^2))=permute(I,[2 1 3]);

Example images:

You can choose to have your program work as a function if you want to avoid using I/O.

function+end keywords consume more bytes!


text:
Bouncey-edged XY box with a marker at Z
Long time lurker first time poster here.
Write a program which takes 3 inputs: X, Y and Z.

X = across (columns)
Y = down (rows)
Z = Location Marker

The program should then print a visual grid X across and Y down. This grid will can be made of any character except "+". Each 'location' is given an index number, counting up from 1 at coordinate 1, 1 across and then down until the end.
X and Y will always be at least 3, and Z will never be bigger than X * Y.
Z will represent the location which is printed as a "+", on the location as well as 1 character left, right, up and down. For example:
 +
+++
 +

Finally, if the + characters would intercept the edges (top most, left most, right most and/or down most edge), then the + should bounce back along the same axis and overflow the other side.
Examples:
Input = 5, 5, 13
-----
--+--
-+++-
--+--
-----

Input = 10, 10, 10
-------+++
---------+
---------+
----------
----------
----------
----------
----------
----------
----------

Input = 10, 10, 21
----------
+---------
+++-------
+---------
----------
----------
----------
----------
----------
----------

Edit : non square example
16,3,32
---------------+
-------------+++
---------------+

I think I've covered everything.
There should be no limit to the input, but if your program requires, cap it off at 64 * 64.
Bonus point (can I do that?): Input Z should not be > X * Y, but if it is larger than Y * Z, then output the center + to the middle of the grid.
EDIT: Input Z cannot be greater than X * Y
Edit 2:. Made some changes to X and Y to hopefully be clearer
This is code golf, shortest code wins.

Welcome to Programming Puzzles and Code Golf! This is a nice challenge, but I recommend posting future challenges to the Sandbox where they can get feedback before being posted to the main site.

What is the "Bonus point" about? Does implementing that exact feature give an advantage to your byte-count? If it does, you should explicitly note how big of a bonus it is. (As a side note, bonuses in code-golf are generally discouraged)

@betseg - oops. Sorry, hopefully I can gain some interest having missed that important step.

@DrMcMoylex - Noted, thanks, have removed the bonus now.

You should explain how Z represents the location (1-based row-major it seems)

X accross and Y down @luis

You shouldn't be accepting an answer in the first day of posting, I am fairly confident a MATL/Jelly/05AB1E golfer will see this and solve it in much less bytes than Python. I think most people tend to wait at least a week.

@kade. Thanks the rules made it sound like the answer you choose doesn't have to be the best one?

@James yes I'm an all round stooge. First across, then down. And yes, it should be 10 rows and 10 columns

@james I made some changes to the description. Is that clearer?

@james That's the spirit! Sorry mate, my fault

I am sad that there has been so few golf language attempts at this!!

Python 2, 172 171 bytes
def f(x,y,z):A=[['-']*x for _ in' '*y];z-=1;X,Y=z%x,z/x;a=[2,-1];A[Y][X]=A[Y+a[Y>0]][X]=A[Y-a[Y<y-1]][X]=A[Y][X+a[X>0]]=A[Y][X-a[X<x-1]]='+';print'\n'.join(map(''.join,A))

Edit: Saved 1 bytes by converting to function.
Previous (more readable):
x,y,z=inputtt
A=[['-']*x for _ in' '*y]
z-=1
X,Y=z%x,z/x
a=[2,-1]
A[Y][X]=A[Y+a[Y>0]][X]=A[Y-a[Y<y-1]][X]=A[Y][X+a[X>0]]=A[Y][X-a[X<x-1]]='+'
print'\n'.join(map(''.join,A))

nice job, think I broke it though with 10,100,300. Doesn't seem to behave at the far right boundary?

@JakeHarry Works for me: http://ideone.com/G2fwV1

Ahh, I'm a stooge, the ide I used wasn't fixed width so it was technically right, just not to the eyes.

Befunge, 175 bytes
>&:10p60p&:00p&1-:10g%:20p\10g/:30p::1+00g-!-\!+2-50p::1+1v
vg02g01*`\4\`0:-g05\!-g03:g00p01-1<g06+p00-1<p04-2+!\-!-g0<
>-!*\10g40g-:0`\4\`**+!2*"+"+10g:#^_$5500g:#^_$$$>:#,_@

Try it online!
The first line (and a short continuation onto the second line) is where the parameters are read in and a few constants are calculated - the coordinates of the location (lx, ly), as well as adjusted coordinates which account for the bouncing off the edges:
ax = lx - (lx+1==w) + (lx==0) - 2
ay = ly - (ly+1==h) + (ly==0) - 2

The second and third lines contain the main loops over the height and width of the grid, the path of execution going from right to left initially before turning around onto the third line going left to right. For each coordinate in the grid (gx, gy) we calculate  the following condition:
(gx==lx && gy>ay && gy<ay+4) || (gy==ly && gx>ax && gx<ax+4)

If that condition is true, we push a "+" onto the stack, if false we push a "-". To avoid branching here, we're really just pushing 43 + 2 * !condition (43 being the ASCII value of plus and 45 being minus).
Once the loops have finished, the final bit of code is just a standard output routine that prints out everything on the stack.

JavaScript (ES6), 165 bytes
(x,y,z,a=[...Array(y)].map(_=>Array(x).fill`-`))=>a.map(a=>a.join``,a[b=--z/x|0][c=z%x]=a[b?b-1:2][c]=a[b][c?c-1:2]=a[y+~b?b+1:y-3][c]=a[b][++c<x?c:x-3]=`+`).join`\n`

JavaScript (ES6), 170
Still golfable
(w,h,z,t=--z%w,u=z/w|0,r='-'.repeat(w),S=(f,j)=>(r+f+r).substr(w-j,w))=>[...Array(h)].map((q=u-!!u-!(u+1-h),y)=>y-u?y>=q&y<q+3?S('+',t):r:S('+++',t-!!t-!(t+1-w))).join`
`

Less golfed
(w, h, z
, t=--z%w
, u=z/w|0
, r='-'.repeat(w)
, S=(f,j)=>(r+f+r).substr(w-j,w)
) => [...Array(h)].map(
    (q = u-!!u-!(u+1-h),
     y) => y-u?y>=q&y<q+3?S('+',t):r:S('+++',t-!!t-!(t+1-w))
).join`\n`

Test

F=
(w,h,z,t=--z%w,u=z/w|0,r='-'.repeat(w),S=(f,j)=>(r+f+r).substr(w-j,w))=>[...Array(h)].map((q=u-!!u-!(u+1-h),y)=>y-u?y>=q&y<q+3?S('+',t):r:S('+++',t-!!t-!(t+1-w))).join`
`

function update() {
  var [x,y,z] = I.value.match(/\d+/g)
  O.textContent = F(+x,+y,+z)
}

update()
<input value='5 6 10' oninput='update()' id=I>
<pre id=O>


text:
Compute the height of a radix tree
Introduction
A radix tree, also known as compressed trie or compressed prefix tree, is a tree-like data structure for storing a set of strings.
The edges of the tree are labeled by nonempty strings, and each node is either terminal or nonterminal.
The strings that the tree contains are exactly the labels of all paths from the root to a terminal node.
The tree must be in the normal form defined by the following conditions:

All nonterminal non-root nodes have at least two children.
For every node, all outgoing edges have different first characters.

For example, here is the radix tree containing the set ["test", "testing", "tested", "team", "teams", "technical", "sick", "silly"], with (N) representing a nonterminal node and (T) a terminal node:
-(N)-te-(N)-st-(T)-ing-(T)
  |      |      |
  |      |      +-ed-(T)
  |      |
  |      +-am-(T)-s-(T)
  |      |
  |      +-chnical-(T)
  |
  +-si-(N)-ck-(T)
        |
        +-lly-(T)

In this challenge, your task is to compute the height of the tree, given the strings as input.
Input
Your input is a non-empty list of strings of lowercase ASCII letters.
It will not contain duplicates, but it may be in any order.
It may contain the empty string.
You may take the input in any reasonable format.
Output
Your output shall be the length of the longest root-to-leaf path in the corresponding radix tree, measured in the number of nodes it contains.
In the above example, the correct output is 4, corresponding to the paths
(N)-te-(N)-st-(T)-ing-(T)
(N)-te-(N)-st-(T)-ed-(T)
(N)-te-(N)-am-(T)-s-(T)

which contain 4 nodes.
Further examples
Here are a couple more examples of radix trees:
[""]
-(T)

["","fuller"]
-(T)-fuller-(T)

["","full","fuller"]
-(T)-full-(T)-er-(T)

["full","fuller"]
-(N)-full-(T)-er-(T)

["full","filler"]
-(N)-f-(N)-ull-(T)
        |
        +-iller-(T)

Rules and scoring
You can write a full program or a function.
This is code golf, so the lowest byte count wins.
You can use any built-ins or libraries you want, but remember to include all imports etc. in your byte count.
Third-party libraries – those not included in the standard install of your language – are allowed, but must be listed in the header separately, e.g. Python + pytrie0.2, 60 bytes.
Test cases
[""] -> 1
["fuller"] -> 2
["","fuller"] -> 2
["","full","fuller"] -> 3
["full","fuller"] -> 3
["full","filler"] -> 3
["full","filler","filter"] -> 4
["full","filler","fi","filter"] -> 5
["test","testing","tested","team","teams","technical","sick","silly"] -> 4
["a","aaaa","aabbaa","aabbaab","abaaa","aab","aabbb","aabba"] -> 8
["dbdbaca","ab","a","caaabaaa","adbbabdb","dbdbdbaca","dbbadbacaba","db"] -> 4
["db","dbbdbb","dbaa","cabcacaa","","acaabcacab","b","abaaaca","bacaaaaa"] -> 3
["aabaabdbb","bacaabadbbdb","abb","aabaa","ab","bcadbb","adbbcaaadbbb","caaa","bbdbcacadbab","dbbdbdb"] -> 4
["bbcaaabbbabbcadbbacadbbdbdb","b","bbbbaaaaaababa","ca","bb","bdbbacadbbdbbdbbababaacaca","abbaabbabcabaaa","bbbacacacabcacacabaaabb","bbcaaaab","bbbbcaacaadbcaaa","babbabcadbdbacacabbcacab","abcabbbaacadbcadb","bbcabbcadbcacaacaadbadbcaadb","dbbbdbbdbacaabbacabcadbdbacaca","bbaabdbdb","cabcadbbbadbadbbaadbcaca","adbadbadbdbcacadbdbbcaadbcaca","abaabbcab","aaabcaabcaab","bacacabcacaacadbadbb"] -> 6

In your first example, I feel like "am" should be followed by a node with two children, one with -""-(T) and the other with -"s"-(T). (Compare to "slow"/"slowly" in the second example on the page you linked to.) This won't affect the length of the longest root-to-leaf path, though.

@GregMartin The Wikipedia page has a slightly different implementation. I feel that this one is more natural, and as you said, it doesn't affect the height.

JavaScript (Firefox 30-57), 137 bytes
f=(a,b=["",...a],s=new Set(b.map(w=>w[0])))=>b.length>1?(s.size>1)+Math.max(...(for(c of s)f(a,[for(w of b)if(w&&w[0]==c)w.slice(1)]))):1

There must be something wrong with my algorithm as I seem to have to special-case an empty string parameter.

In my reference solution, the empty string is a special case too. It's because the root node has its own rules.

I sort of had to special-case it as well, but that special case is only a single character in my solution (the . at the end of the first line).

Retina, 69 55 bytes
The trailing linefeed is significant.
m`.(?<=(?=\D*^\1(?!\2))\D*^(.*)(.))|^.
:$&
T`w
O`
A-2`

Input is a linefeed-separated list.
Performance can be increased significantly by inserting a \A before the last \D on the first line.
Explanation
A node is inserted into a word in three places:

The beginning.
After any longest prefix shared with another word. That is, a shared prefix after which the two words differ.
The end.

In Retina, it tends to be shorter to produce N+1 when you've counted N things, so we're ignoring the one at the end. However, for the case of the empty input, we'll then also have to ignore the start, because beginning and end are the same.
To do the actual counting we insert : into every place where there is a node. Then we simply find the maximum number of : in a word and return that plus 1. Here is how the code does it:
m`.(?<=(?=\D*^\1(?!\2))\D*^(.*)(.))|^.
:$&

This detects all the nodes. It matches a character. Then it enters a lookbehind which captures that character into group 2 and the prefix before it into group 1. Then it goes all the way to the beginning of the string to start a lookahead, which checks that it can find the prefix somewhere where it's not followed by the captured character. If we find this match we insert a : in front of the character. We also match the first character of the current word to insert a : at the beginning of non-empty words.
T`w

This removes all the letters and leaves only the :.
O`

This sorts the lines, bringing the maximum depth to the end.
A-2`

This discards all but the last line.
And the empty line at the end counts the number of empty matches in that line, which is one more than the number of colons in it.
Try it online! (The first line enables a linefeed-separated test suite, where each test case uses comma separation instead.)


text:
Dump core on Linux
Write the shortest program which, when run with no arguments, stdin, or user input, triggers a core dump.
Your code must behave this way when run on some common out-of-the-box Linux distribution. Other than installing support for your target language, you may not reconfigure the system to make it more fragile than it is as provided.
25-byte C example: int main(){*((int*)0)=0;} on my Ubuntu outputs
Segmentation fault (core dumped)

related

I'm posting here since I'm not sure if this is right, but is perl -ue '' a valid solution? (question intended for people knowing perl)

@Dada, when running that I get Aborted (core dumped) instead of Segmentation fault (core dumped).

@redstarcoder It doesn't have to be a segfault, so that would work.

We already have questions for the fastest way to create a SIGSEGV and the fastest way to create a SIGILL. Dumping core on Linux without a signal is likely to be very verbose compared to crashing in a way that creates a core file, so this question is basically "shortest way to cause a SIGQUIT, SIGILL, SIGABRT, SIGFPE, SIGSEGV, SIGBUS, SIGSYS, SIGTRAP, SIGXCPU, or SIGXFSZ". I think we'd be better off with those as separate questions, rather than having a combined question for any (especially as some of the existing SIGSEGV/SIGILL are very short).

C, 5 bytes
main;

Try it online!
Slightly longer, 7 bytes
main=0;

Why did I get downvoted? This is my first post ever.

I can't guarantee this is what happened, but it's possible that your post was flagged as low-quality because it was short, and then the system itself casted a downvote because you edited. We really dislike this behavior, but it's something the system does that we can't change.

Welcome to Programming Puzzles & Code Golf! The downvote was cast automatically by the Community user when you edited your answer. I consider this a bug.

The "maximum golfed" answer counts as 9 bytes; it's 2 in the file itself, but has 7 bytes of penalties (Dm=main) because it requires an unusual compiler configuration (you'd write it as "2+7 = 9 bytes"). In general, trying to hide code in the compiler configuration or the program's filename is a cheap tactic, and the penalties are intended to prevent it improving your score except in cases where it's interesting.

Well said! I will remove it.

Jelly, 2 bytes
×ß

TryItOnline!
A dyadic atom (here ×, but there are swathes of others) followed by the quick ß which instructs to call the same link (the whole line of code) with the same arity - calling it once more with any arity would also work, so, since it is the only line of code, ß could be replaced by any of ¢ÇçÑñ (last link as a nilad, last link as a monad, last link as a dyad, next link as a monad, or next link as a dyad).

NASM, 3 bytes
ret

I guess it tries to jump to whatever is on the default stack and immediately segfaults :).
Built with: nasm -f elf64 golf.asm && ld golf.o -o golf

BASH, 10 bytes
kill -6 $$

kill -6 precisely does this

C, 14 bytes
main(c){c/=0;}

It's that simple 8-)


text:
Make big rocks into small rocks
Welcome to the grinder.
Your task is to make big rocks into small rocks by grinding them.
Take an input of a big rock of size n > 3  and grind it.
Continue to grind the rocks by dumping them into the grinder until the size of all the rocks are 2.
rocks are always grinded into equal even halves. If the result of a grinding is odd take result - 1.
Print the output of each grinding as you proceed.
Examples
input: 5
output: 22
The result are two rocks of size 2
input: 50
output:
2424 //two rocks of size 24
12121212 //four rocks of size 12
66666666 //8 rocks of size 6
2222222222222222

the result is 16 rocks of size 2
input: 30
output:
1414
6666
22222222

the result is 8 rocks of size 2
This is code-golf so the shortest code wins! Have fun and good luck!

You can expect it to be above 3.

Do we have to use your format (all numbers concatenated) or can we use things like lists? Some answers seem to do that instead.

As long as the output displays each iteration the format does not need to be like above.

...does that go as far as being allowed to output he input too? e.g. for input 50 could output be [50, [24, 24], [12, 12, 12, 12], [6, 6, 6, 6, 6, 6, 6, 6], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]]?

@JonathanAllan a single array is fine, a 2d array doesnt really fit the requirements.

I would say a 2d array does and a 1d does not , but it's up to you so OK.

@JonathanAllan just answer the dang question :P

Can we assume input will always be <100? <256?

is it a program, or function? is initial number should be read from stdin or can be passed as argument?

@user902383 either is fine unless specified in the challenge as per meta consensus. As for input and output, again both are fine - see this post.

TSQL, 61 59 bytes
DECLARE @ int=50

,@x int=1WHILE @>2SELECT @=@/4*2,@x*=2PRINT replicate(@,@x)

Try it out

COW, 297 291 bytes
MoOMoOMoOMoOMoOMoOMoOMoOMoOMoOmoOMoOmoOmoOoommOoMoOMOOmoOMMMmoOMMMmoOOOOMoOmOoMOOMOomoOmoO
MOOMOomOoMOomoOmoomOoMMMOOOMoOmoOMMMmOomOomoomoOmoOMOOMOomOomOomOoMOomoOmoOmoOmoomOomOomOo
mOomOoMMMmoOMMMMOOMOomoOOOMmOomOoMoOmoOmoomOomOoMoomoOmoOmoOMOOMOoMOomoOMoOmOomoomoOMMMOOO
mOoMMMMMMmOoMMMMOomoo

Try it online!
The code prints each number on its own line, and separates iterations with an additional newline.  It also prints the first iteration by itself, followed by a newline.  So an input of 5 would give an output that looks like 5  2 2   except with newlines instead of spaces.  Sample output for 50 is given below.
Explanation tree:
MoOMoOMoOMoOMoOMoOMoOMoOMoOMoOmoOMoOmoOmoOoom ;Store 10 in [0], 1 in [1], and integer input in [3]
mOoMoO                                        ;Store 1 in [2]
MOO                                           ;Loop while [2] is non-zero
   moOMMMmoOMMMmoOOOOMoOmOo                   ;   Copy [3] to [4], clear contents of [5], and store 1 in [5]
   MOO                                        ;   Loop while [4] is non-zero
      MOomoOmoO                               ;      Decrement 4 and move to 6
      MOO                                     ;      Loop while [6] is non-zero
         MOomOoMOomoO                         ;         Decrement [5] and [6]
      moo                                     ;      End loop once [6] is empty
      mOoMMMOOOMoOmoOMMMmOomOo                ;      Copy [5] to [6], and reset [5] to 1, then move back to [4]
   moo                                        ;   End loop now that [4] is empty.  [6] now contains the parity of [3]
   moOmoO                                     ;   Navigate to [6]
   MOO                                        ;   Loop while [6] is non-empty
      MOomOomOomOoMOomoOmoOmoO                ;      Decrememnt [3] and [6]
   moo                                        ;   End loop now that [6] is empty.  [3] now contains the largest even number less than the previous iteration.
   mOomOomOomOomOoMMMmoOMMM                   ;   Copy [1] to [2]
   MOO                                        ;   Loop while [2] is non-empty
      MOomoOOOMmOomOoMoOmoO                   ;      Decrement [2], increment [1], and print the number in [3].
   moo                                        ;   End loop now that [2] is empty
   mOomOoMoo                                  ;   Print a new line
   moOmoOmoO                                  ;   Navigate to [3]
   MOO                                        ;   Loop while [3] is non-empty
      MOoMOomoOMoOmOo                         ;      Decrement [3] twice and increment [4] once
   moo                                        ;   [4] now contains half of [3]
   moOMMMOOOmOoMMM                            ;   Copy [4] to [3] and clear [4]
   MMMmOoMMMMOo                               ;   Copy [3] to [2] and decrement once
moo                                           ;End loop now that [2] is empty

Sample output for input 50:
50

24
24

12
12
12
12

6
6
6
6
6
6
6
6

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2

I have no words

I still have no words

I don't have any words

I love how two and a half years later, this still horrifies people.

05AB1E, 12 11 bytes
¸[4÷·€D=¬<#

Try it online!
Explanation
¸             # wrap input in a list
 [            # start infinite loop
  4÷          # elementwise integer divison by 4
    ·         # elementwise multiplication by 2
     €D       # duplicate each element in the list
       =      # print it
        ¬     # get the first element of the list
         <    # decrease it by 1
          #   # if true: exit loop

Python 2, 55 53 bytes
n=input()
while n[0]>2:n=len(n)*2*[n[0]/4<<1];print n

Divide by 4 and left shift by 1 to get the special division

Haskell, 75 71 60 50 47 bytes
f 0=[]
f n|x<-f$2*div n 4=show n:zipWith(++)x x

Try it online! Edit: As the output is now allowed to be a list including the input, 10 13 bytes can be saved.
Usage:
Prelude> f 50
["50","2424","12121212","66666666","2222222222222222"]

Original 60 byte version:
2%x=""
n%x|z<-2*div n 4=([1..x]>>show z)++"\n"++z%(x*2)
(%2)

Try it online! Thanks to Christian Sievers for pointing out the shorter formula.
Usage:
Prelude> (%2)50
"2424\n12121212\n66666666\n2222222222222222\n"

You can just do z<-2*div n 4.

Python 2, 48 47 bytes
s=input()
n=1
while s>3:s=s/4*2;n*=2;print`s`*n

s=s/4*2 will work for 1 byte save.

JavaScript (ES6) 64 59 57 Bytes

f=s=>{for(n=1;s>2;)console.log(`${s=s/4<<1}`.repeat(n*=2))}

console.log(f.toString().length);
f(5);
f(50);
f(30);

if I put your code into https://mothereff.in/byte-counter I get 59 bytes?

@Tschallacka I think the f= but is just for the demo

Ah, okay. That makes it clear :-) still gotta get 2 bytes off myne then

C#, 88 86 83 bytes
Saved 3 bytes thanks to Skorm
Saved another byte by changing the while to a for loop which includes variable declarations
Saved 1 bytes thanks to Yodle
n=>{var r="";for(int i,c=2;n>2;c*=2,r+="\n")for(i=0,n=n/4*2;i++<c;)r+=n;return r;};

Anonymous function which returns a string composed of the result of each grinding.
Full program with ungolfed method and test cases [before the last edit!]:
using System;

public class Program
{
    public static void Main()
    {
        Func<int, string> f =
        n =>
        {
            var r = "";
            for (int i, c = 1; n > 2; )  // iterator and counter variable
            {
                    n = n/4 * 2;    // make sure the result if even
                    c *= 2;         // keep track of the number of rocks
                    for (i = 0; i++ < c; )  // store the current line made of [c] rocks of size [n]
                        r += n;
                    r += "\n";      // add a trailing newline to the string resulted from this step
            }
            return r;       // return the entire history
        };

        //test cases:
        Console.WriteLine(f(5));
        Console.WriteLine(f(50));
        Console.WriteLine(f(30));
    }
}

Think you can save 1 byte in the for loop by doing for(i=0;i++<c;)

You can still save 1 byte, as yoddle mentioned by changing your second for to for (i = 0; i++ < c;)

Forgot to update the post. Updated now :)

You can update your counter to start at 2 and *=2 each iteration to save 1 byte, and move the new line append.
You can then move the n = n / 4 * 2 into the second loop and remove the braces to save 2 more.
n=>{var r="";for(int i,c=2;n>2;c*=2,r+="\n")for(i=0,n=n/4*2;i++<c;)r+=n;return r;}

Java, 85 bytes
n->{String s="";for(int q=2,i;n>2;q*=2,s+="\n")for(i=q,n=n/4*2;i-->0;)s+=n;return s;}

Testing and ungolfed
import java.util.function.*;

class Ideone {
  public static void main(String[] args) throws java.lang.Exception {
    Function<Integer, String> f = number -> {
      String result = "";
      for (int quantity = 2, i; number > 2; quantity *= 2) {
        number = number / 4 * 2; // Make sure that the next is half or half - 1 if odd
        for (i = quantity; i > 0; i--) { // copy "quantity" times.
          result += number;
        }
        result += "\n"; // append new line
      }
      return result;
    };
    System.out.println(f.apply(50));
  }
}

Note: I don't know why, Ideone keeps giving internal error, so testing on it is a problem. To test, just copy/paste and run in your standard Java IDE. (It works there, I made sure of it ;) )

ideone works fine with your code. It's somtimes giving an internal error when they are doing maintenance (I think). I've had it before when I looked back at old answers of mine. +1 btw, I don't see anything that can be golfed more. Oh, and I like your n=n/4*2 trick. :)

CJam, 21 bytes
l~]{{2/-2&_}%_n_2-}g;

Try it online! (As a test suite.)
Explanation
l~]      e# Read input, evaluate and wrap it in a singleton list.
{        e# Do while...
  {      e#   Map this block over the list of rocks.
    2/   e#   Halve the rock.
    -2&  e#   Bitwise AND with -2, clearing the least-significant bit and
         e#   rounding down to an even integer.
    _    e#   Duplicate.
  }%
  _n     e# Print a copy of the current list of rocks.
  _2-    e# Continue if the current list of rocks contains values that aren't 2.
}g
;        e# Discard the final result to prevent printing it again.

Jelly, 13 12 11 bytes
:4Ḥx2µȦÐ¿ṖY

TryItOnline!
Note: the OP stated that the input may also be in the output.
How?
:4Ḥx2µȦÐ¿ṖY - Main link: rockSize
     µ      - monadic separation
       Ð¿   - loop collect intermediate results while
      Ȧ     - any
:4          -     integer division (vectorises) by 4
  Ḥ         -     double (vectorises)
   x2       -     repeat the elements 2 times
         Ṗ  - pop (remove the trailing list of zeros)
          Y - join with line feeds

Version without the input displayed for 12 bytes: :4Ḥḟ0x2µÐĿḊG

Pyth, 18 16 13 bytes
WhQ=Q*2my/d4\n

* \n is a new line
Explanation :
W              # While
 hQ            # first element of Q - 0 is falsy
   =Q          # assign to Q
     *2        # the double of the (list) that is returned
       m       # form this \/ map
         /d4   # divide every element by 4
        y      # and double
            \n # print Q

Try here

PHP, 72 67 64 bytes
for($n=$argv[$k=1];$n>2;)echo str_repeat($n=$n/2&~1,$k*=2),"\n";

Takes argument from command line. Run with -r.

MATL, 13 bytes
`K/kEthttH>]x

Try it online!
`       % Do...while
  K/k   %   Divide by 4 and round down. Takes input implicitly in the first iteration
  E     %   Multiply by 2
  th    %   Attach a copy of itself (creates a longer array)
  t     %   Duplicate. This copy will be used for further grinding, keeping the original
  tH>   %   Duplicate. True if the values exceed 2. Used as loop condition
]       % End. The loop exits if the latest array contains 2
x       % Delete last copy. Implicitly display the entire stack

PowerShell 3+, 58 54 bytes
for($s=$input;$s;$s=($s-shr2)*2){"$s"*(2-shl($i++)-1)}

Thanks TimmyD for saving me 4 bytes!
Slightly Ungolfed (formatting)
for ( $s = $input ; $s ; $s = ( $s -shr 2 ) * 2 ) {
    "$s" * (2 -shl ($i++)-1)
}

Explanation
I'm using the same divide by 4 multiply by 2 trick as a lot of the other answers, but I ran into a problem. PowerShell converts numbers to floating point if needed during division, and for golfing that's annoying because $v/4*2 becomes something unsighlty like [int]($v/4)*2. I got around that using bitshifting for the division with -shr.
For calculating how many times to print an iteration I just take (2^$i)-1 which works nicely and has the added effect of leaving out the input value. Trying to just multiply by 2 was problematic because starting from 0 makes it hard to increase the value with just $i*=2 and starting from 1 requires too much correction to get the number right.
Since PowerShell doesn't have an operator for it, and I wanted to avoid [Math]::Pow(), I relied on bitshifting again for my powers of 2.

@TimmyD whoops forgot to mention version, and good tip; thanks!

Perl, 40 35 30 + 1 = 31 bytes
Run with the -n flag
-4 bytes thanks to @Dada
say$_ x($.*=2)while$_=$_>>1&~1

Try it online!
Perl automatically reads the input into the variable $_ when -n is set.  $. is a special variable set to 1 at the beginning of the program by the interpreter, so I can use it as a base for doubling.  Every iteration of the while loop, it bit-shifts $_ down and performs a logical AND against the negative of itself minus one to cancel out the ones bit.

You can golf it down to 31 bytes : perl -nE 'say$_ x($.*=2)while$_=$_>>1&~1' (maybe this can be golfed even further, I didn't spent a lot of time on it).

Swift, 84 Bytes
func g(n:Int){var n=n,i=2;while n>2{n=n/4*2;print(Array(repeating:n,count:i));i*=2}}

Ungolfed
func grind(rockSize: Int) {
    var rockSize = rockSize
    var rockCount = 1

    while rockSize > 2 {
        rockSize = rockSize / 4 * 2
        rockCount *= 2

        let output = Array(repeating: rockSize, count: rockCount)
        print(output)
    }
}

Befunge, 45 bytes
&1vg0_\:.\v
:\<  ^!:-1<p00:*2\.:*2/4,+55_@#`2

Try it online!
Explanation
&           read the rock size
1           initialise the count
<           start of main loop going right to left

  \         swap the size to the top of the stack
  :2`#@_    if size is not > 2 then exit
  55+,      output a line break
  4/2*      size = size/4*2, i.e. split into even halves
  :.        output the size
  \         swap the count to the top of the stack
  2*        count = count*2
  :00p      save count for later

  <         start of inner loop
    1-      decrement the count
    :!^_    break out of the loop if the count is zero
    \       swap the size to the top of the stack
    :.      output the size
    \       swap the count to the top of the stack
    v       back to the start of the inner loop

  0g        restore the saved count
  v         back to the start of the main loop

Javascript, 106 bytes
First code golf, thought I'd have a go. (It's not very good).
for(;i[i.length-1]>3;){for(var x=0;x<i.length;x++)i[x]/=2,i[x]%2===1&&i[x]--;i=i.concat(i),console.log(i)}

Unminified:
while (input[input.length - 1] > 3) {
    for (var x = 0; x < input.length; x++) {
        input[x] /= 2;
        if (input[x] % 2 === 1) input[x]--;
    }
    input = input.concat(input);
    console.log(input);
}

Python 2, 47 Bytes
Since the OP said that a 1D array which included the input was fine I have come up with this recursive function, which unfortunately only ties with the current Python winner.
f=lambda s,n=1:[s]*n+(f(s/4*2,n*2)if s>3else[])

f=lambda r,n=1:[r]*n+(r>3and f(r/4*2,n*2)or[])  for 46

Vim 61 54 bytes
qqYpPJ0yw:s;\d*;="/2
;g
:let @t=(">7)+1
@tkjjG@qq@q

TryItOnline!
Unprintables:
qqYpPJ0yw:s;\d*;^R=^R"/2
;g
:let @t=(^R">7)+1
@tkjjG@qq@q

Luckily vim automatically truncates on x/2.

Perl, 47 bytes
$a=<>>>1;say 2*(($a>>=1)||die)x(1<<$_)for 1..$a

No command-line options, this time (unusually for Perl). The basic idea is that as all the rocks at any given step are the same size, we just record the size (in $a) and the number (in $_), rather than recording the whole list. I couldn't find a way to get rid of the space (or +) after say ; you can move the 2* but it won't parse correctly if it's followed by an opening parenthesis.
I can't help but shake the feeling that this is improvable, but I can't see how.

If I try to golf it to much, I end up with Gabriel Benamy's answer every time. Just to show a few steps: the die clearly feels sub-optimal. But we still need a way to check if we need to stop or not -> a solution is to use a while instead of the for: while$a>1. But we need to find a replacement for $_: any unitialized variable can do it: replace 1<<$_ by 1<<++$x. So now $_ is free to be used, we can then use -n and replace every $a with a $_, and the first instruction becomes $_>>=1. Since we have -n, $. is set, so we can replace 1<<++$l with $.*=2.

Doing all those modifications will produce perl -nE '$_>>=1;say 2*($_>>=1)x($.*=2)while$_>1' (39 bytes). Then notice that $_>>=1 is done twice, so we can try to get rid of one (the first one). Trying to get rid of it, I got say$_ x($.*=2)while($_>>=1)/2>1 (put both of them inside the while condition). But the result is wrong ($_ can be odd), and trying to make sure it's even, I end up with while$_=$_>>1&~1. So the code is now say$_ x($.*=2)while($_=$_>>1&~1).

I missed that there was a Perl answer already. I guess if golfing this down turns it into a duplicate, there's not much point in editing it. On the other hand, it's not actually wrong, so there's not much point in deleting it either. We're probably best off just leaving it as a testament to my inferior Perl golfing powers.

I agree, it's different enough from the other Perl solution, and with my previous comments, I tried to show that the only way I could golf it would turn it into the other solution. So leaving it as it is feels like the right solution.

JavaScript, 71 63 59 58 Bytes
Well, I came up with this javascript solution. Totally new at golfing, but I foudn this a fun challenge
Saved 4 bytes thanks to Titus suggestion using a for loop.
ungolfed basis:

for(o = i = 30; i > 1; i= i/4<<1) {
   console.log(`${i}`.repeat(o / i));
}

Golfed version
for(o=i=30;i>1;i=i/4<<1){console.log(`${i}`.repeat(o/i));}

I'm open for suggestions how to improve it / learn golfing
input tester

function test(a){
var el = document.getElementById('output');
var text = [];
for(o = i = parseInt(a); i > 1; i= i/4<<1) {
   text.push(`${i}`.repeat(o / i));
}
  el.innerText = text.join('\n');
}
<input type="input" onchange="test(this.value)"><button>run</button>
<pre id="output">
</pre>

You can save two bytes with a for loop: for(o=i=30;i>2;console.log(...)){...}. And with combining the two grinding assigments to one, you can remove the braces: i=i/4<<1; (-5). Not sure if i=i/4*2; will do the same.

I bet you haven´t tested that.

not yet, had to run from pc to catch my kids

BASH, 81 bytes
n=$1
h=1
while [ ${n//2} ];do
printf -v s %$[h=h*2]s
echo ${s// /$[n=n/4*2]}
done