text:
Generate Wordenticons
Identicons are visual depictions of hash values, often made from symmetrical arrangements of geometric shapes. Your default Stack Exchange avatar is an identicon. This challenge is about creating "wordenticons", simple text-based versions of identicons that apply to strings of lowercase letters, i.e. words.
Challenge
Write a program or function that takes in a string S and outputs its wordenticon. S is guaranteed to be nonempty and only contain lowercase English letter characters a-z. You may optionally assume S has a trailing newline.
The wordenticon of S will be a square grid of text with side lengths 2*length(S) composed of spaces ( ), vertical bars, (|), and horizontal bars (―).
To generate the wordenticon of S, form a square grid where every column corresponds to a letter of S (in normal left-to-right reading order) and every row corresponds to a letter of S (in normal top-to-bottom reading order).
For example, if S is food our initial grid looks like
 food
f....
o....
o....
d....

where . is just a placeholder.
For every empty point (every .) in the grid:

If the column letter comes before the row letter alphabetically, replace the . with |.
If the column letter comes after the row letter alphabetically, replace the . with ―.
If the column and row letters are the same, replace the . with   (space).

Here is the food example after each of these steps:

Adding |'s:
 food
f...|
o|..|
o|..|
d....

Adding ―'s:
 food
f.――|
o|..|
o|..|
d―――.

Adding  's:
 food
f ――|
o|  |
o|  |
d―――

To complete the wordenticon, remove the superfluous row and column containing the words
 ――|
|  |
|  |
―――

then mirror the entire thing horizontally
 ――||――
|  ||  |
|  ||  |
―――  ―――

and finally mirror it again vertically
 ――||――
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||――

resulting in the 2*length(S) side length text grid that is the final wordenticon.
Examples
Here are some additional wordenticon examples. Note that different words can have identical wordenticons and some wordenticons can be completely made of spaces (unfortunately markdown does not want to render those).
food

 ――||――
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||――

mood

 ――||――
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||――

foof

 ――  ――
|  ||  |
|  ||  |
 ――  ――
 ――  ――
|  ||  |
|  ||  |
 ――  ――

fool

 ――――――
|  ||  |
|  ||  |
|――  ――|
|――  ――|
|  ||  |
|  ||  |
 ――――――

a [2*2 grid of spaces]

to

 ||
―  ―
―  ―
 ||

it

 ――
|  |
|  |
 ――

tt [4*4 grid of spaces]

abc

 ――――
| ―― |
||  ||
||  ||
| ―― |
 ――――

and

 ――――
| || |
|―  ―|
|―  ―|
| || |
 ――――

but

 ――――
| || |
|―  ―|
|―  ―|
| || |
 ――――

you

 ||||
― ―― ―
―|  |―
―|  |―
― ―― ―
 ||||

bob

 ―  ―
| || |
 ―  ―
 ―  ―
| || |
 ―  ―

cat

 |――|
― ―― ―
||  ||
||  ||
― ―― ―
 |――|

cart

 |――――|
― ―――― ―
|| ―― ||
|||  |||
|||  |||
|| ―― ||
― ―――― ―
 |――――|

todo

 ||||||
― |  | ―
―― ―― ――
― |  | ―
― |  | ―
―― ―― ――
― |  | ―
 ||||||

mice

 ||||||
― |||| ―
―― ―― ――
――|  |――
――|  |――
―― ―― ――
― |||| ―
 ||||||

zyxw

 ||||||
― |||| ―
―― || ――
―――  ―――
―――  ―――
―― || ――
― |||| ―
 ||||||

banana

 |―|―||―|―|
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
 |―|―||―|―|

codegolf

 ――――――――――――――
| ||| |||| ||| |
|― ―――――――――― ―|
|―| ―――――――― |―|
|―|| ――||―― ||―|
| ||| |||| ||| |
|―|||― || ―|||―|
|―||―――  ―――||―|
|―||―――  ―――||―|
|―|||― || ―|||―|
| ||| |||| ||| |
|―|| ――||―― ||―|
|―| ―――――――― |―|
|― ―――――――――― ―|
| ||| |||| ||| |
 ――――――――――――――

programming

 ―||―||||||||||||―||―
| || |||||||||||| || |
―― |―||||||||||||―| ――
――― ―|――――  ――――|― ―――
| || |||||||||||| || |
――――― ―――――――――― ―――――
―――|―|  |―||―|  |―|―――
―――|―|  |―||―|  |―|―――
―――|―|―― ―||― ――|―|―――
―――|―|||| || ||||―|―――
――― ―|――――  ――――|― ―――
――― ―|――――  ――――|― ―――
―――|―|||| || ||||―|―――
―――|―|―― ―||― ――|―|―――
―――|―|  |―||―|  |―|―――
―――|―|  |―||―|  |―|―――
――――― ―――――――――― ―――――
| || |||||||||||| || |
――― ―|――――  ――――|― ―――
―― |―||||||||||||―| ――
| || |||||||||||| || |
 ―||―||||||||||||―||―

abcdefghijklm

 ――――――――――――――――――――――――
| ―――――――――――――――――――――― |
|| ―――――――――――――――――――― ||
||| ―――――――――――――――――― |||
|||| ―――――――――――――――― ||||
||||| ―――――――――――――― |||||
|||||| ―――――――――――― ||||||
||||||| ―――――――――― |||||||
|||||||| ―――――――― ||||||||
||||||||| ―――――― |||||||||
|||||||||| ―――― ||||||||||
||||||||||| ―― |||||||||||
||||||||||||  ||||||||||||
||||||||||||  ||||||||||||
||||||||||| ―― |||||||||||
|||||||||| ―――― ||||||||||
||||||||| ―――――― |||||||||
|||||||| ―――――――― ||||||||
||||||| ―――――――――― |||||||
|||||| ―――――――――――― ||||||
||||| ―――――――――――――― |||||
|||| ―――――――――――――――― ||||
||| ―――――――――――――――――― |||
|| ―――――――――――――――――――― ||
| ―――――――――――――――――――――― |
 ――――――――――――――――――――――――
Scoring
This is code-golf, the shortest code in bytes wins. Tiebreaker goes to the earlier answer.
Notes

Any instance of horizontal bar (―) in your code may be counted as 1 byte instead of the 3 UTF-8 bytes it actually takes up. (Up to ten instances.)
If desired you may use regular dashes (-) in place of horizontal bars (―).
Removing or adding trailing spaces in the lines of a wordenticon is not allowed (even if the shape remains unchanged). It should be an exact 2*length(S) side length text square.
The output wordenticon may optionally have a single trailing newline.

Can we take the input as an array of characters?

@Downgoat No, it should be a normal string unless there's absolutely no other way for your language.

You've got examples for programming, and and codegolf but you forgot puzzles...

Could you add a leaderboard?

So we did eventually find out why you were asking about portmanteaus in chat :)

MATL, 20 15 bytes
'-| 'jtPht!-ZS)

Try it at MATL Online
Explanation
'-| '       % String literal defining the replacement characters
j           % Explicitly grab the input as a string
tP          % Duplicate and reverse the input string (row vector of chars)
h           % Horizontally concatenate the input and it's inverse
t!          % Duplicate and turn into a column vector
-           % Subtract the two vectors (converts to ASCII codes) and we automatically
            % broadcast to create a (2N x 2N) matrix where if the column is
            % later in the alphabet (higher ASCII) we get a positive number, if the
            % column was earlier (lower ASCII) we get a negative number, and if they are
            % the same letter (same ASCII) we get a 0.
ZS          % sign function which yields -1 for negative, 1 for positive, and 0 for 0;
)           % Use this to index (modulus) into the string literal '-| '. MATL uses 1-based
            % indexing so 0 yields ' ', -1 replaced by '|', and 1 replaced by '-'
            % Implicitly display the result

:O you outgolfed Dennis!

@Downgoat This is one of those rare occasions that MATL is shorter than Jelly!

Good idea to use the sign function!

Java, 329 305 264 259 192 bytes
Thanks to:

@Bálint for suggesting to use ternary operators.
@user902383 for suggesting to reverse the string myself
@Frozn and @user902383 for suggesting to replace StringBuilder with String.

Golfed:
String g(String w){char[]a=w.toCharArray();String s="";for(int i=a.length-1;i>=0;s=s+a[i--]);w+=s;a=w.toCharArray();s="";for(char x:a){for(char y:a)s+=(x>y?'|':x<y?'-':' ');s+='\n';}return s;}

Ungolfed:
String g(String w) {
    char[] a = w.toCharArray();
    String s = "";
    for (int i = a.length - 1; i >= 0; s = s + a[i--]);
    w += s;
    a = w.toCharArray();
    s = "";// To keep the output pure (ie. without the input string as well)
    for (char x : a) {
        for (char y : a)
            s += (x > y ? '|' : x < y ? '-' : ' ');
        s += '\n';
    }
    return s;
}

Definitely a fun one. First attempt was a function that was O(n) but ended up getting replaced with this simpler form after I got too frustrated.
And, to test:
supercalifragilisticexpialidocious
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-
| |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
-- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
--- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
--|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
----- |----|------- ----|---- -------- ----|---- -------|----| -----
------ ---- ------------ ------------------ ------------ ---- ------
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-||-- -|-------||---|--|-|--------|-|--|---||-------|- --||-|---
--|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
------ ---- ------------ ------------------ ------------ ---- ------
---|-||--|-| ------||---|--|-|--------|-|--|---||------ |-|--||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-
|-||||||||||||||| |||-||||||||||-||-||||||||||-||| |||||||||||||||-|
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
----- |----|------- ----|---- -------- ----|---- -------|----| -----
--- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
||||||||||||||||||||| |||||||||||||||||||||||| |||||||||||||||||||||
-- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
------ ---- ------------ ------------------ ------------ ---- ------
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
-----||----|-------|----|-- -|--------|- --|----|-------|----||-----
---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
----- |----|------- ----|---- -------- ----|---- -------|----| -----
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
| |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-
| |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
----- |----|------- ----|---- -------- ----|---- -------|----| -----
---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
-----||----|-------|----|-- -|--------|- --|----|-------|----||-----
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
------ ---- ------------ ------------------ ------------ ---- ------
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
-- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
||||||||||||||||||||| |||||||||||||||||||||||| |||||||||||||||||||||
--- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
----- |----|------- ----|---- -------- ----|---- -------|----| -----
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
|-||||||||||||||| |||-||||||||||-||-||||||||||-||| |||||||||||||||-|
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-||--|-| ------||---|--|-|--------|-|--|---||------ |-|--||-|---
------ ---- ------------ ------------------ ------------ ---- ------
--|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
---|-||-- -|-------||---|--|-|--------|-|--|---||-------|- --||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
------ ---- ------------ ------------------ ------------ ---- ------
----- |----|------- ----|---- -------- ----|---- -------|----| -----
--|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
--- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
-- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
| |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-

Welcome to Programming Puzzles & Code Golf! This is a very nice first answer. :)

Note that you don't have to use \u2015. Using horizontal bar (or simply dash) in the raw code is fine.

I'm pretty sure that if you used normal String instead of StringBuilder the answer could be much shorter... (even though it may take up a lot more memory)

You could win some bytes by declaring all the ints on the same line : int i,j,l=m.length();for(i=0;i<l;i++){...

I think you could save a lot if you change the for loops to for each loops. You don't need the indices for anything else than getting the char.

you could rewrite your for loops as for-each loop, all what you need to do is convert string to char[] and itterate through it, this could give you at least 10 bytes, you dont need to declare variable m you could reuse w  and i'm not sure but i think if you implement own reverse method, replacing append with + could save you a lot

@user902383 I've updated with your code. I had to clean it up just a smidge to keep the output as a square. Also, I removed the input string being appended to the output first.

Maybe a bit late, but you can replace s = s + a[i--] with s += a[i--] also you can but the assigment of a into the first foreach loop. It then looks like this: char x : a=w.toCharArray(). Also the parenthesis around the ternaries isn't necessary

Haskell, 93 bytes
r=reverse
h x=unlines$(++)<*>r$zipWith(++)<*>map r$(<$>x).((("- |"!!).fromEnum).).compare<$>x

Usage example:
*Main> putStr $ h "food"
 --||--
|  ||  |
|  ||  |
---  ---
---  ---
|  ||  |
|  ||  |
 --||--

How it works (note: (f <*> g) x is defined as f x (g x)):
((("- |"!!).fromEnum).).compare       -- a function that finds the replacement char
                                      -- for two given chars
   (<$>x).(    )<$>x                  -- map this function for every char in the
                                      -- input over each char. Now we have the
                                      -- first quadrant as a list of strings
zipWith(++) <*> map r                 -- append to each line a reversed copy of itself
(++) <*> r                            -- append a reversed copy of the whole list
unlines                               -- turn into a single string

Alternative version: the "find replacement" function ((("- |"!!).fromEnum).).compare can also be written as a#b|a<b='-'|a>b='|'|1<2=' ' and called via (#) for the same byte count.

Jelly, 16 bytes
Om©0_'®Ṡị“-| ”j⁷

Try it online!
How it works
Om©0_'®Ṡị“-| ”j⁷  Main link. Argument: s (string)

O                 Ordinal; replace the characters of s with their code points.
 m 0              Concatenate the result with a reversed copy.
  ©               Copy the result to the register.
      ®           Yield the list in the register.
    _'            Perform spawned difference of the character codes.
       Ṡ          Apply the sign function.
        ị“-| ”    Index into that string (indices 1, -1, 0).
              j⁷  Join, separating by linefeeds.

JavaScript (ES6), 94 bytes
s=>[...s,s].reverse().join``.replace(/./g,(c,_,t)=>t.replace(/./g,d=>d<c?`|`:d>c?`-`:` `)+`
`)

Using a dash because I usually run the SpiderMonkey JS shell on Windows and Unicode doesn't work if I do that.

Brilliant idea with the [...s,s].reverse() +1

Pyth, 31 30
js_BsM_BMclQsm@" |―"._-FCMd*QQ

Test Suite
Sadly can't drop the Qs because of the several bifurcates. Pretty basic algorithm so far, count treats the horizontal bar as 1 byte.

darn it, 2 secs before I posted my 31 char solution ;P

@Maltysen I got tired of being out FGITWed ;) Anyway I'm sure it can be shorter...

Haskell, 66 bytes
u s|e<-s++reverse s=unlines[["- |"!!min(length[a..b])2|a<-e]|b<-e]

JavaScript ES6, 138 126 123 bytes
s=>(a=(p=[...s]).map(l=>(b=p.map(i=>i<l?"|":i>l?"-":" ").join``)+[...b].reverse().join``)).concat([...a].reverse()).join`
`

most of the code is the reflecting / flipping

J, 26 20 bytes
6 bytes thanks to @Zgarb.
' |-'{~3*@-/~@u:[,|.

Previous 26-byte answer
({&' |-')@*@-/~@(3&u:)@,|.

Uses the same algorithm as Dennis' answer.
Usage:
>> f =: ' |-'{~3*@-/~@u:[,|.
>> f 'food'
<<  --||--
   |  ||  |
   |  ||  |
   ---  ---
   ---  ---
   |  ||  |
   |  ||  |
    --||--

>> f 'supercalifragilisticexpialidocious'
<<  -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-
   | |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
   -- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
   --- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
   --|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   ------ ---- ------------ ------------------ ------------ ---- ------
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-||-- -|-------||---|--|-|--------|-|--|---||-------|- --||-|---
   --|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
   ------ ---- ------------ ------------------ ------------ ---- ------
   ---|-||--|-| ------||---|--|-|--------|-|--|---||------ |-|--||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
    -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-
   |-||||||||||||||| |||-||||||||||-||-||||||||||-||| |||||||||||||||-|
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   --- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
   ||||||||||||||||||||| |||||||||||||||||||||||| |||||||||||||||||||||
   -- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ------ ---- ------------ ------------------ ------------ ---- ------
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   -----||----|-------|----|-- -|--------|- --|----|-------|----||-----
   ---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
   | |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
    -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-
    -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-
   | |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
   ---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   ---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
   -----||----|-------|----|-- -|--------|- --|----|-------|----||-----
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ------ ---- ------------ ------------------ ------------ ---- ------
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   -- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
   ||||||||||||||||||||| |||||||||||||||||||||||| |||||||||||||||||||||
   --- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   |-||||||||||||||| |||-||||||||||-||-||||||||||-||| |||||||||||||||-|
    -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-||--|-| ------||---|--|-|--------|-|--|---||------ |-|--||-|---
   ------ ---- ------------ ------------------ ------------ ---- ------
   --|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
   ---|-||-- -|-------||---|--|-|--------|-|--|---||-------|- --||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ------ ---- ------------ ------------------ ------------ ---- ------
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   --|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
   --- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
   -- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
   | |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
    -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-

(>> meaning input (STDIN), << meaning output (STDOUT))

With some restructuring, you can get to 20 bytes: ' |-'{~3*@-/~@u:[,|.

That's a nice use of forks...

Javascript 146 142 132 130 124 bytes
n=>(e=(a=[...n]).map(b=>(d=a.map(c=>c<b?"|":c>b?"-":" ")).concat([...d].reverse()).join``)).concat([...e].reverse()).join`
`

Test suite:

f=n=>{a=n.split``;e=a.map(b=>a.map(c=>c<b?"|":c>b?"-":" ")).map(d=>d.concat([...d].reverse()).join``);alert(e.concat([...e].reverse()).join`
`)}

f(prompt("Enter string!"));

Thanks for @HelkaHomba, for helping to remove at least 50 bytes, and to @Downgoat for 3 bytes!

you can usually replace =>{...} with =>(...) and replace all the semicolons within that time commas

This answer is almost identical to Downgoat's, I swear, I didn't looked at his one.

Mathematica, 124 110 104 102 bytes
a=Join[#,Reverse@#]&;#<>"
"&/@a@a@Table[{"|"," ","-"}[[c~Order~d+2]],{c,b=Characters@#},{d,b}]<>""&

Anonymous function. The Unicode character is U+F3C7 for \[Transpose].

C# 166 143 bytes,
using System.Linq;s=>string.Join("\n",(s+=string.Concat(s.Reverse())).Select(x=>s.Aggregate("",(c, y)=>c+"- |"[Math.Sign(x.CompareTo(y))+1])));

Explanation:
using System.Linq;

s=>                                     // Expression bodied member allows for implicit return
  string.Join("\n",                     // Join the generate lines into the final output
    (s+=string.Concat(s.Reverse()))     // Combine s and its reverse inline so aggregate has the whole line
        .Select(x=>                     // For each character in the line run the aggregate to generate its row
            s.Aggregate("",             // Empty string is required to cooerce the output type from char
                (c, y)=>                // c is the generated string so far, y is the next character
                        c+
                                        // Compare the two letters here (row to column)
                                        // Then take the sign of the result to collapse to -1, 0, or 1
                                        // Finally add 1 to line it up with the indexes of the constant string;
                        "- |"[Math.Sign(x.CompareTo(y))+1]
)));

Test:
Wordenticons

 ||||||||||||||||||||||
- -|||-|| |--| ||-|||- -
-| |||-||||--||||-||| |-
--- ----|------|---- ---
---| ---|------|--- |---
---|| -||- -- -||- ||---
-||||| |||||||||| |||||-
---||-- |------| --||---
-------- ------ --------
- -|||-|| |--| ||-|||- -
---|| -||- -- -||- ||---
-|||||-||||  ||||-|||||-
-|||||-||||  ||||-|||||-
---|| -||- -- -||- ||---
- -|||-|| |--| ||-|||- -
-------- ------ --------
---||-- |------| --||---
-||||| |||||||||| |||||-
---|| -||- -- -||- ||---
---| ---|------|--- |---
--- ----|------|---- ---
-| |||-||||--||||-||| |-
- -|||-|| |--| ||-|||- -
 ||||||||||||||||||||||

I wasn't sure if method only was acceptable, if not let me know and I will adjust my answer accordingly

@Downgoat thanks for the edit, I wasn't sure the proper method to escape the #.

Which apparently only messed up in the preview, good to know

since string implements IEnumerable<char> you can save some bytes by using .Reverse() directly on the string skipping the .ToCharArray()

you could also change var a = new[] { '-', ' ', '|' }; to var a = "- |";  because you can use indexing on strings

and you could save another couple of bytes by at the end merging those 2 lines return r + new string(...);

@Gunther34567 Thanks for those tips, I was aware of the last one after I had left too, an unfortunate artifact of testing the first draft.

Actually, 53 bytes
;l╗;∙`♂O♂ii-s3@%" |-"E`MW╜`d@`nkd@Σ'.o@WX'.@s;R+;♂R¥i

Once again, Actually's poor string-processing abilities are its kryptonite. It's still shorter than Java, so I have that going for me, which is nice.
Try it online!
Explanation:
The code can be separated into 3 distinct portions: the translation code, the processing code, and the mirroring code. For readability, I'm going to explain each section separately.
Translation code (starts with the input string, s, on the stack):
;l╗;∙`♂O♂ii-s3@%" |-"E`M
;l╗                       push len(s) to reg0 (needed for processing step; we'll call this n)
   ;∙                     cartesian product of s with itself
     `♂O♂ii-s3@%" |-"E`M  map:
      ♂O♂ii                 get a pair of ordinals for the characters
           -s               subtract, signum
             3@%            mod by 3 because element access with negative indices isn't working
                " |-"E      get corresponding string

Processing code (starts with a list of n**2 characters, corresponding to the bottom-right corner):
W╜`d@`nkd@Σ'.o@WX
W╜`d@`nkd@Σ'.o@W   while loop (while top of stack is truthy):
 ╜`d@`n              remove n characters from the list
       kd@Σ'.o       concatenate those n characters, and append a period
                X  discard the empty list

Mirroring code (starts with a n**2+n-length string, with periods acting as newlines)
'.@s;R+;♂R¥i
'.@s          split on periods
    ;R+       add the reverse list (vertical mirror)
       ;♂R    make a copy of the list with each string reversed (horizontal mirror)
          ¥   concatenate each pair of strings in the two lists (zip-concat)
           i  flatten list
              (implicitly print each stack item, separated by newlines)

><>, 109 bytes
i:0(?\:}
,[r]l\~l2,[r]rl2
1-:?!\$:}l1-[}
~]\  \
&r\l:?!;1-
?!\$:@@:@$:@@:@)}(}"- |"{?$@{?$o~~$}&1-:&
4.>~ao]2

Input is via STDIN. Try it online!
Explaination:
The input it read and mirrored on the first line. For input abcd, this leaves dcbaabcd on the stack. Each half is then mirrored to give abcddcba (line 2). Then, each element is duplicated and left on its own stack in turn (lines 3 and 4). After this process, the stack of stacks looks a little like this:
aabcddcba  <-- top of the stack of stacks
b
c
d
d
c
b
a          <-- bottom of the stack of stacks

For each stack in turn, the row value (the bottom of the stack) is compared to the column value (the top of the stack). The appropriate character is selected from - | and written to STDOUT. The column values are then rotated so that the next column is at the top of the stack (line 6).
Once all the columns have been considered, the row value is discarded, a newline printed, and the column values put onto the previous stack (line 7), for the output process to start again.
The ] command, in addition to popping from the stack of stacks, empties the current stack if it is the only one left. The program's end condition is if the stack is empty, as all rows have been processed (line 5).

J, 75 70 bytes
5 bytes saved thanks to Dennis.
3 :'(],.|:@|.@|:)(],|.)''- |''{~]([:-.@*(,~@#$])-(,~@#$(##])@]))3 u:y'

I'll work on converting it into a tacit verb later.

CJam, 20 bytes
l_W%+_ff{-g" |―"=}N*

Test it here.
Uses the obvious approach of computing an outer product and using difference and sgn to compute the character in each cell.

C#, 169 150 bytes
thanks FryAmTheEggman
void f(string s){s+=new string(s.Reverse().ToArray());foreach(char c in s){var t="";foreach(char k in s)t+=c==k?" ":c>k?"|":"-";Console.WriteLine(t);}

ungolfed:
    public static void f(string s)
    {
        s += new string(s.Reverse().ToArray());
        foreach (char c in s)
        {
            var t="";
            foreach (char k in s)
            t+=c==k?" ":c>k?"|":"-";

            Console.WriteLine(t);
        }

    }

more golfing advice appreciated

t+=c==k?" ":c>k?"|":"-"; should work. I haven't golfed C# much, but it's quite possible that using regular for loops will be shorter.

This answer has the same problem my original C# answer did in that both Reverse() and ToArray() are part of System.Linq so a using statement is required.

Clojure, 171 bytes
(fn[w](let[f concat r reverse p(map #(f %(r %))(partition(count w)(for[x w y w :let[c(compare x y)]](if(neg? c)\-(if(pos? c)\|\ )))))](run! #(apply println %)(f p(r p)))))

ungolfed:
(fn [w]
  (let [n (count w)
        a (for [x w y w
                :let [c (compare x y)]]
            (if (neg? c)
              \-
              (if (pos? c)
                \|
                \ )))
        p (map #(concat % (reverse %))(partition n a))
        p (concat p (reverse p))]
    (run! #(apply println %) p))))

Octave, 39 bytes
@(x)'| -'(sign([x,y=flip(x)]-[x y]')+2)

Creates an anonymous function that is able to be run using ans('string').
Demo
Explanation
This solution combines the input string (x) and it's inverse (flip(x)) using [x, flip(x)]. The inverse is assigned to y to shorten the answer, [x, y = flip(x)]. We then create a column vector of the same thing by combining x and y and taking the transpose: [x,y]'. Then we take the difference which will automatically broadcast to create a 2D array of differences between any ASCII representations of letters in the strings. We use sign to make these either -1, 0, or 1 and then add 2 to get valid 1-based index values. We then use these to index into the initial string '| -'.

Julia, 70 bytes
This is my first attempt at code golf and I have not used Julia before, so tell me what you think:
f(s)=join([join([r>c?'|':r<c?'―':' 'for c=s])for r=s*=reverse(s)],"
")

Try it online!
Ungolfed:
function wordenticon(word::AbstractString)
    word*=reverse(word)
    join([
        join([
            if r>c
                '|'
            elseif r<c
                '―'
            else
                ' '
            end
            for c in word
        ])
        for r in word]
        ,"\n"
    )
end

I think it could probably be made shorter. This code stores the characters of the wordicon in a matrix:
f(s)=[r>c?'|':r<c?'―':' 'for r=s*=reverse(s),c=s]

Unfortunately, I couldn't manage to produce the desired output using the matrix.

Hello, and welcome to PPCG! Thanks for joining us!

R, 101 bytes
101 bytes since I'm using ― (which I think looks better than -).
function(s)write(c("|"," ","―")[sign(outer(g<-c(r<-utf8ToInt(s),rev(r)),g,"-"))+2],"",2*nchar(s),,"")

Try it online!
I was surprised there wasn't an R answer before since we can exploit the symmetry and R's matrices to get a quite competitive answer, despite this being a string problem.
Ungolfed Explanation:
function(s){
 r <- utf8ToInt(s)               # turn to vector of ints (charcodes)
 g <- c(r, rev(r))               # concatenate r and its reverse
 idx <- sign(outer(g,g,"-")) + 2 # compute all differences and their signs.
                                 # -1=>less than, 0=>equal, +1=>greater than
                                 # add 2 to make them 1-based indices into the vector
 write(c("|"," ","―")[idx],"",2*nchar(s),,"")
     # write the vector of characters to stdout "" with line width 2*nchar(s)
     # and no separator
}

Vyxal j, 23 bytes
Ẋƛḣ>[\||ḣ=‛- $i];?Lẇvmm

Try it Online!

Try it Online! for -2

Jolf, 42 bytes
Hardly golfed. I'm probably forgetting about a matrix builtin that Jolf has.
ΆΖR~mGiEd+γR~mGiEΨ."| -"hmA-~@ά~@HE_γSSZiζ

Try it here! This code uses an arrow function (Ψ) for the matrix map.

Javascript, 303 Bytes
function w(o){function r(o){var r=Array.prototype.slice.call(o).reverse();console.log(o.join("")+r.join(""))}var e,n,c,h=[],s=o.length;for(e=0;s>e;e++){for(h.push([]),n=0;s>n;n++)c=o.charCodeAt(n)-o.charCodeAt(e),0===c?h[e].push(" "):0>c?h[e].push("|"):h[e].push("-");r(h[e])}for(e=s-1;e>=0;e--)r(h[e])}

Ungolfed
function w(s) {
    var arr = [],
        l = s.length, r, c, x;
    for (r = 0; r < l; r++) {
        arr.push([]);
        for (c = 0; c < l; c++) {
            x = s.charCodeAt(c) - s.charCodeAt(r);
            if (0 === x) {
                arr[r].push(' ');
            } else if (x<0) {
                arr[r].push('|');
            } else {
                arr[r].push('-');
            }
        }
        out(arr[r]);
    }
    for (r = l - 1; r>=0; r--) {
        out(arr[r]);
    }
    function out(r){
        var rev = Array.prototype.slice.call(r).reverse();
        console.log(r.join('') + rev.join(''));
    }
}

No ecma 2015 fanciness here

You can check, if a letter comes before in alphahet, by simply doing "a"<"b"

You don't need to bother with var x = 1, just do x = 1. In code golf no-one cares about adhering to best practices. :)

Python 3.5, 250 223 175 bytes:
def H(o):O=ord;G=len(o);p=[[' ―'[O(i)<O(g)],'|'][O(i)>O(g)]for i in o for g in o];u='\n'.join([''.join(p[i:G+i]+p[i:G+i][::-1])for i in range(0,len(p),G)]);print(u+'\n'+u[::-1])

Try It Online! (Ideone) (The last two test cases won't show up in the output since they are just blank lines. My program is processing them though, which is confirmed the fact that there are 10 cases input, but only 8 outputs appear.)
Ungolfed followed by an Explanation:
def H(o):
    O=ord
    G=len(o)
    p=[[' ―'[O(i)<O(g)],'|'][O(i)>O(g)]for i in o for g in o]
    u='\n'.join([''.join(p[i:G+i]+p[i:G+i][::-1])for i in range(0,len(p),G)])
    print(u+'\n'+u[::-1])

p=[[' ―'[O(i)<O(g)],'|'][O(i)>O(g)]for i in o for g in o]
Create a list, p, where a | is added if the Unicode Point Value of the column letter is less than the row letter's value, a – is added if the Unicode Point Value of the column letter is more than the row letter's value, or a  if both values are equal.
u='\n'.join([''.join(p[i:G+i]+p[i:G+i][::-1])for i in range(0,len(p),G)])
Create a newline joined string, u, from list p by splitting it into joined string segments each consisting of input length number of characters both forwards and backwards, resulting in each one having the length of 2 times how ever many characters there are in the input. This is the top half of your wordenticon. So, in the case of your input being food, this would return:
 ――||――
|  ||  |
|  ||  |
―――  ―――

print(u+'\n'+u[::-1])
Finally, output u followed by a newline and then u reversed to vertically mirror the first half for the second half. This is your completed wordenticon, which for the test case food would finally be:
 ――||――
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||――

Python 2, 126 bytes
def f(s):x=[''.join(" -|"[cmp(ord(a),ord(b))]for a in s)for b in s];y=[a+b[::-1]for a,b in zip(x,x)];print'\n'.join(y+y[::-1])

This is essentially a port of my Actually solution.
Try it online
Explanation:
x=[''.join(" -|"[cmp(ord(a),ord(b))]for a in s)for b in s] # get the correct character for each pair of characters in the Cartesian product of s with itself, and concatenate the characters in each line
y=[a+b[::-1]for a,b in zip(x,x)] # mirror each line horizontally
print'\n'.join(y+y[::-1]) # mirror vertically and print

05AB1E, 20 22 21 19 13 bytes
δ.S… |—sèJ»º∊

+2 bytes as bug-fix for single-char inputs (but later on -2 again by putting the fix at a different position in the code)
-7 bytes thanks to @ovs.
Takes the input as a list of characters.
Try it online or verify all test cases.
Explanation:
δ              # Apply double-vectorized on the (implicit) input-list:
 .S            #  Compare the characters (-1 if a<b; 0 if a==b; 1 if a>b)
   … |—        # Push string " |—"
       sè      # Index the -1,0,1 of the matrix into this string
         J     # Join each inner list together to a string
          »    # Join this list of strings by newlines
           º   # Mirror each line left to right
            ∊  # And mirror the entire block top to bottom
               # (and output the result implicitly)

15 bytes in the Elixir rewrite with δ instead of a loop.

@ovs Thanks! I didn't knew .S works on characters in the new version. (I also didn't knew a matrix [[0,1,-1],...] can't index into a string in the legacy version.. -_- Also, no need for the leading SD if we take the input as a list of characters. :)

APL (Dyalog Extended), 24 bytes
⍪∘⊖⍨⍤,∘⌽⍨' |―'⊇⍨∘.(≠+<)⍨

Try it online!
Uses Extended for character comparison.
minus a lot of bytes from Adám.
uses ⎕IO←0 (0-indexing)
Explanation(old)
{(⊢⍪⊖)(⊢,⌽)' |―'[∘.{1+⍺(≠+<)⍵}⍨⍵]} ⍵ → input.
                 ∘.           ⍨⍵   cartesian product of ⍵, with the following function:
                   {1+⍺(≠+<)⍵}     return 1 if equal, 2 if greater, 3 if lesser.
           ' |―'[               ]  index into the required characters
      (⊢,⌽)                        append the reverse of the pattern
 (⊢⍪⊖)                             append the y-axis reverse of the pattern

26: ⍪∘⊖⍨⍤,∘⌽⍨' |―'⊇⍨1+∘.(≠+<)⍨ Try it online!

Get rid of 1+ by going ⎕IO←0

Vyxal, 14 bytes
mC:ǒ-±` |-`İṠ⁋

Try it Online!
m              # Mirror
 C             # Get charcodes
  :ǒ-          # Outer product by subtraction
           İ   # Index
     ±         # Signs of those differences
      ` |-`    # Into " |-"
            Ṡ⁋ # Concatenate and join on newlines

Perl 5 -F, 76 bytes
say@$_,reverse@$_ for(@;=map{//;[map{($",'-','|')[$_ cmp$']}@F]}@F),reverse@

Try it online!

Uiua, 28 20 bytes
∵(⊡:"| -")+1±⊞-.⊂:⇌.

Test pad (with explanation)
My older 28-byte solution had it mirroring at the end, but looking at some answers, I decided to mirror in the beginning.

C (gcc), 202 bytes
f(c,i,j,s,t,a,v)char*c,*v;{v=malloc((a=strlen(c)*2)*a);for(j=0;t=c[j];j++)for(i=0;s=c[i];i++)v[j*a+i]=v[j*a+a+~i]=v[a*(a+~j)+i]=v[a*(a+~j)+a+~i]="- |"[(s<t)-(s>t)+1];for(;*v;v+=a)write(1,v,a),puts("");}

Try it online!
Works by looping through each character, then updating the resultant character (and the reflections thereof).

Japt -R, 20 bytes
Everything I do to try to make this shorter only ends up making it longer!
¬£c_gXc)g|i-iSÃê1Ãê1

Try it
¬£c_gXc)g|i-iSÃê1Ãê1     :Implicit input of string U
¬                        :Split
 £                       :Map each X
  c                      :  Map the character codes of U
   _                     :  By passing them through the following function
    g                    :    Sign of difference with
     Xc                  :      character code of X
       )                 :    End sign
        g                :    0-based index into
         |i              :      "|" prepended with
           -i            :        "-" prepended with
             S           :          Space
              Ã          :  End inner map
               ê1        :  Mirror
                 Ã       :End outer map
                  ê1     :Mirror
                         :Implicit output joined with newlines

Pip -l, 22 21 "bytes"
QR(" |―"$CM Aa@GMC#a)

Try it here! Or, here's the 24-"byte" equivalent in Pip Classic: Try it online!
Explanation
QR(" |―"$CM Aa@GMC#a)
                       a is first command-line argument (implicit)
                MC#a   Map this function to each [r,c] pair where 0 <= r,c < len(a):
             a@G         Get the chars in a at indices r and c
            A            ASCII value of each char
        $CM              Fold on numeric comparison (returns -1, 0, or 1)
  (" |―"            )  Use each number in the resulting nested list to index into " |―"
                       (0-based cyclic indexing: 0 -> " ", 1 -> "|", -1 -> "―")
QR                     Quad-reflect
                       Autoprint with each sublist on a separate line (-l flag)


text:
What's so great about 1729?
This is not a duplicate of this question. This is asking for the nth number that can be represented as the sum of two cubes in two different ways, while that is asking for the n-th number that can be expressed as the sum of two cubes in n ways.
Introduction
I was just watching The man who knew Infinity, and I thought it would make a good challenge.
So, what's the challenge??
You must write a program that will calculate the n-th number that can be expressed as the sum of two cubes, not in one way, but exactly two.
Specifications

You may output either the n-th number, or an array up to (and including) the n-th value.
You must output both sums of cubes (however you'd like), and the number, for each output.
You cannot hardcode any solutions.
Runtime will be my Arch Linux laptop with 16 GB of RAM and an Intel i7 processor.
Negitive numbers are not used.

Winning

The winner is the solution who's runtime for n = 10 (in seconds) times the code size is smallest.

@orlp That is asking for the "n-th number that can be expressed as the sum of 2 cubes in n ways", not 2. This is different, albeit similar.

@orlp "are the least numbers that are able to be represented as n different sums of two positive cubed integers, for successive n." (Bold added by me)

Does it have to be exactly two ways and no more, or at least two ways? What about negative numbers?

Given your intro paragraph, shouldn't "but exactly two" be "but exactly n"?

Different people have different computers and runtime will vary. Speed can even depend on the number of background processes, making it unreliable as a metric.

You must provide timing details if you want this to be a [tag:fastest-code] competition.

1+7+2+9=19. 19*91 = 1729!

The linked question asked for code to find the lowest (not nth-lowest) integer which is the sum of 2 positive cubes in n ways.

source: Stack Exchange

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

sort: votes


text:
Make the lowest number square that equals n
A number square containing the values 1, 2, 3, 4 looks like this:
12
34

To work out what a number square is, you first make four numbers by reading across the rows and across the columns; for the example above you would get 12, 34, 13 and 24, then you add them all up (12+34+13+24), giving you the value of the square.
However, there is a catch: the square your program outputs must output the lowest possible square. The way to calculate how 'low' the square is is like this:

Take the top-left number, and place it in the variable a.
Take the top-right number, double it and add the total to a.
Take the bottom-left number, triple it and add the total to a.
Take the bottom-right number, quadruple it and add the total to a.
The variable a now holds how 'low' you square is!

Requirements

Your program must output the lowest possible number square, in the format that follows:
ab
cd

(where a, b, c and d are integers in the range 0-9).

The square will never contain a number multiple digits long (negative numbers as well). You don't have to handle that case.
You can take input, which will be the number the square should equal, as an argument, as function argument or from STDIN. Please specify how input should be given for your program.
If there is not a number square that equals what the input number, output nothing.
If two numbers squares are equally low and produce the same output, nothing should be output.

Rules

Standard loopholes are forbidden.
Your program must not write anything to STDERR.

Test Cases
44 ==>
04
00
-----
2 ==>
00
01
-----
100 ==>
50
00

@MartinBüttner has also done a Pastebin with all the possible solutions.
Scoring
Programs are scored according to bytes. The usual character set is UTF-8, if you are using another please specify.
To win this code-golf challenge, try to get the least bytes!
Submissions
To make sure that your answer can be parsed, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
# Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

Leaderboard
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 80765; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Pyth, 43 41 36 bytes
J.ms*VS4sbfqQsiR10sCBT^^UT2 2?tlJkhJ

Test suite.
Output as 2D array. ab/cd is represented as [[a, b], [c, d]].
How it works
J.ms*VS4sbfqQsiR10sCBT^^UT2 2?tlJkhJ

                      ^^UT2 2    Generate all number-squares
                                 with the above format.

          fqQsiR10sCBT

          f          T       Filter the squares as T:
                   CB            Yield [T, transpose(T)]
                  s              Yield T union transpose(T)
                                 We generated the rows and columns
                                 of the number square.
              iR10               Convert each from base10 array to int.
             s                   Sum.
           qQ                    Check if equal to the input.

J.ms*VS4sb

 .m      b         Find the squares (as b) in the filtered-result,
                   in which the following attains minimum:

        s              Flatten.
    *VS4               Multiply the first number by 1,
                               the second number by 2,
                                the third number by 3,
                           and the fourth number by 4.
   s                   Sum.
J                  Assign to the variable J.

                             ?tlJkhJ

                             ?         if
                              tlJ         length of J is not 1:
                                 k          output empty string
                                  hJ   else: output the first element of J

Pyth, 69 bytes
J.x.mebm,ds.e*hksbdfqQssM[<2T>2T+hTePT+htTeT)m.[\04`dU10000k?qlJ1hhJk

Try it here!
Outputs the square as a 4-digit number.
Works by generating all possible squares, keeping the ones which have the given number and then getting the lowest one.
Detailed Explanation later, gonna try to find a shorter way to calculate the number of a square first.

10000 -> ^T4

Matlab(284)
Too much rules, too much bytes, i hate too much rules!
function h(n),f=mod(n,2);b=(n-11*f)/2;a=fix((n-2*b)/11);c=(mod(ceil(b/11),10)+1)*(b>99);b=b-c*11;a=a+2*c;u=min(fix(b/10),mod(b,10));r=min(u,fix((9-a)/2*(a<9)));a=a+2*r;b=b-11*r;if(a>18||b<0||a+2*(u-r)>9&a==8)return;end,u=(a>9);r=mod(a,10-u);[fix(b/10),max(u*9,r);min(u*9,r),mod(b,10)]

this is a straight-forward method without even calculating the lowest weight of a square, i will add an explanation once i online-fork it.

This is how it goes, as known that a square value ab+cd+ac+bd can be simplified algebrically as 11(b+c)+2*[ad]_dec where [ad] is a*10+d , with weights assigned by ops respectively as (W_a,W_d)=(1,4) and (W_b,W_c)=(2,3) .
Thus, assuming an initial value of [ad] set as maximal number written in two digits, any number subtracted from it must be a multiple of 11 to be added to (b+c), otherwise that would screw the general form that the square value must be written as.
Since [ad] is two digits number, the multiple of 11 subtracted from [ad] must hold same amount from both a and d, which means weights are decreased equally but not added to (b+c) equally because it is required to attribute the maximal number to the lowest upweighting number which is b. so b will receive an even number. See the picture below it is definitely clearer than my awkward wording:

See that a (ported) value is not addded gradually, but there is a mathematical condition for it , it is S=minimum_positive(9-(b+c),a,d)
For the rest of conditions, function doesnt output nothing when:

b+c exceeds 18
the square value is below 11 and odd
after adding the farce to (b+c), min(a,d) remains bigger than 1, and b+c = 8, this means there is a potential square value of weight 3+2 , which equals the weight 1+4 , two equivalent values is an exclusive option, and disqualifies the outputs (tbh i dont see any point behind this rule)

Wait... is this a closed form solution?

@LeakyNun yes , right direct forward without trying so much combinations, i will add an explanation as soon as i can

C (ANSI), 210 bytes
#define a (l/1000)+2*((l/100)%10)+3*((l%100)/10)+4*(l%10)
main(g,o,l,f){g--;o=91;for(f=l=-1;l<10000;g==++l%100+l/100+(l%10)+((l/100)%10*10)+((l/1000)*10)+(l/    10%10)?a==o?f=-1:a<o?f=l,o=a:1:1);printf("%04i",f);}

Pretty much makes all possible squares and finds the lowest.
Input is read in as number of arguments. Output is the square as a 4 digit number.
Ex: 8
./numberSquare 1 1 1 1 1 1 1 1
0004

Expanded Version:
calcScore(l){
    return (l/1000)+2*((l/100)%10)+3*((l%100)/10)+4*(l%10);
}

main(g,o,l,f){
    g-=2;
    o=91;
    for(f=l=-1;l<10000;l++){
        if(g==l%100+l/100+(l%10)+((l/100)%10*10)+((l/1000)*10)+(l/10%10))
            if(calcScore(l)==o)f=-1;
        else if(calcScore(l)<o)f=l,o=calcScore(l);
    }
    printf("%04i",f);
}

Haskell, 133 bytes
a#b=10*a+b
g n|l<-[(a+2*b+3*c+4*d,m)|m@[a,b,c,d]<-mapM id$[0..9]<$"aaaa",a#b+a#c+b#d+c#d==n]=[b|q@(a,b)<-l,all(\k@(j,_)->j>a||k==q)l]

Output is a four element list [a,b,c,d]. Usage example: map g [129..139] -> [[[1,9,0,5]],[],[[6,1,0,0]],[],[[5,3,0,0]],[],[[4,5,0,0]],[],[[3,7,0,0]],[],[[2,9,0,0]]].
How it works:
l<-[        ]                  -- let l be the list of all
  (a+2*b+3*c+4*d,m)|           -- pairs (score, matrix), where
     m@[a,b,c,d]<-             -- matrix m (= [a,b,c,d]) is drawn from
       mapM id$[0..9]<$"aaaa", -- all permutations of the digits of length 4 and
       a#b+a#c+b#d+c#d==n      -- the matrix sum equals n

=[b|            ]              -- return a list of all matrices b, where
  q@(a,b)<-l                   -- the pair q = (a,b) is drawn from l and
    all(\k@(j,_)->j>a||k==q)l] -- a is minimal and unique

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


text:
Illiteral Prime numbers
Your challenge is to write a program (full program, not a function), that will take an integer and output all prime numbers up to (including) the given integer. Output is any readable list containing all integer primes (array, string, 1 prime per line, whatever you want) and must run to stdout or equivalent.
Simple? Here's the twist:
You may not use literals in your program. These include:

Literal numbers (0 through 9)
Literal strings (in quotes)

You may not use built in prime checks
EDIT: A prime check is a built in function that

Returns if a number is a prime number
Returns a prime number
Returns a list of prime numbers

You may code your own functions that do the above
Prime factorisation functions are allowed
As this is code-golf, shortest answer in bytes wins

This is an occurence of the Do X without Y problem. Not that this question is bad, just wanted to know.

What about prime-factorization builtins?

What if a language has a function that produces a predefined literal? Say function f outputs 1, can that be used instead of 1?

@LuisMendo if it is really built in and not self coded, sure

You may not use built in prime checks Does that forbid prime factorization as well (i.e. a built-in function that computes prime factors of a number)?

Is the input on the command line or STDIN or either?

@BradGilbertb2gills doesnt matter. either are fine.

I'm voting to close as unclear because "prime checks" is not very descriptive - are builtins that compute prime factorization, nth prime, or other prime-related functions (that are not necessarily primality testing) allowed?

Do you have a particular reason for disallowing functions? They're allowed by default and arbitrarily overriding the defaults is one of the things to avoid when writing challenges.

Is 0 an integer that could be entered? Can a program end in an error for 0?

@Mego i hope to have clarified the definition. Should probably make a meta post on prime computing functions (what counts and what doesnt)

It's still unclear to me - prime factorization functions return a list of prime numbers, so why are they allowed? And no meta post is necessary - you just have to be clearer.

@Mego i guess you have a point there, its hard to draw a boundary, but as i wrote above, Prime factorisation functions are allowed

If this were not already closed, I would vote to close it as a duplicate of http://codegolf.stackexchange.com/q/70001/194 . The accepted answer to that question meets all of the criteria of this one, and the others can be adapted. (Admittedly some would be more costly to adapt than others).

05AB1E, 7 6 bytes
Six byte solution
Since prime factorisation is now allowed, this is my six byte solution:
LDÒ€gÏ

Explanation:
L       # Create the list [1, ..., input]
 D      # Duplicate this list
  Ò     # Get the prime factorisation of each number
   €g   # Get the length of each prime factorisation (length 1 = prime)
     Ï  # Keep the numbers for which is the index is equal to 1

Uses CP-1252 encoding. Try it online!.

Previous solution
Uses Wilson's theorem. Code:
LÐ<!n%Ï

Explanation:
L        # Generate the list [1, ..., input].
 Ð       # Triplicate the list.
  <      # Decrement the last one by one.
   !     # Take the factorial.
    n    # Square each.
     %   # Modulo the list by [1, ..., input].
      Ï  # Take the values for which the indices are equal to 1.

Visual explanation for input n = 9:
 Command - Stack

L        # [1, 2, 3, 4, 5, 6, 7, 8, 9]
 Ð       # [1, 2, 3, 4, 5, 6, 7, 8, 9] × 3
  <      # [1, 2, 3, 4, 5, 6, 7, 8, 9] × 2, [0, 1, 2, 3, 4, 5, 6, 7, 8]
   !     # [1, 2, 3, 4, 5, 6, 7, 8, 9] × 2, [1, 1, 2, 6, 24, 120, 720, 5040, 40320]
    n    # [1, 2, 3, 4, 5, 6, 7, 8, 9] × 2, [1, 1, 4, 36, 576, 14400, 518400, 25401600, 1625702400]
     %   # [1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 1, 0, 1, 0, 1, 0, 0]

Which leaves us (using Ï):
[1, 2, 3, 4, 5, 6, 7, 8, 9],
[0, 1, 1, 0, 1, 0, 1, 0, 0]

    2  3     5     7

Uses CP-1252 encoding. Try it online!.

Jelly, 10 9 8 7 bytes
1 byte saved thanks to Dennis.
Ṗ!²%ḊT‘

Try it online!
This is my first (working) Jelly program. I have no idea what I'm doing. :P
Also uses Wilson's theorem.

I had that same feeling with my first Jelly answer, only in my case it was non-working

05AB1E, 2 bytes
!f

Allowing prime factorization makes this a bit too easy...
Try it online!
How it works
!   Compute the factorial of the input.
 f  Find its prime factors.

And, as the legend goes, nobody ever out golfs Dennis.

Pyth, 11 bytes
f!%h.!tTTtS

Try it online.
Uses Wilson's theorem. Not my own idea (suggested to DenkerAffe by Leaky Nun & used already by Adnan), so I'm making it a community wiki.

Meh, was planning to do that after work, already spent too much time here on this :P But whatever, well done ;)

I don't know why, but I immediately read this code as fishsticks

What about {P.!Q ?

@drobilc P would be a prime builtin which are disallowed.

@Pietu1998 Yes, but I'm using P as a prime factorisation function, which is allowed.

Prime factorisation is allowed: {P.! works for 4 bytes (if anyone is still interested in this challenge anymore)

JavaScript (ES6), 98 bytes
alert([...Array(-~(n=prompt())).keys()].filter(n=>n>!!n&&[...Array(n)].every((_,i)=>i==!!i||n%i)))

f=n=>[...Array(-~n).keys()].filter(n=>n>!!n&&[...Array(n)].every((_,i)=>i==!!i||n%i))
<input id=i oninput=o.value=f(i.value)><input id=o>

Would it be shorter to use regex matching?

I think n=>[...(a=Array)(-~n).keys()].filter(n=>n>!!n&&[..a(n)].every((_,i)=>i==!!i||n%i)) is shorter

@Bálint Only because you accidentally deleted one of the .s before the a.

From the description of the challenge, on the first line: "Your challenge is to write a program (full program, not a function) [...]". You currently have a function, not a full program. A full program would be (n=>[...Array(-~n).keys()].filter(n=>n>!!n&&[...Array(n)].every((_,i)=>i==!!i||n%i)))(prompt()). I will reverte the downvote once any necessary change is made.

That is still just a function, but, I removed the downvote since the question was closed.

@IsmaelMiguel Ah, you want me to add 3 bytes to actually invoke the function too? I can do that.

Or, you can do like this: console.log([...Array(-~(n=prompt())).keys()].filter(n=>n>!!n&&[...Array(n)].every((_,i)=>i==!!i||n%i))), which is a full program that only takes 104 bytes.

Ruby, 53
$..upto(gets.to_i){|i|($....i).one?{|f|i%f<$.}&&p(i)}

This uses the $. magic variable in place of numeric literals, since it starts off as 0 and is incremented when we call gets to read from standard input. We can then define a prime number as a number that has exactly one factor less than it ($....i means the range from 1 to i excluding i) to avoid erroneously printing 0 and 1.

I didn't realize that Ruby copied the $. variable from Perl.

Retina, 29 27 bytes
!&`(?!.$|(?<k>..+)\<k>+$).+

Try it online!
Input/output in unary.
How it works:
It matches, with overlapping (&), the substrings of the input that are not 1 ((?!.$) and are not composite numbers ((?<k>..+)\<k>+$), then output all matches linefeed-separatedly (!)

Pyth, 13 bytes
fqh!Z/%LTSTZS

Try it here!
Explanation
Using the shortest (but most inefficient) way to check for primes.

fqh!Z/%LTSTZSQ    # implicit: Q = input

f           SQ    # Filter [1...Q] with T
       L ST       # Map over [1...T]
      % T         # T module the lambda var
     /     Z      # Count number of zeroes
 qh!Z             # If ^ is 2, it's a prime

Would it be shorter to use Wilson's theorem?

Checking if a number is equal to 2 can be done with: !tt

MATL, 10 bytes
:t!\~sqq~f

Try it online!
It could be shortened to 9 bytes using H (which produces predefined literal 2). But it feels like cheating:
:t!\~sH=f

Try it online!
Explanation
:     % Implicitly take input N. Generate row vector [1 2 ... N]
t!    % Duplicate and transform into column vector
\     % Modulo operation, element-wise with broadcast
~     % Logical negate. Transform zeros to 1, non-zeros to 0
s     % Sum of each column
qq    % Decrement by 1, twice. Zeros correspond to primes
~f    % Indices of zeros. Implicitly display

JavaScript (ES6), 110 bytes

f=n=>{p=true;q=[];for(i=p+p;i<=n;i++){for(j=i/i;++j<i;p=i%j?p:p>p);p?q.push(i):i;p=true}alert(q)};f(+prompt())

Thanks to @LeakyNun for helping me shorten my solution.

i=true+true -> i=p+p

for(j=true+true;j<i;j++)i%j==false?p=false:null; -> for(j=i/i;++j<i;p=i%j?p:p<p);

p?q.push(i):null; -> p+=p?","+i:"";

for(...){} -> for(...);

for(i=p+p;i<=n;p?q.push(i):i,i++)for(p=true,j=p;++j<i;p=i%j?p:p>p);

And since I can't post any more answer now... f=n=>{for(i=true,f=i,p=[];++i<=n;f*=i)(f+i/i)%i?i:p.push(i);alert(p)};f(+prompt()) (Uses Wilson's theorem)

Brachylog, 6 bytes
$!$pd.

Saved a crapload of bytes thanks to @LeakyNun, who pointed out that you can use prime factorization built-ins.

$!$pd should save some bytes

@LeakyNun Since the rule about prime built-ins was unclear, I chose not to use any, prime factorization included. It would save bytes though, that's for sure.

The question said prime factorization is allowed.

Perl 6,  51 48  47 bytes
.say for grep {!first $_%%*,[*]^.. .sqrt},[*]^..get
.say for grep {!first $_%%*,[*]^..^$_},[*]^..get
.say for grep {!grep $_%%*,[*]^..^$_},[*]^..get
Explanation:
[*] / [*] () multiply all of the elements of an empty list, which results in 1.
$_ %% * is a WhateverCode that returns True if $_ is divisible by its only argument.
.say   # call the .say method on:
for    # every value from:
  grep # only those that match:

    {  # bare block with $_ for parameter
       # ( this block returns True when the value is prime )
      !          # negate: ( True for Nil, False for a number )

      first      # return the first value that is
        $_ %% *, # divisible by one of the following

        # ｢2 .. $_.sqrt.floor｣

        [*]      # 1
        ^..      # Range that ignores the first value
        .sqrt    # the square root of the value we are checking for primality
    },

    # ｢2 .. get｣

    [*]         # 1
    ^..         # Range that ignores the first value
    get         # read a line from $*IN

The 48 byte example tests against a Range that is from 1 up to the value to check for primality, excluding both end points.

That will run slower as the prime numbers increase, as it checks against all values up to the square root of the number it is testing. It will be more performant if you cache the primes as you go, and only test against them.
( There may be a point where the previous code will be more performant if you run out of memory, and it has to page the cache out to disk )
my @p;.say for grep {push @p,$_ if !first $_%%*,@p},([*])^..get

The normal way to write something that prints out primes would be:
.say for grep *.is-prime, 2..get

( I would probably use @*ARGS[0] instead of get so that it gets input from the command line instead of STDIN )

my @p;.say for grep {push @p,$_ if !first $_%%*,@p[{0..$_/2}]},([*])^..get would be even more performant

J, 22 bytes
([:>:@I.>:|*:@!)@i.@x:

Also uses Wilson's theorem.
Usage
   f =: ([:>:@I.>:|*:@!)@i.@x:
   f 9
2 3 5 7
   f 100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

Python 2, 74 bytes
lambda n:[-p for p in range(-n,n/-n)if all(p%i for i in range(-~True,-p))]

Is this a function?

Python 2, 59 58 bytes
n=input();k=p=n/n
while k<n:
 p*=k*k;k=-~k
 if p%k:print k

Test it on Ideone.

Python 2, 102 bytes
p=input()
q=p/p
print[i if min([i%l for l in range(q+q,i)]+[q])>q-q else None for i in range(q+q,p+q)]

Perl 5, 37 bytes
36, plus 1 for -nE instead of -e
{/^.?$|^(..+?)\1+$/||say;s/.//;redo}

Input and output are in unary.

If \1 is considered using a literal number, I can use \g1 instead at the expense of a byte. But it shouldn't be so considered: it's really a variable name.

Mathematica, 43 bytes
Select[Range@Input[],Tr@Rest@Divisors@#==#&]

Selects from a range of integers between 1 and Input[] those, the sum of whose divisors, except the first one (in ascending order) is equal to the number itself.

Dyalog APL, 14 bytes
((⊢~∘.×⍨)≢↓⍳)⎕

Fully parenthesised:
(⊢ ~ ((∘.×)⍨)) (≢ ↓ ⍳)

Every triple of functions applies the right and left monadic functions separately to whatever is outside of the parenthesis, and then the two results become the arguments of the middle function, thus (f g h)A is (f A) g (h A). This repeat itself until the following tree structure:
    ┌──────┴──────┐
 ┌──┼────┐     ┌──┼──┐
┌┴┐┌┴┐┌──┴──┐ ┌┴┐┌┴┐┌┴┐
│⊢││~││∘.× ⍨│ │≢││↓││⍳│
└─┘└─┘└─────┘ └─┘└─┘└─┘

⎕ prompt for numeric input
Let's assume the user inputs 6:
≢ tally the input (giving 1) and ⍳ indices until the input (giving 1 2 3 4 5 6)
1 ↓ 1 2 3 4 5 6 drop 1 from the list (giving 2 3 4 5 6)
⊢ pass through (2 3 4 5 6) and ∘.×⍨ multiplication table:
 4  6  8 10 12
 6  9 12 15 18
 8 12 16 20 24
10 15 20 25 30
12 18 24 30 36

2 3 4 5 6 ~ 4 6 8 10 12 6 9… "without" (i.e. set difference), yielding 2 3 5
TryAPL!

J, 7 bytes
~.@q:@!

~. unique @ of q: prime factors @ of ! factorial


text:
Generate an infinite group of infinite galaxies
Here is the challenge as proposed by @trichoplax thanks to him for consolidating my post and standarizing it to PPCG common-rules.

A galaxy is a group of numbers where each one is mapped to another via a precise function f either a symbolic one or mathematical, a structure of numbers sharing some common points with this challenge i got inspired from with an exception that a galaxy sequence is not cyclic, but holds in a black hole, where more than one number can be mapped to it.
A black hole is a specific unique number from a galaxy where all numbers (not individually) are mapped transitively to it, by repeating a function f infinitely over an infinite far number in a same galaxy, or just once if a number is the closest in the same galaxy, for example if the function is the ceiling of the square root then a black hole for the biggest galaxy so far excluding only the number 1 is 2, because mapping the closest number 3 or the infinite repetitively leads to the same number.

Task
Conceive a universe of an infinite number of distinct galaxies where all galaxies encompass an infinite number of integers.
Note that the example of ceiling of square root is banned for two reasons:

The galaxy {1} is finite.
There is a finite number of galaxies.

A valid example, is dividing by the smallest prime factor. This gives an infinite number of infinite galaxies.
2*2*3*5*5*7, 2*3*5*5*7, 3*5*5*7, 5*5*7, 5*7, 7, 7*5*5*5, 7*5*5*5....
5*5*7*11, 5*7*11, 11*7*7*7... , ....
...

Or one galaxy as a tree:
2*2*5 - 2*5 \
             \
2*3*5 - 3*5 - 5
3*3*5 /       |
             /
2*5*5 - 5*5 /
3*5*5 /

Each galaxy consists of all numbers that share the same largest prime factor, and the function takes them all step by step towards the black hole which is that prime factor.
Note also, you may choose any domain of integers as long as the range is infinite, i mean you can exclude a range of numbers that makes the rest still boundless like {1,0} from last example.
Your program takes any integer input via a function's dimension , STDIN, and outputs an integer as the image mapped from this preimage, otherwise prints "error" or any string prespecified for an outputless range of enteries.
For the same example:
(IN/OUTPUT)
   20
   10

   15
   5

   77
   11

   0
   'undefined'

   1
   'undefined'

This is code-golf so shortest program in bytes wins.
I would have really liked to add a bonus-score for anyone who succeeds to find a function generating a universe without trees, alas, bonuses for code-golf are excluded.

Do they have to have common points?

To clarify: a "black hole" is a fixed point of the function f (a number n such that f(n) = n), and a "galaxy" is the set of all numbers that eventually reach the same black hole when f is applied to them repeatedly, correct? And the challenge is to implement a function f that has an infinite number of infinitely large galaxies? Can f have finite cycles or finite galaxies in addition to these infinite galaxies?

Also, you might want to add that in your example, every prime is a black hole (so the function is actually "divide by smallest prime factor, unless input is prime; in that case do nothing"). This has caused some confusion.

@LeakyNun mmmm yes, the general overlook, in/output system, non inter-collided categories, and essentially a source of inspiration.

@Zgarb there is no cycles, all members must be mapped to a blackhole transitively or directly

@Zgarb for the second remark, a prime^n is also a black hole

That six-line sentence in the second item is... not the easiest I've read :-)

@LuisMendo not the vaguest too :)

@Agawa001 thank you for the credit, but the idea was yours and you don't need to name me in the challenge. Each of my own challenges is a result of suggestions and feedback from a large number of people. This makes me very happy to give feedback in turn.

I still don't understand what this is asking, and based on discussion in answer comments, I'm not the only one. Can someone please state the requirement in standard mathematical terminology?

Pyth, 5 4 bytes, no trees
I am working under the assumption that the author intended for the function to be surjective, and for “no trees” to mean that only black holes have multiple preimages. (Technically, a tree with only one branch is still a tree.)
ahxt

Domain: positive integers.  Function: f(x) = |((x − 1) XOR x) + 1 − x|.  Black holes: powers of 2.  Galaxies:
1 ← 3 ← 5 ← 7 ← 9 ← 11 ← ⋯,
2 ← 6 ← 10 ← 14 ← 18 ← 22 ← ⋯,
4 ← 12 ← 20 ← 28 ← 36 ← 44 ← ⋯,
8 ← 24 ← 40 ← 56 ← 72 ← 88 ← ⋯,
⋮

please you can knock away that assumption u deduced by urself that a domain is surjective, the only condition for my puzzle, that numbers are either bridged to a "spleen" or "blackhole" or "terminus" by other peers, or just it is drawn directly to this point, maybe i made a slip here, so i should rather use "and" ?

@Agawa001 This solution is valid whether or not the function is required to be surjective. However, if it is not, then my non-surjective 2-byte solution is also valid and also has no trees, which would make this 5-byte solution kind of pointless. (It is apparent that you have some complaint about my 2-byte solution, but I still cannot figure out what that complaint is. Let’s keep that conversation over there.)

i cant understand your solution, it does subtract the rearmost runs of 0's followed by '1' shifted by 1 from x, does it have another translation ?

is this a universe with tree-less infinite galaxies ? even for bh's ? if so i would accept that unique answer.

@Agawa001 You are going to have to explain what you mean by “tree-less”. What is a “tree”? Formally, a tree is any graph where there is a unique path from the root to each node. That is not the case in any graph with a self-loop (such as a black hole). If you exclude the self-loops, then every galaxy in every valid solution is a tree. I am doing my best to try to infer what you meant to say, but that is clearly not working, and this would be much clearer to me and to everyone else if you could give a formal definition.

Python 2, 15 bytes
lambda n:n>>n%2

The domain is nonnegative integers.

You ninja'd me :( I was just discussing this in chat...

@orlp If I'm understanding the question correctly, 0, 1, 3, 7, ... is a galaxy.

Does 2 form an infinite galaxy?

@LeakyNun Yep. 2, 5, 11, 23, etc.

@feersum I confused it with a different solution, never mind :)

You might want to post that in Jelly: æ»Ḃ

@LeakyNun I prefer to stay away from such languages.

it looks infinitesimally similar to orlp's function, while the difference is , you crop from the end while he crops from the head.

Python, 40 bytes
lambda n:n&~-n and int(bin(n)[3:],2)or n

Clear the top bit if there's more than one bit set, otherwise returns the number itself. The domain is the positive integers.
First couple numbers (in binary):
    1:     1
   10:    10
   11:     1
  100:   100
  101:     1
  110:    10
  111:    11
 1000:  1000
 1001:     1
 1010:    10
 1011:    11
 1100:   100
 1101:   101
 1110:   110
 1111:   111
10000: 10000
10001:     1
10010:    10
10011:    11
10100:   100
10101:   101
10110:   110
10111:   111
11000:  1000
11001:  1001
11010:  1010
11011:  1011
11100:  1100
11101:  1101
11110:  1110
11111:  1111

this is nice one !

Pyth, 2 bytes
hP

Domain: integers ≥ 2.  Function: smallest prime factor.  Black holes: primes.
(This seems too simple but seems to satisfy the challenge as far as I can tell.  Is the challenge missing some requirement?  For example, perhaps the function is supposed to be surjective?)

" all members must be mapped to a blackhole transitively or directly" hmmm that does not satisfy the "transitively" condition. but I will take it as valid solution.

@Agawa001 The condition that you wrote is satisfied—“all numbers are A or B” does not require “some numbers are A”. But I think this solution is not interesting, so if you fix the challenge requirements to exclude it, I am happy to delete it. I would suggest that you add a requirement that the function is surjective. (That would imply the existence of arbitrarily long transitive chains to any black hole.)

the function is already surjective, but it can be bijective where there is no trees, i dont know how u relate things

@Agawa001 My function is not surjective (for example, it will never output 4), but you gave no requirement for the function to be surjective. If you intended to have such a requirement, go ahead and add it, and I will delete this answer. I don’t know what an “invective” function is; do you mean injective? But any function with a black hole cannot be injective.

@andres , surjectivity is when two preimages atleast share one image

@Agawa001 No it isn’t. Surjectivity is when the image is the entire codomain: that is, for every y, there is at least one x with f(x) = y. https://en.wikipedia.org/wiki/Surjective_function

ah yes yes atleast i misworded things, images all must have atleast one preimage, but a surjectivity isnt a requirement for my puzzle, one requirement is 'elements must be either mapped directly or transitively to BH', this rule is seemed to be overstepped here.

@Agawa001 Can you give an example, then, of a number that my solution fails to map directly or transitively to a BH?

@andres for transitively, all of them

@Agawa001 Your requirement is an “or”, so I get to choose which side of the “or” to satisfy. If I choose “directly” every time, I have satisfied the requirement. If that is not what you intended, you should change the requirement. (Besides, “directly” is a special case of “transitively” anyway. Also, my name is not andres.)

ok! the "or" was intended to not be exclusive, every member should be mapped this or that way, means it cant be mapped both ways but the solution can be too simple that case.

@Agawa001 Uh, if your “or” is intended to be inclusive (which is what “or” means unless otherwise specified), that means that “A or B” is satisfied when both A and B hold. But that’s not my point. The opposite of “for all n, A or B” is “exists n such that (not A) and (not B)”. In order to show that I have not satisfied “for all n, A or B”, you should be able to produce an n such that A fails and B fails. You don’t get to merely produce an n such that B fails.

05AB1E, 9 bytes
Code:
Dpiëf¬¹s/

Explanation:
Dpi         # if input is prime return input
   ë        # else
    f¬      # get the smallest primefactor
      ¹s/   # divide input by this factor

Domain:{n | n∈N ∧ n>1}
Range: {n | n∈N ∧ n>0}

please, provide the range of surjective (domain,codomain) and the function used (even if it is already embedded in the question core)

@Agawa001: Something like this?

I guess you might have to update your code.

@LeakyNun: Thanks for the heads up

Python 2, 29 bytes
lambda n:int("0"+`n`[1:])or n

Strips off the first digit, unless that makes the number 0. The domain is the positive integers.

JavaScript (ES6), 12 bytes
n=>n%2?n:n/2

The domain is the positive integers. The black holes are the odd numbers.

n=>n/(2-n%2) has the same byte count

Pyth, 5 bytes
|stzz

Port of my Python answer (the decimal version).

matlab (156)
a=input('');if find(num2str(a)=='0')a,return,end,b=char(num2str(a)-1);c=str2num(b);if find(b=='0')if(find(num2str(c)=='0')&c)c,else 10^nnz(b)+c,end,else c,end

I declare my self the winner of that imaginary score because i am the first who finds a universe of galaxies without trees.
Domain is decimal numbers with two or more significant digits. and not a difference bteween two arbitray digits squals to 9 .
Black holes are numbers which have significant zeros, either in the extreme bottom, or between two strictly positive digits 12300131 , 123400 , 10 , ....
The function is decrementing all decimal digits of that number by 1, if we stumble upon a significant zero we declare a blackhole, if non-significant zero at the head of this number, precede it with 1 then the result topped by unsignificant zeos.
There is no trees in that galaxy except the blackhole which absorbs an infinite tree-less streams of finite numbers.

I don’t understand how this fits your requirements. 11 maps to 0, which is not in your domain. And the galaxies are not infinite; for example, the galaxy 98 → 87 → 76 → 65 → 54 → 43 → 32 → 21 → 10 has no other members.

@downvoter fixed

@AndersKaseorg they do have infinite other members ,  232 → 121 → 10 , 2232 → 1121 → 10 , 22222232 → 11111121 → 10 .....

@AndersKaseorg and for ur remark it is fixed, i replaced 9 by 1, now : 22 → 11 → 100 /  322 → 211 → 100 / .....

Your change added other preimages of 10, but now the galaxy 90 has no other members.

@AndersKaseorg exclude them !!!! any number which has both 9 and significant zero !


text:
Maximum Maxima!
Inspired by this question and refined by Luis Mendo.
Challenge
Given a 2D matrix of integers, each row has a maximum value. One or more elements of each row will be equal to the maximum value of their respective row. Your goal is to determine which column(s) contain the most entries which are equal to their respective row's maximum value as well as the number of row-wise maxima found in these columns.
Input

The input will be a non-empty M x N matrix (M > 0 and N > 0) in whatever form is well-suited to your language of choice.

Output

Your program should return the index of each column containing the maximum number of row-wise maxima (either as separate values or a list). Either 0- or 1-based indexing can be used (specify in your description).
Your program should also return the number of maxima that were present in these columns (a single number).
The order/format of the output is flexible but should be explained in the text accompanying your answer.

Additional Information

All entries in the input matrix will be positive integers.
If the maximum value of a row is shared by multiple elements in that row, all
occurrences of that value count towards their columns' total.
If multiple columns contain the same number of maxima, you should return a list of all columns
which had this number of maxima.

An Example
Consider input
 7  93
69  35
77  30

Row 1 has maxium 93, which occurs only once, namely at column 2. Row 2: occurs at column 1. Row 3: also at column 1. So the winner column is 1, with 2 maxima. Thus the output will be [1] [2]. If we change the input to
 7  93
69  35
77  77

the output will be [1 2] [2], because both columns have 2 maxima.
Test Cases
input                 =>    output ( [1-based index array], [nMaxima] )
----------------------------------------------
 7  93
69  35                =>    [1], [2]
77  30

 7  93
69  35                =>    [1 2], [2]
77  77

1   2   3   4         =>    [4], [2]
5   6   7   8

16   2   3  13
 5  11  10   8        =>    [1  2  4], [1]
 9   7   6  12

 1   1   1   1        =>    [1  2  3  4], [1]

25   6  13  25        =>    [1  4], [1]

1
2
3                     =>    [1], [4]
4

100                   =>    [1], [1]

Scoring
This is code-golf, the shortest code in bytes wins. Tiebreaker goes to the earlier answer.
Leaderboard
Below is a stack snippet for analyzing all entries.

var QUESTION_ID=80788,OVERRIDE_USER=51939;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Fun fact; the Dutch queen is called Maxima, so technically we can only have 1 Maxima.

Fun fact; there is also an opensource CAS called Maxima.

Jelly, 9 bytes
="Ṁ€SµM,Ṁ

Input is a 2D list, output is a pair: a list of 1-based indices and the maximal number of maxima.
Try it online! or verify all test cases.
How it works
="Ṁ€SµM,Ṁ  Main link. Argument: M (matrix)

  Ṁ€       Apply maximum to each row.
="         Zipwith equal; compare the entries of the nth row with its maxmium.
    S      Sum; reduce across columns to count the maxima in each row.
     µ     Begin a new, monadic link. Argument: A (list of maxima)
      M    Yield all indices with maximal value.
        Ṁ  Yield the maximum of A.
       ,   Pair the results to both sides.

J, 27 bytes
((I.@:=;])>./)@(+/@:=>./"1)

This is a monadic verb, used as follows in the case of the second example:
   f =: ((I.@:=;])>./)@(+/@:=>./"1)
   m =: 3 2 $ 7 93 69 35 77 77
   f m
+---+-+
|0 1|1|
+---+-+

The output consists of two boxes, and uses 0-based indexing. Try it here!
Explanation
((I.@:=;])>./)@(+/@:=>./"1)  Input is m.
(            )@(          )  Composition: apply right hand side, then left hand side.
                     >./"1   Take maximum of each row of m.
                    =        Replace row maxima by 1 and other values by 0,
                +/@:         then take sum (number of maxima) on each column.
                             The result is the array of number of row maxima in each column.
          >./                Compute the maximum of this array
 (     ;])                   and put it in a box with
  I.@:=                      the indices of those entries that are equal to it.

Pyth, 20 19 17 bytes
1 byte thanks to @Suever.
1 byte thanks to @Jakube.
{MC.MhZrSsxLeSdQ8

Test suite.
Output is 0-indexed.
Order is reversed.
All inputs
[[7,93],[69,35],[77,30]]
[[7,93],[69,35],[77,77]]
[[1,2,3,4],[5,6,7,8]]
[[16,2,3,13],[5,11,10,8],[9,7,6,12]]
[[1,1,1,1]]
[[25,6,13,25]]
[[1],[2],[3],[4]]
[[100]]

All outputs
[[2], [0]]

[[2], [0, 1]]

[[2], [3]]

[[1], [0, 1, 3]]

[[1], [0, 1, 2, 3]]

[[1], [0, 3]]

[[4], [0]]

[[1], [0]]

How it works
{MC.MhZrSsxLeSdQ8

               Q   Yield input.
           L       For each array in input (as d):
            eSd      Yield maximum of d.
          x          Yield the 0-indexed indices of the maximum in d.
         s          Flatten.
        S           Sort.
       r         8  Run-length encoding.
                    Now the array is:
                      [number of maxima in column, index of column]
                      for all the columns
   .MhZ             Yield the sub-arrays whose first element is maximum.
                     The first element of each sub-array
                     is "number of maxima in column".
                     Now the array is:
                       [number of maxima in column, index of column]
                       for all the required columns
  C                 Transpose.
                    Now the array is:
                      [[number of maxima in each column],
                       [index of each required column]]
                    Note that every element in the
                    first sub-array is the same.
{M                  Deduplicate each.

MATL, 17 bytes
vH3$X>G=XstX>tb=f

The first output is the max number of maxima and the second output is the columns in which this occured (1-based indexing).
Try it Online!
Explanation
v       % Vertically concatenate everything on the stack (nothing), yields []
        % Implicitly grab the input
H       % Push the number 2 to the stack
3$X>    % Compute the maximum value of each row (along the second dimension)
G       % Explicitly grab input again
=       % Compare each row of the input to the row-wise max (automatically broadcasts).
Xs      % Sum the number of matches in each column
t       % Duplicate the array
X>      % Determine the max number of maxima in all columns
t       % Duplicate this value
b=f     % Find the index of the columns which had the maximum number of maxima
        % Implicitly display stack contents

MATL, 17 bytes
!tvX>!G=5#fFTT#XM

Input is a 2D array, with rows separated by semicolons. So the inputs for the test cases are
[7 93; 69 35; 77  30]
[7 93; 69 35; 77  77]
[1 2 3 4; 5 6 7 8]
[16 2 3 13; 5 11 10 8; 9 7 6 12]
[1 1 1 1]
[25 6 13 25]
[1; 2; 3; 4]
[100]

Output is: first the maximum amount of maxima, then one or more column indices.
Try it online!
Explanation
This uses a different approach from Suever's answer.
First a matrix of logical values (true and false)  is computed, where true indicates the presence of a row-maximum. Then the column indices of the true values are extracted into a vector. Finally, the mode of that vector is computed (maximum number of maxima), along with all values that are the most frequent (desired column indices).
!        % Implicit input. Transpose
tv       % Duplicate. Concatenate vertically. This forces next function (max)
         % to work along columns even if input is a row vector
X>       % Maximum of each column (gives row vector)
!        % Transpose into column vector
G        % Push input again
=        % Test for equality, with broadcast. Gives matrix of true and false
5#f      % Column indices of true values, as a column vector
FTT#XM   % Mode of that vector, and all values that occur maximum number of times
         % Implicit display

CJam, 38 35 31 bytes
2 bytes fewer thanks to @FryAmTheEggMan, with help also from @quartata. Thanks also to @Dennis for removing 4 more bytes.
q~_::e>.f=:.+_:e>_@f{=U):Ua*~}p

Input is of the form
[[7 93] [69 35] [77 77]]

Output is an array of 1-based column indices and a number.
Try it online!

q~_::e>.f=:.+_:e>_@f{=U):Ua*~}p saves a few bytes. Turning it into a code block would save 1 more.

@Dennis Thanks! Now I need to understand what {=U):Ua*~} does...

Husk, 18 16 19 16 bytes
SṠ·e;¥▲mΣTmṠom=▲

Try it online!
Probably my best use of combinators in Husk.
-2 bytes from Jo King.
+3 bytes after satisfying first test case.
-3 bytes from Jo King(again!)
Explanation
§eṠoW=▲o;▲mΣTmṠom=▲
             m      map each row to the following:
              Ṡ     hook: Ṡ f g x = f (g x) x
                m=  map each element of the row by equality
                  ▲ to the maximum of the row
            T       transpose the matrix
          mΣ        map each column to its sum
§                   fork: § f g h x = f (g x) (h x)
 e                  create two element list from:
  Ṡ                 hook: Ṡ f g x = f (g x) x
   oW=              indices of elements wich equal
      ▲             maximum, and:
       o;▲          number of maxima

Pyke, 17 bytes
FDSeRmq),AsDSe
R%

Try it here!

Python 2, 106 bytes
x=map(sum,zip(*[map(max(r).__eq__,r)for r in input()]))
m=max(x);print[i for i,n in enumerate(x)if n==m],m

Input is a 2D list of floats, output is a pair: a list of 0-based indices and an integer.
Test it on Ideone.

Julia, 54 bytes
f(x,m=maximum,t=sum(x.==m(x,2),1))=find(t.==m(t)),m(t)

Input is a matrix, output is a pair: a list of 1-based indices and the maximal number of maxima.
Try it online!

05AB1E, 14 (or 12) bytes
εZQ}øOZ©Qƶ0K®‚

Outputs in the format [[1-indexed columns-list], maxima].
Try it online or verify all test cases.
If it's allowed to have items 0 in the columns-list which we ignore, it could be 2 bytes less by removing the 0K:
Try it online or verify all test cases.
Explanation:
ε               # Map each row in the (implicit) input-matrix:
 Z              #  Get the maximum of the row (without popping)
  Q             #  Check for each value in this row if its equal to the row-maximum
   }ø           # After the map: zip/transpose the matrix; swapping rows/columns
     O          # Take the sum of each inner list (the truthy/falsey values of the columns)
      Z         # Get the maximum column-sum (without popping)
       ©        # Store it in the register (without popping)
        Q       # Check for each column-sum if its equal to this maximum
         ƶ      # Multiply each truthy/falsey value in the list by its 1-based index
          0K    # Remove all 0s
            ®‚  # Pair the resulting list with the maximum we stored in the register
                # (and output the result implicitly)

JavaScript (ES6), 111 bytes
a=>[m=Math.max(...a=a[0].map((_,i)=>a.map(a=>c+=a[i]==Math.min(...a),c=0)|c)),[...a.keys()].filter(i=>a[i]==m)]

Returns an array of two elements; the first is the maximum count of maxima, the second is the array of zero-indexed columns with that count.

Octave, 47 46 bytes
@(r){m=max(s=sum(r==max(r,0,2),1)),find(s==m)}

This creates an anonymous function that automatically assigns itself to ans and can be run using ans([1 2 3; 4 5 6]). It returns a two-element cell array where the first element is the maximum number of maxima and the second is the 1-based index of the columns containing these maxima.
All test cases

Python 3, 142 bytes
The algorithm here is basically, go through each row and increase the score of columns that have the max of that row. Then find the max of the scores and find the columns that have that max score and return them. Columns are 1-indexed. I tried one-lining this into a lambda, but with generating the scores column by column it was 153 bytes.
def f(r):
    s=[0]*len(r[0]);e=enumerate
    for x in r:
        for i,j in e(x):
            s[i]+=(0,1)[j==max(x)]
    m=max(s);return[i+1for i,j in e(s)if j==m],m

Test Cases
x=[[7, 93],
[69, 35],
[77, 30]]

print(f(x)) #=>    [[1], 2]

x=[[ 7, 93],
[69, 35],
[77, 77]]

print(f(x)) #=>    [[1 2], 2]

x=[[1,  2,   3,  4],
[5,  6,  7,  8]]

print(f(x)) #=>    [[4], 2]

x=[[16,  2,  3, 13],
 [5, 11, 10,  8],
 [9,  7, 6, 12]]

print(f(x)) #=>    [[1  2  4], 1]

x=[[1,  1,  1,  1]]

print(f(x)) #=>    [[1  2  3  4], 1]

x=[[25,   6,  13,  25]]

print(f(x)) #=>    [[1  4], 1]

x=[[1],
[2],
[3],
[4]]

print(f(x)) #=>    [[1], 4]

x=[[100]]

print(f(x)) #=>    [[1], 1]

Clojure, 150 bytes
(fn[M](let[F(dissoc(frequencies(mapcat(fn[r](map-indexed #(if(=(apply max r)%2)%)r))M))nil)m(apply max(vals F))][(map first(filter #(#{m}(% 1))F))m]))

Man that is long, I've got a feeling this could be simplified a lot. At least it produces the correct output.
[(f [[ 7  93][69  35][77  30]])
 (f [[ 7  93][69  35][77  77]])
 (f [[16   2   3  13][5  11  10   8][9   7   6  12]])]

[[(0) 2] [(1 0) 2] [(0 1 3) 1]]

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