text:
Not too hard to code this right?
You have to write a program or a function in any language that outputs this pattern:
~|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||~
|~|||||||||||||||||||||||||||||||||||||||||||||||||||||||||~|
||~|||||||||||||||||||||||||||||||||||||||||||||||||||||||~||
|||~|||||||||||||||||||||||||||||||||||||||||||||||||||||~|||
||||~|||||||||||||||||||||||||||||||||||||||||||||||||||~||||
|||||~|||||||||||||||||||||||||||||||||||||||||||||||||~|||||
||||||~|||||||||||||||||||||||||||||||||||||||||||||||~||||||
|||||||~|||||||||||||||||||||||||||||||||||||||||||||~|||||||
||||||||~|||||||||||||||||||||||||||||||||||||||||||~||||||||
|||||||||~|||||||||||||||||||||||||||||||||||||||||~|||||||||
||||||||||~|||||||||||||||||||~|||||||||||||||||||~||||||||||
|||||||||||~|||||||||||||||||~|~|||||||||||||||||~|||||||||||
||||||||||||~|||||||||||||||~|||~|||||||||||||||~||||||||||||
|||||||||||||~|||||||||||||~|||||~|||||||||||||~|||||||||||||
||||||||||||||~|||||||||||~|||||||~|||||||||||~||||||||||||||
|||||||||||||||~|||||||||~|||||||||~|||||||||~|||||||||||||||
||||||||||||||||~|||||||~|||||||||||~|||||||~||||||||||||||||
|||||||||||||||||~|||||~|||||||||||||~|||||~|||||||||||||||||
||||||||||||||||||~|||~|||||||||||||||~|||~||||||||||||||||||
|||||||||||||||||||~|~|||||||||||||||||~|~|||||||||||||||||||

The output is composed of 20 lines of 61 characters each.
Rules

Standard loopholes are forbidden
There may be a single trailing newline at the end of the output
There may not be any trailing whitespace on any line of the output

Without a trailing newline, the md5 checksum of the output is fde4e3b4606bf9f8c314131c93988e96.
With a trailing newline, the md5 checksum of the output is 1f0b43db4fec6594be202c8339024cb7.
This is code-golf, so the shortest code in bytes wins.

I have edited the challenge to make it slightly clearer, feel free to rollback the edit.

I've drawn a curious pattern ... http://rextester.com/WXZV81312

C (gcc), 97 82 81 80 bytes
Golfed 15 bytes after learning that abs is a builtin in C, an additional byte thanks to Rogem for pointing out that the declarations of my variables can be moved to the function, and another byte thanks to ceilingcat for suggesting x=31;--x+31 instead of x=-31;++x<31.
f(x,y){for(y=21;--y;puts(""))for(x=31;--x+31;)printf(abs(10-abs(x))-y?"|":"~");}

Try it online!
This outputs with a trailing newline. The function f does the outputting.
Explanation
The output can be stated as a graph.
~|||||||||||||||||||||||||||||+|||||||||||||||||||||||||||||~
|~||||||||||||||||||||||||||||+||||||||||||||||||||||||||||~|
||~|||||||||||||||||||||||||||+|||||||||||||||||||||||||||~||
|||~||||||||||||||||||||||||||+||||||||||||||||||||||||||~|||
||||~|||||||||||||||||||||||||+|||||||||||||||||||||||||~||||
|||||~||||||||||||||||||||||||+||||||||||||||||||||||||~|||||
||||||~|||||||||||||||||||||||+|||||||||||||||||||||||~||||||
|||||||~||||||||||||||||||||||+||||||||||||||||||||||~|||||||
||||||||~|||||||||||||||||||||+|||||||||||||||||||||~||||||||
|||||||||~||||||||||||||||||||+||||||||||||||||||||~|||||||||
||||||||||~|||||||||||||||||||+|||||||||||||||||||~||||||||||
|||||||||||~|||||||||||||||||~+~|||||||||||||||||~|||||||||||
||||||||||||~|||||||||||||||~|+|~|||||||||||||||~||||||||||||
|||||||||||||~|||||||||||||~||+||~|||||||||||||~|||||||||||||
||||||||||||||~|||||||||||~|||+|||~|||||||||||~||||||||||||||
|||||||||||||||~|||||||||~||||+||||~|||||||||~|||||||||||||||
||||||||||||||||~|||||||~|||||+|||||~|||||||~||||||||||||||||
|||||||||||||||||~|||||~||||||+||||||~|||||~|||||||||||||||||
||||||||||||||||||~|||~|||||||+|||||||~|||~||||||||||||||||||
|||||||||||||||||||~|~|||||||||||||||||~|~|||||||||||||||||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

(The +s are only shown for explanation purposes and represent the axes.)
The equation of this graph is \$y=\text{abs}(10-\text{abs}(x))\$ as can be seen here in this link to a Desmos graph.
abs(10 - abs(x))
abs(           )            Reflect whatever is beneath the x-axis to above the x-axis
    10 - abs(x)             This forms the central triangle-like structure

In function f, we have two for-loops that iterate through every coordinate in this graph. y goes from 20 to 1 and x goes from -30 to 30.
For every x, we check if abs(10-abs(x)) equals y by doing abs(10-abs(x))-y in a ternary. If they are equal, this yields 0, a falsey value in C, otherwise it will evaluate to some positive value. Then in the ternary abs(10-abs(x))-y?"|":"~", we printf accordingly.
And after each line, we output a newline using puts(""), and that is how the function outputs with a trailing newline.

Save one byte with f(x,y) instead of x,y;f()

@ceilingcat Thanks for the golf

Charcoal, 16 15 bytes
-1 byte thanks to notjagan
↘×~²⁰↗↗×~χ‖ＯＵＢ|

Try it online!

-1 byte by removing the Ｍ and moving implicitly.

R, 70 67 bytes
3 bytes thanks to Giuseppe.
write(c("|","~")[outer(abs(10-abs(-30:30)),20:1,"==")+1],"",61,,"")

Try it online!

67 bytes

Change the first "" to a 1 for -1.

Python 2.7, 163 138 135 133 113 91 bytes
l,t=S='|~'
for s in range(20):a=[l]*61;a[s]=a[60-s]=t;a[40-s]=a[20+s]=S[s>9];print`a`[2::5]

Try it online!
Edit 1: -25 bytes: changed the algorithm after I felt a bit ambitious. :P
Edit 2: -3 bytes: courtesy Felipe Nardi Batista
Edit 3: -2 bytes: courtesy shooqie
Edit 4: -20 bytes: courtesy notjagan
Edit 5: -22 bytes: courtesy Leaky Nun

Completely missed that! Thanks @FelipeNardiBatista.
It doesn't matter anymore though :P changed the algorithm completely.

135 bytes

stacking attributions like a,b,c='1','2','3' is the same as a='1';b='2';c='3' and the same as placing each one in it's own line, but you can gain bytes by unpacking strings like a,b,c='123'

Isn't n<m shorter than n-m<0?

So... How many bytes is this...?

Got it down to 113 bytes.

111 bytes

91 bytes

Jelly, 18 16 bytes
⁵×3ŒRAạ=þḤṚị⁾~|Y

Try it online!
⁵×3ŒRAạ=þḤṚị⁾~|Y  Main link. No arguments.

⁵                 Set the argument and the return value to 10.
 ×3               Multiply by 3 to yield 30.
   ŒR             Balanced range; yield [-30, -29, ..., 29, 30].
     A            Take absolute values.
      ạ           Take absolute differences with 10.
         Ḥ        Unhalve; yield 20.
       =þ         Table equals; compare each result with each k in [1, ..., 20].
          Ṛ       Reverse the resulting 2D array.
           ị⁾~|   Index into "~|", yielding '~' for 1 and '|' for 0.
               Y  Separate by linefeeds.

///, 231 bytes
/3/|~//2/\/\///1/!!20/|
2-/&#2,/|#2'/"""2&/||2%/1|2#/&~2"/1!2!/&&|/~'%,
3'1#0#'1~&
,'!,&0-'!3&&
!~'-!
!3'#!0!#'~!&
!,""%#!&0!-""%~!&&
1~"-"-1
%~"#3"#%
1#"~,"~%0%#%#!~%#%&
%,%~!#%~%&0"~!-!-!-"
"3!#%~!#"0"#!~%#!~"&
",,"~,"&0"-3"#3"&&

Try it online! Or, view it interactively here!

WendyScript, 65 bytes (exclude newline)
<<a=>(x)?x<0/>-x:/>x
#y:20->0{#x:-30->31?a(10-a(x))==y@"~":@"|"""}

Try it online!
Follows the same principle as the C answer given above.
The first line is the abs function, second line runs two for loops and outputs ~ or | based on the graph. The last "" is used to output a newline after each loop on y.

Why are you excluding the newline?

The newline isn't required, the newline can be removed and the script still runs fine. It's just there so it's easier to see the separation of the abs function vs the main function.

Octave, 157 57 54 bytes
Golfed it further down, thanks to the other answers and the comments.
a=zeros(20,61);for i=-30:30;a(21-abs(10-abs(i)),i+31)=2;end
a=char(a+124)

I just approached it like the other answer with the abs(10-abs(x)) function and then used the right ASCII characters to print out the image.

Here we require answers to be well-golfed in a code-golf challenge. At least you should attempt to golf it by for example removing unnecessary whitespace etc.

Also, the language is called simply "Octave". As for golfing, apart from removing all whitespace (newlines too), make sure you combine statements, like the two final lines.

If anyone knows how I can get rid of the newline after endfor, that would be a great help.

Paintbrush, 36 bytes
non-competing
b|20{s~>v}10{>^s~}9{>vs~}>v20{>^s~}▁

Explanation
b|20{s~>v}10{>^s~}9{>vs~}>v20{>^s~}▁  Program
b|                                    Sets the background character to `|`
  20{    }                            Executes function 20 times
     s~                               Sets the current character to `~`
       >v                             Moves one space right and one space down
          10{    }                    Executes function 10 times
             >^                       Moves one space right and one space up
               s~                     Sets the current character to `~`
                  9{    }             Executes function 9 times
                    >v                Moves one space right and one space down
                      s~              Sets the current character to `~`
                         >v           Moves one space right and one space down
                           20{    }   Executes function 20 times
                              >^      Moves one space right and one space up
                                s~    Sets the current character to `~`
                                   ▁  Cuts off the last line (because it pads an extra line when the pointer moves near the edge)

This reminds me, I need to add a mirror operation.

Vim, 59 Bytes
2i~^[59i|^[qqYpi|^[f~l2xA|^[q18@q11G31|qqr~jlq9@qF~2lqqr~klq8@q

Where ^[ is the <ESC> key

:11<CR> can be 11G

Cheers. I didn't know about that one

Japt, 32 bytes
20ç|
AÆhX'~
VméA
VpWUVmw)c ê z ·

Try it online! Be sure to expand the output box.
Explanation
20ç|

Set U to | repeated 20 times.
AÆhX'~

Set V to the range [0,9] (AÆ) mapped by:
U (implicit) with the character at index X (current value) set to (h) ~.
VméA

Set W to V with each line rotated 10 (A) chars right.
VpWUVmw

Create array: V, W, U, and V with each line reversed (w). This is now the left half of the shape, rotated 90° left.
c ê z ·

Flatten the array (c), palendromize it (ê), rotate 90° right (z), and join with newlines (·).

Pyth, 22 bytes
j_t.tm+*\|aTa30d\~61\|

Try it online!

V, 30 bytes
i~³°|19ñÙé|$xñ22|òr~klòÎæ$0Px

Try it online!

Jelly, 18 bytes
61Rạ31ạ⁵Ṭ€z0Ṛị⁾~|Y

Try it online!

Bubblegum, 90 bytes
00000000: 9dcb a10d 0040 08c5 50cf cc4d 673f 85ab  .....@..P..Mg?..
00000010: b880 22fd 7972 3f07 ef98 e1cc 85e1 ca05  ..".yr?.........
00000020: 8623 97d5 78c2 abf1 8457 e305 b31a 0f78  .#..x....W.....x
00000030: f507 0fcc 54fc 6ed3 794b b6d2 c1ed 163a  ....T.n.yK.....:
00000040: b8dd 42c7 68b7 d031 f757 3ab8 dd42 07b7  ..B.h..1.W:..B..
00000050: 5be8 e076 0b1d dcaf 060f                 [..v......

Try it online!

MathGolf, 22 bytes
I{S╒xñ♂-±Iï--mÆ┬û|~§yp

Try it online!
Explanation
It's probably possible to golf away 2-3 bytes from this, I'll see what I can do.
I                        push 20
 {                       start block or arbitrary length
  S                      push 30
   ╒                     range(1,n+1)
    x                    reverse int/array/string
     ñ                   pop(a), push palindromize(a) string/list/number
      ♂                  push 10
       -                 pop a, b : push(a-b)
        ±                absolute value
         I               push 20
          ï              index of current loop, or length of last loop
           -             pop a, b : push(a-b)
            -            pop a, b : push(a-b)
             m           explicit map
              Æ          start block of length 5
               ┬         check if equal to 0
                û|~      string "|~"
                   §     get from array/string
                    y    join array without separator to string or number
                     p   print with newline

As much as the auto generated explanations are convenient, they usually miss the point of why the program is doing that...

@JoKing this is pretty much a port of the Jelly answer. I found a 21-byter after this using pretty much the same logic, I'll try to write a better explanation for that.

C (gcc), 75 bytes
f(x){for(x=1240;--x;)putchar(x%62?x/62+1-abs(10-abs(x%62-31))?124:126:10);}

Try it online!
Totally changed from Cows quack's answer

05AB1E, 20 19 bytes
20F„|~20Ýû31∍ûNQèJ,

Try it online.
Explanation:
20F               # Loop 20 times:
   „|~            #  Push the string "|~"
   20Ý            #  List of range [0,20]
      û           #  Palindromize [0..20..0]
       31∍        #  Shorten to length 31 [0..20..10]
          û       #  Palindromize again [0..20..10..20..0]
           NQ     #  Check if the loop index is equal to it
             è    #  And index it into the string
              J   #  Then join the list of characters together
               ,  #  And print with trailing newline

20Ýû31∍û generates the list:
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,19,18,17,16,15,14,13,12,11,10,11,12,13,14,15,16,17,18,19,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]

I tried using the canvas, but it turned out longer.

PowerShell, 64 bytes
0..19|%{$y=$_
-join(0..20+19..10+11..19+20..0|%{'|~'[$_-eq$y]})}

Try it online!
The four-part diagram with a linear function y=x

Positron, 165 bytes
i=0;while(i<20)do{k='|'*(59-2*i);if(i==10)then{j='|'*19;k=j+'~'+j;};if(i>10)then{q=39-2*i;j='|'*q;q=2*i-21;k=j+'~'+'|'*q+'~'+j;}print@('|'*i+'~'+k+'~'+'|'*i);i=i+1;}

Try it online!
I think Positron has too many bugs in it. I should get it updated to TIO because then ++ will actually work.

Tcl, 104 bytes
time {incr j
set i 0
time {puts -nonewline [expr 21-abs(abs([incr i]-31)-10)-$j?"|":"~"]} 61
puts ""} 20

Try it online!

Tcl, 105 bytes
time {incr j
set i 0
time {puts -nonewline [expr $j==21-abs(abs([incr i]-31)-10)?"~":"|"]} 61
puts ""} 20

Try it online!

Tcl, 109 bytes
time {incr j;set i 0;time {append s [expr $j==21-abs(abs([incr i]-31)-10)?"~":"|"]} 61;set s $s\n} 20
puts $s

Try it online!
Tcl, 143 133 123 110
Still much ungolfed, but I will evolve it after:
time {incr j;set i 0;time {incr i;append s [expr $j==21-abs(abs($i-31)-10)?"~":"|"]} 61;set s $s\n} 20
puts $s

demo

Wolfram gave a little help to golf it more a little: http://www.wolframalpha.com/input/?i=-abs(10-abs(x-31))%2B21 a plot I traced on Desmos: https://www.desmos.com/calculator/z9czvtpihy

JavaScript (ES6), 87 bytes

for(a=Math.abs,y=20;y--;console.log(s))for(s='',x=-30;x<31;x++)s+=a(10-a(x))+~y?'|':'~'

Mathematica, 78 75 bytes
Print[""<>Riffle[Array[If[#+Abs[10-Abs[31-#2]]==21,"~","|"]&,{20,61}],"\n"]]

except the \n is replaced by an actual newline. Try it online! (There are extra spaces at the starts of the lines in Mathics for some reason, but it works fine in Mathematica.)
I came up with a submission of my own, but then Kritixi Lithos added an explanation of theirs and it was quite similar to mine but using a slightly cleverer formula, so now this is just a port of that answer. (Go and read that one and upvote it!)

Bubblegum, 93 bytes
00000000: 9dcb 390e 4301 10c2 d09e 335b 9c3d 5d56  ..9.C.....3[.=]V
00000010: e72f 4c35 327a 65bf 86ee 9830 f342 5879  ./L52ze....0.BXy
00000020: 8130 f202 848d 9797 a613 262c bc7c 6a3a  .0........&,.|j:
00000030: 60c2 552e 9858 bcdc a2f9 55ac 9916 5e6f  `.U..X....U...^o
00000040: a285 d79b 6819 eb4d b4cc fe99 165e 6fa2  ....h..M.....^o.
00000050: 85d7 9b68 e1d5 26da 782f 3578 00         ...h..&.x/5x.

Try it online!

Lua, 193 bytes
m={}function g(x,y)if(x<62)then
m[x+y*61]="~"if(x==31or x==21or x==41)then
b=not b
end
g(x+1,y+((b and-1)or 1))end
end
g(1,0)for y=0,19 do
s=""for x=1,61 do
s=s..(m[x+y*61]or"|")end
print(s)end
Note that Lua cannot print something out without creating a new line. For this reason, I have to break one of the rules.
Minimally minified to a large extent:
map={}
o=20
p=61
--b is true means go up
function bounce(x,y,c)
    if (x~=p)then
        map[x+y*p]=c
        if(x==31 or x==21 or x==41)then
            b=not b

        end
        bounce(x+1,y+((b and -1) or 1),c)
    end
end
bounce(1,0,"~")
--map[2+60] = "h"
for y=0,o-1 do
    str = ""
    for x=1,p do
        str = str..(map[x+y*p] or "|")
    end
    print(str)
end

Some changes where made during minification, all of which makes the program less extendable but smaller.
Try it: https://tio.run/##PY7LCoMwEEX3@YqQVVJTcWwRCp0vKV1oNa1QJ0UjGPr49TRq6eoO91wOcx/LEDp8vs1IF9da4lc5aa9aI6djkSt3a4h1pynxmwLOKD5iJog7sD2Pmf9yD@u0QrKOV6yhmkVTAtonUla8pHoLKm5BqZmtHHSmTCw9ZhoOvLZsQCHMogRdwNoMaSr/L9hevMSiePQtOTnMdwhf
I'm not sure if anyone has done this before, but I tried minifying by loading the program as a string and using gsub(search/replace). Unfortainitly, it made the program bigger. However, if this program was big enough, it would yield in less bytes.
g=string.gsub
loadstring(g(g(g('m={}function g(x,y)if(x<62vm[x+y*61]="~"if(x==31zx==21zx==41vb=not beg(x+1,y+((b and-1)z1))eeg(1,0)fzy=0,19 do s=""fzx=1,61 do s=s..(m[x+y*61]z"|")eprint(s)e','e',' end '),'v',')then '),'z','or '))()
Due to its relative closeness with the real result(240 bytes, only 41 more), I figured I'd post it. If this program where 350+ bytes, there would have likely been a reduction.

Java 8, 113 bytes
v->{String r="";for(int i=-1,j;++i<20;r+="\n")for(j=61;j-->0;)r+=j==i|j+i==60|i>9&(j-i==20|j+i==40)?"~":"|";return r;}

I have the feeling the checks (j==i|j+i==60|i>9&(j-i==20|j+i==40) can definitely be golfed by somehow combining multiple checks into one.
Explanation:
Try it here.
v->{                    // Method with empty unused parameters and String return-type
  String r="";          //  Result-String
  for(int i=-1,j;       //  Index integers
      ++i<20;           //  Loop (1) from 0 to 20 (exclusive)
      r+="\n")          //    After every iteration: append a new-line to the result-String
    for(j=61;           //   Reset `j` to 61
        j-->0;)         //   Inner loop (2) from 60 down to 0 (inclusive)
      r+=               //    Append the result-String with:
         j==i           //     If `j` and `i` are equal (top-right /),
         |j+i==60       //     or `j` + `i` is 60 (top-left \),
         |i>9           //     or we're at the bottom halve
          &(j-i==20     //      and `j` - `i` is 20 (bottom left \),
            |j+i==40)?  //      or `j` + `i` is 40 (bottom right /)
          "~"           //       Append a literal "~" to the result-String
         :              //     Else:
          "|";          //      Append a literal "|" to the result-String
                        //   End of inner loop (2) (implicit / single-line body)
                        //  End of loop (1) (implicit / single-line body)
  return r;             //  Return the result-String
}                       // End of method

Perl 5, 79 bytes
push@a,[('|')x61]for 1..21;map$a[20-abs 10-abs][$_+30]='~',-30..30;say@$_ for@a

Try it online!

Python 3, 90 bytes
1 byte smaller than the other Python answer :)
Outputs with a trailing newline.
for y in range(20):print(''.join('~'if 20-y==abs(10-abs(x))else'|'for x in range(-30,31)))

Try it online!


text:
House of cards (version 2)

Thanks to FryAmTheEggman for the idea for this second version.
  Version 1 here.

Not-so-simple challenge: given a number of cards, build the biggest house of cards you can with that number of cards, according to the following building order:
                          /\       /\         /\         /\/\
                 --       --       --         ----       ----
/\  →  /\/\  →  /\/\  →  /\/\  →  /\/\/\  →  /\/\/\  →  /\/\/\  →

                /\         /\
     --         --         --
    /\/\       /\/\       /\/\
    ----       ----       ----
→  /\/\/\  →  /\/\/\  →  /\/\/\/\  →  ...

So you start with a single-storey house, then build the adjacent group, then put the bridge card, then build the group in the second floor, then start building groups and bridges from the first floor diagonally to reach the third floor, and so on.
A single card will be represented with a /, a \ or a --. If after using as many cards as possible you have one card left, just output what you have accomplished so far (see example for 3 cards, the result is the same as for 2 cards). The only exception is the case of 1 card, that must output a flat card.
Examples:
Input: 1
Output:

--

Input: 2
Output:

/\

Input: 3
Output:

/\

Input: 5
Output:

 --
/\/\

Input: 10
Output:

 /\
 ----
/\/\/\

Input: 20
Output:

  /\
  --
 /\/\/\
 ------
/\/\/\/\

Input: 39
Output:

    --
   /\/\
   ----
  /\/\/\
  ------
 /\/\/\/\
 --------
/\/\/\/\/\

Input: 40
Output:

    /\
    --
   /\/\
   ----
  /\/\/\
  ------
 /\/\/\/\
 --------
/\/\/\/\/\

Input can be numeric or a string, and will always be a positive integer. Output must be exactly as shown, with leading and trailing spaces and newlines allowed.
This is code-golf, so may the shortest program/function for each language win!

This comes from the sandbox.

It's an interesting challenge but personally I think you should have waited a bit longer, maybe a day, between posting them.

@cairdcoinheringaahing I admit that I did not know how much time I should have waited between both posts. It's been a while since the last answer for version 1, so I supposed I could post it now (24 hours after). Thanks for your advice, I'll bear that in mind next time.

Surely /\\ is a tallest possible house with 5 cards?

@PeterTaylor no, it isn't. It's /\/\\ with a bridge card over them.

If the width of a bridge card is nonzero, shouldn't the output for 1 card be a flat card?

@PeterTaylor I didn't think of that, that's a good point. Question updated.

I think half of the test cases are now wrong, because they're not taking into account the possibility of putting a flat layer on the bottom. The sandbox doesn't really work unless you leave a question in there for a few days so that people have time to comment. (And for "part 2"s it's important to make it clear that it's a part 2 so that people don't think it's part 1 and they've already seen it).

@PeterTaylor well, that's why I added an explanation about the way how houses of cards are built. So when I say "the tallest house of cards" I mean "the tallest you can following the building way I mention further in the question". The case of having only one card was a particular case I did not think of before, but I'll leave the rest of test cases as they are.

I have reworded the question hoping it is now clearer that the building order is more important than just "build it as tall as you can".

But with 3 cards, wouldn't it be /\--, seeing as how one card is simply --?

Charcoal, 67 bytes
Ｎθ⁼θ¹Ａ²ηＷ¬‹θη«←÷η³↓→/…\/÷η³↙Ａ⁻θηθＡ⁺³ηη»‖ＭＭ÷η³→Ｆθ≡﹪ι³¦¹«↗←\/»²«↑Ｐ²»«

Try it online! Note: The latest version of Charcoal doesn't need the »« for -2 bytes. Explanation:
Ｎθ

Read the input as an integer into θ.
⁼θ¹

Special case: if the input is 1, print a -.
Ａ²ηＷ¬‹θη«

η represents the number of cards needed to build the next layer, initially 2. A while loop repeats as long as there are enough cards for the layer.
←÷η³↓→/…\/÷η³↙

Print the left half of the next layer. (I wanted to print the right half, but I couldn't get it to reflect properly for some reason.) The number of -s is one third of the number of cards in the layer, rounded down. (See also my answer to part 1.)
Ａ⁻θηθＡ⁺³ηη»

Subtract the number of cards from the input number, and add three cards to the number required for the next layer.
‖Ｍ

Mirror the house so far. (This also turns the - into -- for the case of 1 card.)
Ｍ÷η³→

Move the cursor to the right of the house.
Ｆθ

Repeat for each remaining card (if any).
≡﹪ι³¦

If the card modulo 3 is:
¹«↗←\/»

1, then print a pair of cards;
²«↑Ｐ²»

2, then print a horizontal card;
«

Otherwise skip the card (because a pair is needed at this point).

Very nice answer! Did you start to write it before I changed the case of 1 card? That case must output -- (a flat card), but if you started your program before I changed that requirement I'll skip that...

@CarlosAlejo No, I'd just forgotten about that case. Sorry about that. Fixed now.

@Neil are you sure you didn't make charcoal? Cause I'm starting to not believe you.

@MagicOctopusUrn D: hey (but yeah Neil's Charcoal skills are amazing, probably even better than mine haha)

Oops sorry, will be fixed in next commit

@ASCII-only I see that the »« is no longer necessary in succinct mode, thanks, but I still can't get Verbose mode to accept a switch...

Python 2, 167 182 bytes
167 bytes
f=lambda x,y=0:y<x<2and"--"or~-x>y*3and f(x-2-y*3,y+1)or d(y,x)
d=lambda h,r,v=0:h and d(~-h,max(r-3,1),-~v)+" "*-~v+"--"*(h-(r<3))+"\n"+" "*v+"/\\"*(h+(r>1))+"\n"or""

182 bytes
f=lambda x,y=0:[x>1+y*3and f(x-2-y*3,y+1)or d(y,x),"--"][2>x>y]
d=lambda h,r,v=0:d(h-1,r-3*(r>2)-2*(r==2),v+1)+" "*(v+1)+"--"*(h-1+(r>2))+"\n"+" "*v+"/\\"*(h+(r>1))+"\n"if h+r else""

Explanation (167-byte version)
f=lambda x,y=0:
    "--" if y<x<2         # handle case where x is 1 on step 0 (only one card)
    else f(x-2-y*3,y+1)   # recursive call with one full triangular level accounted for
    if x>= 2+y*3          # one full level requires 2+3y cards (2, 7, 15...)
    else d(y,x)           # if no more full levels can be constructed, draw
d=lambda h,r,v=0:         # (h)eight to draw, (r)emaining cards, (v)ertical height already drawn (to determine leading white space)
    d(h-1,          ,v+1) # recursive call to draw upper lines
          max(r-3,1)      # subtract remainder cards used in this iteration
    +" "*(v+1)            # leading whitespace for -- row
    +"--"*(       )+"\n"  # -- line.
           h-(r<3)        # horizontal card count is equal to the remaining count of levels to draw, minus 1,
                          # ...plus 1 if there are at least three remaining cards to add to the right
    +" "*v                # leading whitespace for /\ row
    +"/\\"*(       )+"\n" # /\ line
            h+(r>1)       # vertical card pair count equals remaining level count
                          # ...plus 1 if there are at least two extra cards
    if h                  # return above is there are levels to draw (h)
    else ""               # else return nothing (ends recursion)

Try it online!

This feels unnecessarily long, but I can't see anything to remove at the moment...feel free to comment any suggestions

Thank you very much for you answer, but your examples do not match the test cases, you put more cards in your houses than you have. For instance, in the case of 7 cards you can build a house with 4 cards on the first floor, a bridge card and 2 more cards on the second floor. But you show a house with 10 cards (6 cards in the first floow and 2 bridge cards). Check the examples and the way the houses are built.

Let us continue this discussion in chat.

If you want to separate the sections of code that directly follow one another you can do so by using the
...
 tags around your code individual blocks rather indenting 4 spaces

@TaylorScott I tried changing to ... but it seemed to cancel the language-all: python tag's effect. Highlighting went haywire, spacing was ruined, random italics entered the code, and, most confusingly, some chains of characters were swapped between code blocks...? I did manage to reformat the post, though, with 4-space indents mixed with no indent lines. Hopefully this is easier to read.

Just to follow up with this, the lines you would need to use to separate the code would look something like
f=lambda ... #function 1, d=lambda ...,

,
f=lambda ... #function 2, d=lambda ...,

 (where the lines are comma delineated) and note that you will have to wait a short period of time for the language flag to update the highlighting (approx 5-10 seconds after you have stopped typing edits)

@TaylorScott unless you mean to actually put commas into the code (and I don't think that's what you mean), that's exactly how I tried to do it...
I waited for code highlighting, and when it kicked in, everything went crazy. It seemed to 'forget' that it was looking at Python, and formatted it for C? Maybe Java?
I invite you to suggest an edit if you think it would improve readability, or if you're inclined to show me how it works. If it's just a matter of ease-of-input, the indents don't particularly bother me (in Python, they come with the territory as it is...).

I see what has happened: for some reason when you are using the
 tags it is capturing <3))+"\n"+" "*v+"/\\"*(h+(r> as another tag and not displaying that region of the solution. Perhaps someone in the community who understands this a little better could inform us as how to avoid that... but aside from that your current formatting is perfectly readable and therefore negates the need for this type of formatting all together

@TaylorScott A little late but you can fix it by replacing them with HTML entities: < for < and > for >

Perl 5, 129 bytes
@r=($_=<>-2)<0?'--':'/\\';while($_>1){$#r+=2;$i=0;$r[$i].=$i++%2?'--':'/\\'while$i<@r&&($_-=2-$i%2)>=0}say$"x(@r/2).pop@r while@r

Try it online!

source: Stack Exchange

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

sort: votes


text:
The Original Number
Guidelines
Scenario
John has an important number, and he doesn't want others to see it.
He decided to encrypt the number, using the following steps:
His number is always a non-decreasing sequence (ie. "1123")
He converted each digit into English words. (ie. "123" -> "ONETWOTHREE")
And then, rearrange the letters randomly. (ie. "ONETWOTHREE" -> "ENOWTOHEETR")
John felt that his number were safe in doing so. In fact, such encryption can be easily decrypted :(

Task
Given the encrypted string s, your task is to decrypt it and return the original number.

Rules

This is code golf, so the shortest answer in bytes wins
You can assume that the input string is always valid
The input string only contains uppercase letters
The original numbers are always arranged in ascending order
You may return the number in string or integer format
The letters will only be shuffled between one word, not between the whole string.
The numbers will only be from 1 to 9 inclusive (ONE to NINE)

Possible Unscrambled String
Here is a list of the strings just after they have been converted to strings from the numbers:
 1 -> ONE
 2 -> TWO
 3 -> THREE
 4 -> FOUR
 5 -> FIVE
 6 -> SIX
 7 -> SEVEN
 8 -> EIGHT
 9 -> NINE

Examples
"NEO" -> 1
"ENOWOT" -> 12
"EONOTWHTERE" -> 123
"SNVEEGHEITNEIN" -> 789
"ENOOWTEERHTRUOFEVIFXISNEVESTHGIEENIN" -> 123456789
"NOEWOTTOWHEERT" -> 1223

What does "non strict" mean in "his number is always a non strict increasing sequence"?

Can you add even more complicated test cases?

@ TessellatingHeckler : A non-strictly increasing sequence is when the next number can be the same as the previous ex. 1-1-1-2-2-3 (non-strictly increasing) as opposed to 1-2-3-4-5 (strictly increasing)

Technically speaking, this is an encoding, not encryption, since there is no key.

You should include at least one example with digits appearing more than once.

@MagicOctopusUrn That number isn't a non-decreasing sequence.  Therefore it is not a valid input

@PunPun1000 ahhh! Yes! Okay, I wondered why the spec was so loose; was just me being dumb. We do have ONE answer that actually works on it though.

It would be interesting to have a version of this challenge where it is allowed to shuffle letters throughout the entire string.

Jelly,  38  37 bytes
ḟ“RGS”O“OX‘,“¢©“¢¢¤‘yF×4/%74ị⁽G×œ?9¤Ḍ

A monadic link taking a list of characters (the string) and returning an integer.
Try it online!
Uses a very different method to Pietu1998's Jelly answer, yet has the same byte count (I really thought it might it did end up as less)!
Does not rely on the monotonicity of the original number (so an input of HTREEWTONOE would work for example).
How?
First note that the words themselves (and therefore any anagrams thereof) can all be changed to ones of length 4 by removing any Rs, Gs and Ss and replacing any Os with two characters (say "12") and any Xs with three characters (say "345").
letters  -> -RGS  -> O:12, X:345
ONE         ONE      12NE
TWO         TWO      TW12
THREE       THEE     THEE
FOUR        FOU      F12U
FIVE        FIVE     FIVE
SIX         IX       I345
SEVEN       EVEN     EVEN
EIGHT       EIHT     EIHT
NINE        NINE     NINE

We may then map the product of the ordinals of those characters to the numbers 1 to 9 using modulo arithmetic, depending upon our choice (the "12345"), then look these up in a reordered list of the digits. The code actually casts to characters first and then replaces the ordinals, but it is also possible in 37 bytes with characters, e.g. "DIAAE" (try it).
ḟ“RGS”O“OX‘,“¢©“¢¢¤‘yF×4/%74ị⁽G×œ?9¤Ḍ - link: list of characters
 “RGS”                                - literal ['R','G','S']
ḟ                                     - filter discard
      O                               - convert to ordinals
       “OX‘                           - code-page indices list = [79,88]
            “¢©“¢¢¤‘                  - code-page indices lists = [[1,6],[1,1,3]]
           ,                          - pair -> [[79,88],[[1,6],[1,1,3]]]
                    y                 - translate (replace 79s (Os) with [1,6]
                                                       and 88s (Xs) with [1,1,3])
                     F                - flatten into a single list
                       4/             - 4-wise reduce by:
                      ×               -   multiplication (product of each window of four)
                         %74          - modulo 74
                                   ¤  - nilad followed by link(s) as a nilad:
                             ⁽G×      -   base 250 literal = 18768
                                œ?9   -   permutation of [1,2,3,4,5,6,7,8,9] at that
                                      -   index in a lexicographically sorted list of
                                      -   all such permutations -> [1,5,8,2,4,9,7,6,3]
                            ị         - index into
                                    Ḍ - convert from decimal digits to an integer

Another 37
42BĖZ“Øȧɲ“Pt’żḥ€⁸*/)⁸xO×⁵/%⁽R1%⁽©v%⁵Ḍ

Try it online!
This one repeats characters such that any* shuffled number name becomes length ten:

characters
repeat

G R S T U V
1

H N
2

E F I
3

W
4

O
5

X
6

e.g:
ONE    => OOOOONNEEE
TWO    => TWWWWOOOOO
THREE  => THHREEEEEE
OURF   => OOOOOURFFF
EVIF   => EEEVIIIFFF
IXS    => IIIXXXXXXS
VENES  => VEEENNEEES
GHIET  => GHHIIIEEET
NINE   => NNIIINNEEE
WOTISX => WWWWOOOOOTIIISXXXXXX

Then takes the products of the ordinals of length ten slices and performs a modulo chain to map these to \$[1,9]\$ appropriately.
* The repetition part works for "ZERO" too -> "ZEEEROOOOO" as 'Z' will also repeat once.

Your answer is literally the only answer on this page that returns a correct value for: NINEONENIENOENNNIENOENNEINEONEINEONNENIENOINNEINENINNEINENIENNIENNNNIENNEININENIENNENINEINENINENNIEINNEINNENNIENIN.

+Infinity points.

Thanks! (that threw me because there are zero width spaces to the code block in the comment, but (whew) it does work)

It's not a valid input anyway ;).

Oh wow, I didn't know a bounty was coming - thanks! Yeah, it was not part of the requested spec, I just made a method that would work with unordered input.

@Amorris - if you are accepting with the green check mark I believe it should rightly go to Magic Octopus' answer, although of course as the question asker it is your prerogative to choose.

@Amorris ...although having said that I spotted a bug in that entry :(

The string WWWWOOOOOT perfectly describes my feelings when reading this answer.

Python 2, 121 117 115 bytes
def g(s,a=0,f=''):
 for c in s:
    a+=34**ord(c)%43;r='P!\x83u\x8eI\x92|Z'.find(chr(a))+1
    if r:f,a=f+`r`,0
 return f

-4 bytes: After all that golfing I forgot to inline a single-use variable. Brain fart.
-2 bytes: Double-spaced indent → single tab indent (thanks to Coty Johnathan Saxman); note that this does not display correctly in the answer.
Ungolfed (compatible with python 3):
nums = [80, 33, 131, 117, 142, 73, 146, 124, 90]

def decode(str):
    acc = 0
    final = ''
    for c in str:
        acc += (34**ord(c))%43
        if acc in nums:
            final += str(1+nums.index(acc))
            acc=0
    return final

Magic number finder:
#!/usr/bin/env python3
from itertools import count, permutations

def cumul(x):
    s = 0
    for v in x:
        s += v
        yield s

all_words = 'ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE'.split()

for modulo in range(1, 1000):
    for power in range(1, 300):
        combinations = []
        for word in all_words:
            my_combination = []
            for perm in permutations(word):
                my_combination += cumul(power**(ord(x)) % modulo for x in perm)
            combinations.append(my_combination)

        past_combinations = set(())
        past_intermediates = set(())
        collision = False
        for combination in combinations:
            final = combination[-1]
            if final in past_intermediates or any(intermediate in past_combinations for intermediate in combination):
                collision = True
                break
            past_combinations.add(final)
            past_intermediates.update(combination)

        if not collision:
            print("Good params:", power, modulo)
            print("Results:", ", ".join(str(x[-1]) for x in combinations))

Explanation:
I had a feeling that I could smash the ASCII bits together and sum them up somehow to determine when I had a full word. Originally I tried messing with 3**ord(letter) and comparing to expected results, but it resulted in some very large numbers. I though it would be appropriate to brute-force some parameters a little, namely modulus (to ensure the numbers are small) and a multiplier to disperse the numbers differently around the range of the modulus.
I ended up changing the multiplier variable into a variable affecting the power itself because (from trial and error) that somehow managed to give me a slightly shorter golfed answer.
And above you see the results of that brute-forcing and a little manual golfing.
The reason for choosing 3**x originally is because I knew you could represent every number there. The most repeated digits any number had is two (thrEE, sEvEn, NiNe, etc), so I decided to think of every input as a base-3 number. That way I could (mentally) represent them as something like 10100000000010020000 (three; a 1 in the t slot, a 1 in the r slot, a 1 in the h slot, and a 2 in the e slot). Each number this way gets a unique representation which can be easily pieced together by iterating the string and summing some numbers, and it ends up independent of the actual order of the letters. Of course, this didn't turn out to be the ideal solution, but the current solution is still written with this idea in mind.

What's Py3K?...

Apologies, edited (it's the former name of python 3)

It's cheap, but you can save 2 bytes (since this is python 2) by subbing your second indentation level (two spaces) for a single tab. [https://tio.run/##NU7NCoJAGDy7T/ElhK5KmHooY49SXiQoOpSBoru5l1U@FQx6d1uDLgPzw8x076FpVTDPNRfwsnuvZL4nmGXRmIBoESqQCvqYGKXLwshxWqztiq6j8IDMOq/yaReOGniaT/vgc7c2QiqdaNAuKXW3xJACMBa6V7gFFp5PAPkwogIx//rLni8TUnXjYOtVo0OpBjBzlSvT@/nEQN4D0/8WRv8RLc4P85ZkyeV4PaVJkmWp@fwC Try it online!]

Also, you might be able to save 6 bytes using literal \x83, \x8e, and \x92 in the string.

@CalculatorFeline Unfortunately my interpreter doesn't like that: SyntaxError: Non-ASCII character '\xc2' in file <stdin> on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details. It works if I put the coding comment up there, but that gains 15 extra bytes.

112 bytes as a full program in either Python 2 or Python 3

Python 2,131 127 bytes
s=input()
for y in'WXGURFSOIZ':vars()[y]=s.count(y)
while Z<9:s+=[O-U-W,W,R-U,U,F-U,X,S-X,G,I-X-G-F+U][Z]*str(Z+1);Z+=1
print s

Try it online!
Based on a corrected version of the JavaScript Draco18s solution.

What an interesting use of vars!

@xnor it was ovs how learned me that for other golfs :)))

Very clever. Have a +1 for adapting my answer (as flawed as it was originally).

C# (.NET Core), 234 bytes
string q(string s){string[]n="ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE".Split(',');var r="";int x=0,i=0,j;try{for(;;)for (j=x;;)if(n[i].IndexOf(s[j])>=0){if(++j==n[i].Length+x){r+=i+1;x=j;break;}}else{i++;break;}}catch{}return r;}

Try it online!
Expanded version:
static string q(string s)
{
    string[] n = "ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE".Split(',');
    var r = "";
    int x = 0, i = 0, j = 0;
    try
    {
        for(;;)
            for (j = x; ;)
                if (n[i].IndexOf(s[j]) >= 0)
                {
                    if (++j == n[i].Length + x)
                    {
                        r += i + 1; x = j;
                        break;
                    }
                }
                else
                {
                    i++;
                    break;
                }
    }
    catch { }
    return r;
}

Being my first entry, I'm uncertain about the rules... I'm only counting the size of the class used to de-crypt, not the code that tests it, right?
Edit
And for the fun of it - here's what I started doing, not reading the complete rules :S - See it at IdeOne. It de-crypts even when characters from one digit can be scrambled to any place in the string.
Edit 2
Shortened according to tips by TheLethalCoder. Thanks!
Edit 3
And now Titus shaved of a few more bytes. Thanks!
Edit 4 Six years later :D
As Magic Octopus Urn commented, this wasn't working in all cases. Had to add a few bytes to make it work :(
Using try/catch I can ignore boundary checks and save a few bytes :P

Hello and welcome to PPCG! You only need to include the method, you can remove public static from it to. You can convert to an anonymous method like s=>{<do stuff>return"";}. You can use var a few times, declaring variables together saves bytes i.e. int i=1,j;. Creating an array from a string and splitting on it is usually shorter (though I haven't checked in this case) i.e. "ONE|TWO".Split('|'). You can use <0 instead of ==-1

For more [tag:tips] see Tips for code-golfing in C#.

@TheLethalCoder Great tips, thanks!

Not tested at all but I believe the following is the equivalent of your code for 221 bytes: s=>{var n="ONE|TWO|THREE|FOUR|FIVE|SIX|SEVEN|EIGHT|NINE".Split('|');for(int i=0,j;++i<= 9;)for(j=0;n[i-1].IndexOf(s[j])<0;){if(++j==n[i-1].Length){var r=i+"";while(j<s.Length){j+=n[i].Length;r+=++i;}return r;}}return "";}

On a side note it is usually easier to use TIO for your TIO's!

Your code appears to be 259 bytes.

Welcome! Try for(j=0;n[i].IndexOf(s[j])>=0;) (or similar; your short code doesn´t seem to match the expanded version), saving 5 bytes. If that also saves braces, so will for(;j<s.Length;r+=++i;)j+=n[i].Length;.

On a side note, if the code in your first edit is shorter than the code you provided, you should use that one. It will work even when it is only scrambled throughout the word, too.

@CalculatorFeline Really? How is that?

@Titus Thanks! Great tips. (It strange when you get something pointed out how obvious it sometimes seems. :)

On Revision 5 you forgot to update the code.

@CalculatorFeline Ahh... I see. Sorry!

This outputs 123 for NOENEIN.

210 bytes

PHP, 164 bytes
for($c=count_chars($argn);$i<9;)echo str_pad("",[$c[79]-$c[87]-$u=$c[85],$c[87],$c[72]-$g=$c[71],$u,$f=$c[70]-$u,$x=$c[88],$c[86]-$f,$g,$c[73]-$x-$f-$g][+$i],++$i);

Try it online!
PHP, 179 bytes
based on the previous approach check first the even numbers and then the odd numbers in increasing order

for($z=[$o=($c=count_chars($argn))[87],$f=$c[85],$x=$c[88],$g=$c[71],$c[79]-$o-$f,$c[72]-$g,$v=$c[70]-$f,$c[86]-$v,$c[73]-$x-$v-$g];$i<9;)echo str_repeat(++$i,$z[_405162738[$i]]);

Try it online!
PHP, 201 bytes
for(;$o=ord(WUXGOHFVN[$i]);$i++)for(;$r[$o]<count_chars($argn)[$o];$t[]=$i>3?2*$i-7:2+2*$i,sort($t))for(++$r[$o],$n=0;$q=ord(([TO,ORF,IS,HEIT,EN,TREE,IVE,SEEN,NIE][+$i])[$n++]);)$r[$q]++;echo join($t);

Try it online!

fails for ENOOWTWTOWOT

@Titus is now fixed. I have misunderstand the question

Yea the examples are somewhat misleading. Wow that did cost! Would you break that down?!

@Titus I think I have reach the limit to find another way as your approach

$i++<9 and $i instead of $i<10 and ++$i (-1 byte); _405162738[$i] instead of $i%2?$i/2+4:$i/2-1 (-4 bytes) ($i/2+~($i%2*-5) would work too, but that´s one byte longer.)

Why all the indexing? Watch these 165 bytes: for($c=count_chars($argn);$i++<9;)echo str_repeat($i,[0,$c[79]-$c[87]-$u=$c[85],$c[87],$c[72]-$g=$c[71],$u,$f=$c[70]-$u,$x=$c[88],$c[86]-$f,$g,$c[73]-$x-$g-$f][$i]);

@Titus not enough thinking of it

How come your answer has 3 votes and mine has none although you have no explanation at all? Smells funny.

@Titus I think it is a give and take like in life You have vote 238 times other questions or answers. The votes are not important in my opinion. A long solution is better as no solution. And if somebody ask for an explanation I can add it. The sense of PPCG is vote for good answers/questions and not reach the most votes. Sometimes I reach a nice answer bagde and I am happy about it. But I think I will never reach the next step.

Javascript (ES6), 288 150 144 bytes

q=s=>[u=(l=t=>s.split(t).length-1)`U`,l`O`-l`W`-u,l`W`,l`R`-w,u,f=l`F`-u,x=l`X`,l`S`-x,g=l`G`,l`I`-x-g-f].map((n,i)=>`${i}`.repeat(i&&n)).join``

const testCases = ['NEO', 'ENOWOT', 'EONOTWHTERE', 'SNVEEGHEITNEIN', 'ENOOWTEERHTRUOFEVIFXISNEVESTHGIEENIN']

testCases.forEach(testCase => console.log(testCase, q(testCase)))

Longer than the other two one of the other JS entries, but I thought I'd drop an interesting approach that might work for someone in another language.
Essentially we can determine the following:
W -> 2
X -> 6
G -> 8
U -> 4

Any occurrence of these letters implies that that digit exists in the original number. From here we can deduce the rest of the digits:
R-U -> 3
F-U -> 5
S-X -> 7

Including the two complicated cases:
O-(U+W) -> 1
I-(X+G+(F-U)) -> 9

Both 1 and 9 area Hard comparatively. For ONE, E shows up more than once in some words (SEVEN has two) as does N (NINE), so we're stuck with checking for O which occurs in two other places, fortunately both are simple.
For NINE, nine is hard no matter how you slice it.
Thus we end up with this map:
[u=(l=t=>s.split(t).length-1)`U`,  //unused 0; precompute 'U's
 l`O`-l`W`-u,    //1
 l`W`,           //2
 l`R`-w,         //3
 u,              //4
 f=l`F`-u,       //5
 x=l`X`,         //6
 l`S`-x,         //7
 g=l`G`,         //8
 l`I`-x-g-f]     //9

9 is able to back-reference siX, eiGht, and Five (with 5 back-referencing foUr) with the variable assignments, saving bytes.  Thanks to Neil for this, it uses several features of JS I am very unfamiliar with (the back-ticks for stripping (' in half, for instance) and actually comes much closer to the idea I'd doodled out on paper before attempting to code it (I'd left 9 as "what's left over", thinking about it as "if I see an X I can remove it and an S and I from the string, then..." so that after the four simple cases the next 3 would become simple).
The reason this entry is interesting is because it can handle any shuffled string as input. i.e. rather than the individual words being shuffled, we can shuffle the whole string, which is what I thought John was doing originally:

q=s=>[u=(l=t=>s.split(t).length-1)`U`,l`O`-l`W`-u,l`W`,l`R`-w,u,f=l`F`-u,x=l`X`,l`S`-x,g=l`G`,l`I`-x-g-f].map((n,i)=>`${i}`.repeat(i&&n)).join``

const testCases = ['XENSENINEVSI']

testCases.forEach(testCase => console.log(testCase, q(testCase)))

Great, but there is a problem with counting 9... I think it may be i-x-g-f+u

@mdahmoune Shoot, you're right. I messed that one up. :<

Save 4 bytes by using s.split(t).length-1, 2 bytes using s.repeat(n>0&&n) (why is n less than zero anyway? saves 7 bytes). Save a bunch of bytes by declaring g in the scope of s so that you don't have to keep passing it all the time, and better still you can make it a tagged template, which saves 55 bytes in total (before 9 correction). Save more bytes by saving repeated values in temporaries, and I shaved a few more off using map: s=>[,(l=t=>s.split(t).length-1)`O`-l`W`-l`U`,w=l`W`,l`R`-w,u=l`U`,l`F`-u,x=l`X`,l`S`-x,g=l`G`,l`I`-x-g].map((n,i)=>`${i}`.repeat(n)).join`` .

@Neil I am not sure why N ever ended up less than zero, but it did when testing for THREE. I kept getting an error and investigating I found that it was needed, but I'm still not sure. The templated library map you've got there is javascript I don't even know how to read. :D

@Neil Ah, right, the reason for checking n > 0: If there is a TWO but no THREE.  R = 0, W = 1.  0-1 = -1. I was having trouble figuring that out an hour ago, I knew that it was related to the 3-check, but was having a devil of a time working it out (lack of coffee).

@mdahmoune I hadn't last night as I hadn't the time to do so, I was only able to make the comment. The answer has been updated now though. :)

Ah, that's the problem - the 3s are given by R - U, not R - W. Given that, you use U enough times to make it worth while computing in advance: s=>[u=(l=t=>s.split(t).length-1)`U`,l`O`-l`W`-u,l`W`,l`R`-w,u,f=l`F`-u,x=l`X`,l`S`-x,g=l`G`,l`I`-x-g-f].map((n,i)=>`${i}`.repeat(i&&n)).join``

In fact @mdahmoune already corrected that one too in his version...

@Neil Can I blame coffee or the lack thereof? I'm not sure. I swear I double-checked them all. @..@ Nine I know I checked three times and still messed that up. Thanks.

Mathematica, 133 bytes
(s={};c=Characters;j=c@#;Table[If[FreeQ[j~Count~#&/@c[#[[i]]]&@ToUpperCase@IntegerName@Range@9,0],s~AppendTo~i],{i,9}];FromDigits@s)&

input

"VENESGTHIEENNI"

output

789

Could you save an extra byte with c@#[[i]] instead of c[#[[i]]]? You might be able to save another byte by using infix syntax ~ on the Table.

Retina, 88 bytes
[EFIST]

^(ON|NO)*
$#1$*1
O

W
2
HR|RH
3
UR|RU
4
X
6
GH|HG
8
(NN)*$
$#1$*9
r`NV|VN
7
V
5

Try it online!
Explanation

First, drop a bunch of unnecessary characters not needed for distinctness
Pick the 1s off the front (this lets us drop the rest of the Os immediately after and clears up some Ns before we get to the 5, 7, 9 mess)
2, 3, 4, 6, and 8 are now trivial
9s are a double NN, so grab those off the end before we deal with 5 and 7
Replace 7s from the right (so we don't reduce VNV to 75 instead of 57)
5s are the remaining Vs

If you add %(G` to the header, you can use the original code and it will evaluate each line of the input separately:  TIO

Thanks @PunPun1000. I figured there must be a way to do that but gave up after not finding it quickly.

JavaScript (ES6), 142 139 Bytes
Saved 3 Bytes thanks to Neil.
Doesn't currently take advantage of numbers are always arranged in ascending order
f=s=>s?'ENO|OTW|EEHRT|FORU|EFIV|ISX|EENSV|EGHIT|EINN'.split`|`.findIndex(w=>[...s.slice(0,y=w.length)].sort().join``==w)+1+f(s.slice(y)):''

f=s=>s?'ENO|OTW|EEHRT|FORU|EFIV|ISX|EENSV|EGHIT|EINN'.split`|`.findIndex(w=>[...s.slice(0,y=w.length)].sort().join``==w)+1+f(s.slice(y)):''

const testCases = ['NEO', 'ENOWOT', 'EONOTWHTERE', 'SNVEEGHEITNEIN', 'ENOOWTEERHTRUOFEVIFXISNEVESTHGIEENIN']

testCases.forEach(testCase => console.log(testCase, f(testCase)))

wait what?? "axbxc".split\x`.join```. How is this called? Can't seem to find anything on google.

@Qwerty - They are tagged template literals, an ES6 feature which I'm using to save a few bytes by not needing parens in the case of split and join

You answered it. I know tagged template literals, but I haven't realised you can use it on these functions as well. Thank you.

They're a little different, you have template literals (e.g. x=\foo${5+5}bar`), they're tagged when you call a function using them without parens: foo`foo${5+5}bar`which is the same asfoo(['foo','bar'], 10)`

f(s.slice(y)) is always a string so you don't need the ''+ before it.

Jelly, 38 bytes
Dị“©ȯ¿w¶&ÇhṆỌƘ#Ȯʋ~¢CNẓ_»Ḳ¤FṢŒu
L3*Ç€iṢ

Try it online!
Explanation
L3*Ç€iṢ    Main link. Argument: s (string)
L            Get length of s.
 3*          Raise 3 to that power. This will always be greater than n.
   Ç€        Get the name of each of the numbers using the helper link.
     iṢ      Find the position of the sorted input.

Dị“©ȯ¿w¶&ÇhṆỌƘ#Ȯʋ~¢CNẓ_»Ḳ¤FṢŒu    Helper link. Argument: n (number)
D                                   Get digits of n.
  “©ȯ¿w¶&ÇhṆỌƘ#Ȯʋ~¢CNẓ_»            The string "one two (...) eight nine AA".
                        Ḳ           Split that string at spaces.
 ị                                  Get name of each digit in the list.
                          F         Flatten to a single string.
                           Ṣ        Sort the characters.
                            Œu      Make uppercase.

There is an issue with your code. Try passing the string "EIGHTNINE" into it :)

@Amorris fixed for 0 bytes.

I think it doesn't work for "VENESGTHIEENNI"

I second @Jenny_mathy

@Jenny_mathy The program is very inefficient and runs out of time and memory for long inputs (I know, it's really bad). You can replace the 3 with 2.2 to use a smaller upper bound, which allows you to easily calculate 789 without changing the working principle. 2 would be nice, but it would barely fail for certain inputs with lots of sixes.

Javascript (ES6), 221 bytes
s=>(m=btoa`8Ñ>Mc¾LtDáNQ!Q>HþHA7átþ4Ò`.split`+`.map(s=>RegExp(s.replace(/(.)\1*/g,c=>`(?=(.*${c[0]}){${c.length}})`))),t=0,r=0,[...s].map(c=>(t+=c,d=1,n=0,m.map((r,i)=>t.match(r)&&(d--,n=i)),d||(r=r*10+n+1,t=0))),r)

Example code snippet:

f=

s=>(m=btoa`8Ñ>Mc¾LtDáNQ!Q>HþHA7átþ4Ò`.split`+`.map(s=>RegExp(s.replace(/(.)\1*/g,c=>`(?=(.*${c[0]}){${c.length}})`))),t=0,r=0,[...s].map(c=>(t+=c,d=1,n=0,m.map((r,i)=>t.match(r)&&(d--,n=i)),d||(r=r*10+n+1,t=0))),r)

console.log(f("NEO"))
console.log(f("ENOWOT"))
console.log(f("EONOTWHTERE"))
console.log(f("SNVEEGHEITNEIN"))
console.log(f("ENOOWTEERHTRUOFEVIFXISNEVESTHGIEENIN"))

Retina, 160 bytes
([ONE]{3})*([TWO]{3})*([THRE]{5})*([FOUR]{4})*([FIVE]{4})*([SIX]{3})*([SEVN]{5})*([EIGHT]{5})*([NIE]{4})*
$#1$*1$#2$*2$#3$*3$#4$*4$#5$*5$#6$*6$#7$*7$#8$*8$#9$*9

Try it online! Loosely based on @TessellatingHeckler's PowerShell answer.

Perl 5, 102 + 1 (-n) = 103 bytes
for$i(map{"[$_]{".length.'}'}ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE){$,++;print$,while(s/^$i//)}

Try it online!

Nice! Couple of tricks that help: map{...} can often be replaced with map...,, length and y///c are usually interchangeable too (not always smaller when not working on $_ though!), instead of the while, ++$,x s/^$i// is shorter, and if you change -n to -p you can append to $\ instead of calling print! Try it online!

Also, I hope you don't mind me posting any advice, if you'd prefer I'll refrain. :)

C++, 296, 288 bytes
Short Version:
#define T string
using namespace std;T N[]={"ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE"};T Q(T S){T R="";for(int i=0;i<9;i++){do{if(S.find(N[i])!=T::npos){S.erase(S.find(N[i]),N[i].size());R+=to_string(i+1);}}while(next_permutation(N[i].begin(),N[i].end()));}return R;}

Full Version:
#define T string
using namespace std;

T N[]={"ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE"};

T Q(T S)
{
    T R="";
    for(int i=0;i<9;i++)                             //for all possible
                                                     //codewords (ONE,TWO...NINE)
    {
        do
        {
            if(S.find(N[i])!=T::npos)                //if found in encrypted word
            {
                S.erase(S.find(N[i]),N[i].size());  //erase it from the word
                R+=to_string(i+1);                  //save integer to the result string
            }
                                                    //check next permuation of codeword

        } while(next_permutation(N[i].begin(),N[i].end()));
    }

    return R;
}

Try ONLINE!
Edit:
1) 200->296 bytes, for including namespace and definition of N in the count, as suggested by orlp
2) 296->288, for using macro, thanks to Zacharý

You need to include the definition of N and using namespace std; into your byte count.

I should be more specific, not just include it in your byte count but also into your answer. Your answer must be able to run just by calling Q right after it without any other additions.

I re-edited to include it all. For the definition of N i was not sure myself, but for the namespace, I usually dont include it (treat it as library stuff). Though, in the current code it is crucial for the string to work

Can you define a macro to save a few bytes?
https://repl.it/JY7k

PowerShell, 182 bytes
[regex]::Replace("$args",'(?<1>[ONE]{3z2>[TWO]{3z3>[THRE]{5z4>[FOUR]{4z5>[FIVE]{4z6>[SIX]{3z7>[SVEN]{5z8>[EIGHT]{5z9>[NIE]{4})'.replace('z','})|(?<'),{$args.groups.captures[1].name})

Try it online!
Ungolfed but not working code:
[System.Text.RegularExpressions.Regex]::Replace("$args",

    '(?<1>[ONE]{3})
    |(?<2>[TWO]{3})
    |(?<3>[THRE]{5})
    |(?<4>[FOUR]{4})
    |(?<5>[FIVE]{4})
    |(?<6>[SIX]{3})
    |(?<7>[SVEN]{5})
    |(?<8>[EIGHT]{5})
    |(?<9>[NIE]{4})'

    ,{$args.groups.captures[1].name}
)

e.g. (?<3>[THRE]{5}) matches the character class THRE, so it can match them out of order, and has to match any of these characters five times next to each other, and the capture group is named '3' to map names with numbers.
Rudimentary compression by swapping the repeating text })|(?< for a z.

Java 8, 198 256 bytes
s->{String r="",x=r;for(String n:"ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE".split(" ")){for(char c:n.toCharArray())x+="(?=.*"+c+")";x+="["+n+"]{"+n.length()+"}x";}for(int i=0,q;i<9;)for(q=(s+" ").split(x.split("x")[i++]).length-1;q-->0;)r+=i;return r;}

+58 bytes.. due to regex of the previous version not working properly (it was also matching "EEE";"EEN";etc.)
Explanation:
Try it here.
s->{                     // Method with String as parameter and return-type
  String r="",           //  Result-String
         x=r;            //  Regex-String
  for(String n:"ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE".split(" ")){
                         //  Loop (1) from "ONE" through "NINE":
    for(char c:n.toCharArray())
                         //   Inner loop (2) over the characters of this String
      x+="(?=.*"+c+")";  //    Append regex-group `(?=\w*c)` where `c` is the capital character
                         //   End of inner loop (2) (implicit / single-line body)
    x+="["+n+"]{"+n.length()+"}x";
                         //   Append regex part `[s]{n}` where `s` is the String, and `n` is the length
  }                      //  End of loop (1)
  // The regex now looks like this, which we can split on "x":
  // (?=.*O)(?=.*N)(?=.*E)[ONE]{3}x(?=.*T)(?=.*W)(?=.*O)[TWO]{3}x(?=.*T)(?=.*H)(?=.*R)(?=.*E)(?=.*E)[THREE]{5}x(?=.*F)(?=.*O)(?=.*U)(?=.*R)[FOUR]{4}x(?=.*F)(?=.*I)(?=.*V)(?=.*E)[FIVE]{4}x(?=.*S)(?=.*I)(?=.*X)[SIX]{3}x(?=.*S)(?=.*E)(?=.*V)(?=.*E)(?=.*N)[SEVEN]{5}x(?=.*E)(?=.*I)(?=.*G)(?=.*H)(?=.*T)[EIGHT]{5}x(?=.*N)(?=.*I)(?=.*N)(?=.*E)[NINE]{4}x
  for(int i=0,q;i<9;)    //  Loop (3) from 0 through 9 (exclusive)
    for(q=(s+" ").split(x.split("x")[i++]).length-1;
                         //   Split the input on the current regex-part,
                         //   and save the length - 1 in `q`
        q-->0;           //   Inner loop (4) over `q`
      r+=i               //    And append the result-String with the current index (+1)
    );                   //   End of inner loop (4)
                         //  End of loop (3) (implicit / single-line body)
  return r;              //  Return the result-String
}                        // End of method

Erf... wrong result for "ENOOWTEERHTRUOFEVIFXISNEVESTHGIEENIN" :(

Yeah, that's the only thing that prevented me to +1 this! My solution was 240 bytes... before you beat me to it.

@OlivierGrégoire Feel free to post your 240 byte solution, because I'm unable to find a solution.. The disadvantage about [ONE]{3} is that it also matches EEN at the end of that test case with parts of EIGHT and NINE.. And I doubt there is a regex to match all these: ENO|EON|NEO|NOE|OEN|ONE without also matching EEE;EEN;EEO;... for all numbers that is shorter than 40 bytes.. Maybe I can do something using substring and reverse checking the numbers, but I don't really have the time to figure it out now..

@OlivierGrégoire If you still have your 240 byte answer, feel free to post it. Just came across this challenge again, and fixed my answer by making a new regex for +58 bytes..

Nope, I deleted it. I usually delete my entries when I posted them.

Well, looks like I found an even shorter way while redoing this challenge :p

Ruby, 138 114 110 bytes
gsub(/#{"3ONE3TWO5THRE4FOUR4FIVE3SIX5SEVN5EIGHT4NIE".gsub(/(.)(\D+)/,'([\2]{\1})|')}/){(1..9).find{|i|$~[i]}}

Byte count includes 1 byte for the -p option.
What?
This:
/#{"3ONE3TWO5THRE4FOUR4FIVE3SIX5SEVN5EIGHT4NIE".gsub(/(.)(\D+)/,'([\2]{\1})|')}/

is a regex literal which, through string interpolation, evaluates to:
/([ONE]{3})|([TWO]{3})|([THRE]{5})|([FOUR]{4})|([FIVE]{4})|([SIX]{3})|([SEVN]{5})|([EIGHT]{5})|([NIE]{4})|/

If we assign that to regex, the rest of the code is somewhat easy to grasp: Each match in the input is substituted with the number of the capturing group, extracted from the magical variable $~ which contains the current match data:
gsub(regex){(1..9).find{|i|$~[i]}}

Try it online!

Java (OpenJDK 8), 181 bytes
s->{String x="",r;for(int i=0,l;i<9;)for(r="ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE".split(",")[i++],l=r.length();s.matches("["+r+"]{"+l+"}.*");s=s.substring(l))x+=i;return x;}

Try it online!
I took the liberty to reuse Kevin Cruyssen's TIO template. Hope you don't mind ;)

Ah, nevermind my previous comment.. You build the regex, instead of loop over the regex. Still, I was close with my first answer if only I had used the s.substring. The worst part is, is that I am using s.substring in my current answer, lol.. Ah well, +1 from me. Glad it's almost weekend..

05AB1E, 36 31 bytes
‘€µ‚•„í†ìˆÈŒšï¿Ÿ¯¥Š‘#vyœN>UvyX:

Try it online!

View it ran with debug:  TIO With Debug
‘€µ‚•„í†ìˆÈŒšï¿Ÿ¯¥Š‘# | Push ['ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE']
vyœ                   | For each list of permutations of that word...
   N>U                | Push index + 1 into register X.
      vyX:            | Replace each permutation with X.

I was just suggesting you had the green mark rather than me and I noticed a bug: FURONESEV returns FUR1SEV :(

Python 3, 238 236 bytes
def f(s):
 e=''
 while len(s):
  for i in range(9):
   for r in[''.join(p)for p in permutations('ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE'.split()[i])]:
    if s[:len(r)]==r:e+=str(i+1);s=s[len(r):]
 return e
from itertools import*

Try it online!

Brute-force solution, doesn't take advantage non-decreasingness of digits.

Thanks to @Mr. Xcoder for saving 2 bytes!

You have to include def f(s): in your byte count, this is not an anonymouos function

Also you can replace while len(s)>0 with while len(s)

@Mr.Xcoder thanks for that clarification

You can move the declaration of e into the function header for -1 byte. Also, exec and list comprehensions might save bytes on indentation.

PHP, 141 bytes
for($a=count_chars($argn);$c=ord($s[++$p]?:$s=[OWU,W,HG,U,FU,X,SX,G,N17.$p=0][$i-print str_repeat($i++,$x)]);)$x=$a[$i+48]+=($p?-1:1)*$a[$c];

older version, 151 bytes:
for($a=count_chars($argn,1);$s=[OWU,W,HG,U,FU,X,SX,G,N17][+$i++];print str_repeat($i,$a[$i+48]))for($p=0;$c=ord($s[$p]);)$a[$i+48]+=($p++?-1:1)*$a[$c];

loops through the digits from 1 to 9, counting unique characters in the word and subtracting non-unique characters´ counts, printing the digit on the go.
Although it is printing on the go, the digit counts must be stored for the 9 case to work.
Run as pipe with -nR or try it online.
It would save 4 more bytes to store the digit counts in $a[$i] instead of $a[$i+48] and use ASCII 1 and 7 (in quotes) instead of the digit characters themselves.
breakdown
for(
    $a=count_chars($argn,1);                # count character occurences in input
    $s=[OWU,W,HG,U,FU,X,SX,G,N17][+$i++];   # loop through digit names
    print str_repeat($i,$a[$i+48])              # print digit repeatedly
)
    for($p=0;$c=ord($s[$p]);)                   # loop through name
        $a[$i+48]+=                                 # add to digit count
        ($p++?-1:1)*                                # (add first, subtract other)
        $a[$c];                                     # character occurences

ONE is not the only word with an O, so it needs to subtract the counts for W (only appearing in TWO) and U (only appearing in FOUR) and so on.
NINE is special, because there is no way to just subtract if I used the letters (that would require I-X-G-F+U or N-O-S+W+U+X), so I use the digit counts instead.
PHP, 160 bytes
$a=count_chars($argn);foreach([W2O,U4FOR,X6SI,G8I,F5I,O1,R3,S7,I9]as$s)for(${$s[$p=1]}+=$n=$a[ord($s)];$c=ord($s[++$p]);)$a[$c]-=$n;while($$i--?print$i:$i++<9);

assumes all upper case input; characters may be scrambled all over.
Run as pipe with -nR or try it online.
explanation
loops through the digit words, counting their unique characters´ occurences in the input and in the process reducing the count of other characters.
"Other characters" could mean all other characters in the word; but only considering those that will be needed later saved 19 bytes.
Transforming the str_repeat loop to a combined loop saved 5 bytes.
And using variable variables for the digit count saved another 8.
breakdown
$a=count_chars($argn);                              # count character occurences in input
foreach([W2O,U4FOR,X6SI,G8I,F5I,O1,R3,S7,I9]as$s)   # loop through digit names
    for(${$s[$p=1]}+=                                   # 2. add to digits count
        $n=$a[ord($s)];                                 # 1. get count of unique character
        $c=ord($s[++$p]);)                              # 3. loop through other characters
        $a[$c]-=$n;                                         # reduce character count
while(
    $$i--?print$i                                       # print digit repeatedly
    :$i++<9);                                       # loop through digits

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

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


text:
I don't even... I only odd!
Your task is simple: write a program that receives an integer as input and outputs it if it was odd, and does nothing otherwise (not halting is allowed). The challenge is, that you can only use odd bytes.
You can optionally append a trailing newline to the output.
This is code-golf, shortest answer in (odd) bytes wins.
Standard loopholes are forbidden. Furthermore, you cannot use versions of languages, which are newer than the posting of this challenge.
Example input > output:
13 > 13
42 >

I downvoted this challenge because it is a "Do X without Y" challenge.

What exactly does does nothing otherwise mean? In Haskell a function with type Int -> Int  either returns an integer or does not halt or throws some error. If the input is even it should obviously not be returned, so  would not halting or throwing an error in this case be acceptable?

@Laikoni aren't there output operations in Haskell?

@M.Herzkamp You mean that instead of returning an integer, a string of the integer should be printed or returned, and thus an empty string should be printed/returned for even numbers? This is possible in Haskell, but I'm not sure it's possible under the given restrictions, whereas the task of deciding odd or even is possible.

If you wanna know if you can use your source code, try these scripts in your browser console.  Create valid charset: alphabet=new Set(Array(256).fill(0).map((v,i)=>i).filter(v=>v%2).map(String.fromCharCode));.  Check if source is valid: [..."SOURCE CODE"].every(v=>alphabet.has(v)).  See invalid characters in source: [...new Set("SOURCE CODE")].filter(v=>!alphabet.has(v)).  Remember to escape your quotes, " => \" ;)

@LeakyNun "do X without Y" doesn't refer to general [tag:restricted-source] challenges, but challenges that forbid you to use certain features of a language. This challenge isn't that and neither does it have any of the issues that make actual "do X without Y" challenges problematic.

@Laikoni As there are some answers already that go into an infinite loop, I would say that it is okay to show such a behaviour. Not returning can be interpreted as doing nothing.

Only odd bytes? Odd Unicode codepoints are not allowed? Also, is even-length solution allowed?

@user202729: Do you have in mind some programming language with a unicode symbol table? Or do you want to encode a program in a unicode string an run it inside your program or something?

I'd love to be proven wrong, but I don't think it's possible to solve this problem in Ruby : p, $, lambda, def or -> cannot be written. How could a method be defined, how could anything be printed out? It's also probably very hard (if not impossible), to do it in Python.

Likewise, I'd love to see a JavaScript version, since => and function are disallowed, plus ( is an even byte so I don't think JSFuck techniques can be used either...

@Laikoni (cc M.Herzkamp) for reference, by default answers always have to halt. So, M.Herzkamp, if you want to allow this, you should mention it explicitly in the challenge.

Shouldn't the title of the challenge be "I can't even... I only odd!"? "I can't even" is the meme.

@EricDuminil I made an answer in Python REPL.

Validate your solution.

@mbomb I was thinking along the lines of "I don't even (know what to say)"

@DomHastings It doesn't really work. Your codepen removes whitespace characters automatically, even valid ones like tabs.

@mbomb007 Ah, right you are, thanks for the heads up! I hadn't set white-space to pre. I've fixed that. I only thought I'd share since I made it to make sure I had no leftovers in mine!

Japt -f, 1 byte
u

u has a char-code value of 117.
Try it

Late to the party, but my... what an answer!

Lenguage, 645529908926937253684695788965635909332404360034079 9394157991500940492270727190763049448735 1174269748937617561533841898064735499551 2293382937520069758100171520285996319 bytes
That's roughly equal to 2 duodecillion bytes.
The file translates to the following brainfuck program:
,[<<+>+>-]<[>>+<<-]+>>[-[->]<]<[<[<]>.<]

Takes input as an ASCII code, with a maximum value of 256. Uses wrapping.

@Okx My mistake. But why don't you just use ,[<<+>+>-]<[>>+<<-]+>>[-[->]<]<[<[<]>.<]?

How about ,[[>]++[-<]<+>>]>[<<<.<] for only 3452857532394791089951 bytes?

Actually, since infinite loops are allowed, ,-[-->++<]>+. works as well

x86-64 Machine Code, 8 bytes
Inspired by Bruce Forte's solution, but slightly under par. :-)
8D 07          lea      eax, [rdi]    ; put copy of input parameter in EAX
D1 EF          shr      edi, 1        ; shift LSB into CF
             InfiniteLoop:
F3 73 FD       rep jnc  InfiniteLoop  ; test CF; infinite loop back here if input was even
C3             ret                    ; return with original input in EAX if it was odd

A single integer parameter is taken in the EDI register, following the System V AMD64 calling convention.
A copy of this value is initially made, and put into EAX so it can be returned if appropriate. (LEA is used instead of the normal MOV because we need an instruction with odd bytes.)
Then, the value in EDI is shifted right by 1, which places the shifted-off bit into the carry flag (CF). This bit will be 0 if the number was even, or 1 if it was odd.
We then test CF using the JNC instruction, which will branch only if CF is 0 (i.e., the number was even). This means that we will go into an infinite loop for even values. For odd values, we fall through and the original value (in EAX) is returned.
There is a bit of a trick with the JNC instruction, though—it has a REP prefix! Normally, REP prefixes are only used with string instructions, but because the Intel and AMD manuals both agree that irrelevant/superfluous/redundant REP prefixes are ignored, we throw one on the branch instruction here to make it 3 bytes long. That way, the relative offset that gets encoded in the jump instruction is also odd. (And, of course, REP is itself an odd-byte prefix.)
Thank goodness RET is encoded using an odd byte!
Try it online!

In case you don't think returning the value if it's odd or going into an infinite loop if it's even (so that you never return) satisfies the "output" requirements of the challenge, or you just want something more interesting, here's a function that outputs the value to a serial port (but only if it's odd, of course).
x86-64 Machine Code (output to serial port), 17 bytes
8D 07         lea   eax, [rdi]   ; put copy of input parameter (EDI) in EAX

B1 F7         mov   cl, 0xf7     ; put 0xF7 into low-order bits of CX
B5 03         mov   ch, 0x03     ; put 0x03 into high-order bits of CX
FE C1         inc   cl           ; increment low-order bits of CX to 0xF8 (so all together it's now 0x3F8)
0F B7 D1      movzx edx, cx      ; move CX to DX ("MOV DX, CX" would have a 16-bit prefix of 0x66)

D1 EF         shr   edi, 1       ; shift LSB of input parameter into CF
73 01         jnc   IsEven       ; test CF: branch if 0 (even), fall through if 1 (odd)
EF            out   dx, eax      ; output EAX (original input) to I/O port 0x3F8 (in DX)
            IsEven:
C3            ret                ; return

What makes this a bit more interesting is that the code does more, which means it was more challenging to do it all using instructions that are encoded using only odd bytes. Of course, this also means that it fails at code golf, so it's kind of a tradeoff—do you want interesting and challenging, or do you want short?
Anyway, this uses the x86 OUT instruction to write to I/O port 0x3F8, which is the standard COM1 serial port on a PC. The fun part, of course, is that all standard I/O ports (serial and parallel) have even addresses, so they can't simply be encoded as immediates for the OUT instruction or moved directly into a register. You have to initialize with one less than the actual value, and then increment the value in the register. You're also limited to using certain registers for the manipulation because you need registers that are encoded using odd bytes in the instruction when used as operands.
Also, I had to initialize the DX register (via the CX register) at the top of the loop, even though this is only needed if the value is odd, to ensure that the JNC instruction would have an odd offset. However, since what we're skipping over is the OUT instruction, all this code does is waste cycles and clobber scratch registers; it doesn't actually output anything, so it doesn't break the rules.
Finally, this function will return (after having either done or not done the output to the serial port) with the input value left in EAX. But that doesn't actually break any rules; all functions in assembly language will return with a value in EAX—the question is just is it a significant value or a garbage value. That's determined by the function's documentation (essentially, does it return a value or does it return void), and in this case, I'm documenting it as not returning a value. :-)
No TIO link for this one, as it doesn't implement output to serial ports. You'll need real iron, or an imagination.

+1 for the explanation! Why can you use mov in the second line but not in the first?

In addition to encoding that it's a MOV instruction, its operands also have to be encoded in the bytes. In this case, that would be the source and destination registers (although operands can also be immediate values, which are like constants). Different registers map to different bytes, and some of those bytes are even. So, for example, what I would want to use would be mov  eax, edi, but that is 89 F8 in bytes. See way more than you ever wanted to know on encodings here, under the "code" section. @M.Herzkamp

Jelly, 2 bytes
ẋḂ

These characters correspond to bytes 0xF7 and 0xBF in Jelly's code page.
Try it online!

Would be a shame if this solution with even byte count won the challenge... a 1 byte solution anyone?

05AB1E, 3 bytes
Éi=

The code corresponds to the byte values C9,69,3D or 201,105,61 which are all odd.
Try it online!
Explanation
É     # input % 2 == 1
 i    # if true
  =   # print without popping

= # print without newline that's actually print with newline without popping

@EriktheOutgolfer: True. I'll fix the explanation.

Unfortunately, É× doesn't seem to work ):

@kalsowerus: Yeah, I noticed that as well. Works correctly with a D in front, but that's even and not any shorter. The reason it doesn't work is that the repeated implicit input is taken as 2nd argument.

@Emigna but the weird thing is, swapping the top two values on the stack twice, makes it work as well...

@kalsowerus: That's because in this case, Éss× is the same thing as É¹s× which are both just longer ways of writing DÉ×.

MATL, 3 bytes
o?G

MATL uses ASCII characters, so o?G corresponds to bytes (in decimal) 111, 63, 71.
Try it online!
Explanation
o     % Push (implicit) input modulo 2
?     % If nonzero
  G   %   Push input
      % End (implicit)
      % Display stack contents (implicit)

Haskell, 36 33 bytes
c[1]=1;c[m]=1+1+c[m-1-1];o	m=c[m]

Try it online!
Usage: o 7 yields 7, o 8 enters an infinite loop.
The actual algorithm is
o 1 = 1
o m = 2 + o(m-2)

The first problem I faced was the lack of space and (, because a function o which takes an argument m is usually defined as o m=... or o(m)=.... However I found out that an inline comment {- some comment -} works as token delimiter too, so a definition o{--}m=... is possible under the given rules. Edit: Ørjan Johansen pointed out that one can use a tab character instead of a space, saving three bytes: o m=...
The second problem was the recursive call o(m-2). -2 is just -1-1, but here the comment trick does not work because the parentheses are required. I fixed this by letting the function work on a singleton list containing a number: o[m-2], however, as this is not a standard way of providing input, I outsourced the computation to a helper function c which works on lists and call c from o which has the correct format.

You can use a tab instead of a space.

@ØrjanJohansen I can verify that it works with \t instead of {--}.

@ØrjanJohansen Thanks, that's good to know.

Python REPL, 38 bytes
Takes input as the value of the previous expression using _. Output will be a string (the string representation of the integer for odd, or the empty string for even).
'%s'%[['']+[_]][-1][[_%[1+1][-1]][-1]]

Try it online
To run it in an actual shell, you can try it here. Type the input, hit enter. Paste the code, hit enter.
Explanation:
This took a while to figure out. There's no multiplication, no branching, no slicing, no commas, no periods, no imports, no parentheses, no exec, no eval, no print, and no functions. I got one solution working that output using stderr, but then I realized we had to output the actual integer, not just a truthy/falsey value.
I use brackets in place of parentheses with [expression][-1]. Simplifying that turns the above code into '%s'%(['']+[_])[_%(1+1)].
Since there can be no commas, I used list addition to create ['',_]. Using string formatting, the desired result is obtained.

Kudos. As a bonus, it also works for Ruby IRB :) Nitpick: is it okay to return a string for odd numbers, is it okay to return an empty string for even numbers?

Doing nothing and printing or returning nothing are the same, I'd think. In a way, empty string is nothing.

Yes, I was really nitpicking. It still returns a string instead of nothing. In Python REPL, I'd say that None would be an even better match than ''. Anyway, that's still 10000 times better than anything I could come up with.

@EricDuminil I could return False. Idk how you could get None, though.

Cubix, 23 19 17 bytes
;;u!I1)%/;O=!;;/;

Try it!
@, which terminates a Cubix program, is ascii 64, so unfortunately this actually just enters an infinite loop after testing for oddness. No TIO link since it'll time out.
= (ascii 61) is a no-op in Cubix.
This is a slight modification of the prior algorithm (same # of bytes) that actually works for negative integers.
Cube version:
    ; ;
    u !
I 1 ) % / ; O =
! ; ; / ; . . .
    . .
    . .

Algorithm:

I (73) : read in input as number
1 (49) : push 1
) (41) : increment
% (37) : take the mod
/ (47) : turn left
! (33) : skip next instruction if odd

1;;/; ; is (59) : prepares the stack for output
O (79) : Output as a number.
Then it re-enters the algorithm but I reads a 0 for end of input, so we are guaranteed to enter the even branch

u (117) : right-hand u-turn
;;;!I : loop, effectively doing nothing.

@MickyT that fails for negative input, which is why I avoided using ?

Apologies, I didn't check it properly

CJam, 6 bytes
q_iY%%

113 95 105 89 37 37
This program takes the mod 2 of the input (call it r) and prints every r th character in the input string. If the input number is odd, it prints the whole string, but if asked to print every 0th character the program throws an error.
Try it here

Nice! I was going to post qi_Y%]W%{}/M? and then I saw this.

Charcoal, 9 bytes
¿﹪Ｉθ÷χ⁵→θ

Try it online!
Basically it prints rightwards the input if it is not a multiple of 10/5 (the ² char is even in the Charcoal code page). The characters used are:

¿: code BF.
﹪: code A5.
Ｉ: code C9.
θ: code F1.
÷: code AF.
χ: code E3.
⁵: code B5.
→: code 13.

In fact the → near the end is redundant but then I saw that the answer had to have an odd length...
Explanation:
¿      if (
 ﹪      Modulo (
  Ｉθ      the input as number,
  ÷χ⁵      χ (predefined value: 10) divided by 5 = 2 ) [is 1])
 →θ      then print rightwards the input as string

You're printing and then moving right; print rightwards would actually be →θ.

@Neil oops, fixed. At least that didn't invalidate my answer... :-D

x86_64 machine code (Linux), 12 11 bytes
Unfortunately 0x80 is even, but it still worked out (assuming "does nothing" means not to return):
0000000000000000 <odd>:
   0:   8d 07                   lea  (%rdi), %eax
   2:   83 e7 01                and    $0x1, %edi
   5:   83 ff 01                cmp    $0x1, %edi
   8:   75 fb                   jne       5  <odd+0x5>
   a:   c3                      retq

-1 byte, thanks @CodyGray!
Try it online!

Since this is x86-64, lea (%edi),%eax requires an address size override prefix (0x67) when the source is a 32-bit register. You can eliminate that by doing lea (%rdi),%eax. That saves a byte, and actually would make the code slightly more efficient (prefixes slow down decoding and fill up i-cache). There are some other things you can do to shorten this even more, but that essentially constitutes a complete rewrite, so I'll post my own answer. :-) I've upvoted this, too, of course! (Oh, just realized you may have used the prefix to make the jump offset odd. Well, you'll need more magic.)

Also, really clever solution for TIO! I've been skipping it in most of my asm answers because I didn't want to write all of the boilerplate in the "footer" to print output in asm. I finally broke down and did it the other day, but this is a much better idea, allowing you to use C for everything else. I'll be stealing this from now on! :-)

Cheers for your inputs, I'm a complete noob at assembly but this seemed easy enough! Curious for your solution. Oh, credit goes to @ceilingcat - I stole it myself ;)

I didn't actually save you a byte… What you have now has an even byte (F6) for the JNE instruction because it has an even offset. That's what I meant by the last parenthetical I edited into my first comment. You actually need that prefix to create an odd alignment. Or you have to rewrite the code in some other way. I played with a bunch of different variations. I actually looked at this last night and was trying to figure out a good way to use OUT to output odd values, but no good solutions really occurred to me. The insight here for me is to go into an infinite loop for even values.

This is a pretty silly challenge, actually, because none of the reasonable solutions work. It really just tests how well you know the obscure corners of the x86 instruction set. I even tried the BT family of instructions, which nobody uses ever (unfortunately, all register encodings are even bytes). I thought it might be more interesting to write code that output to a serial port, rather than just returning a value or whatever, but that does jack the byte count up there (especially since serial port addresses in hex are even!), so I gave up on it.

Oh boy, I didn't even check.. Fixed it though ;)

You could try to modify the code during runtime.. But with 11 bytes there's not a lot of room.

Mathematica, 20 bytes
Appear to be the first solution in non-golfing language.
a=1+1;g[i_/;!a\[Divides]i]=i

In MacintoshChineseTraditional character encoding. \[Divides] is {161, 253} (2 bytes)
Alternative version (23 bytes)
\[CapitalAlpha]=1+1;\[CapitalGamma][\[CapitalChi]_/;\[CapitalAlpha]\[LeftFloor]\[CapitalChi]/\[CapitalAlpha]\[RightFloor]\[NotEqual]\[CapitalChi]]=\[CapitalChi]

or (shown in Unicode)
Α=1+1;Γ[Χ_/;Α⌊Χ/Α⌋≠Χ]=Χ

in Symbol character encoding. (use only 1-byte characters)
The solution defines a function g (or Γ) that, evaluate to input when the input is odd, and literally "do nothing" (does not evaluate) when the input is even.

+1 byte (; at the end) if the number of byte must be even; and \[Divides] also have odd Unicode codepoint.

You don't need I[1+1], you can just use {1+1}. Also, have you checked whether the bytes of the flooring brackets are valid? If so, you can obtain 2 from \[LeftFloor]E\[RightFloor].

@MartinEnder Only Symbol make floor valid, but it has neither E nor \[ExponentialE].

I'm afraid you aren't allowed to use the characters D; v; nor d, since they have an even byte-value.. :(

@KevinCruijssen \[Divides] is one single character in Mathematica, which is represented by 2 bytes {161, 253}.

@user202729 Ah ok, didn't knew that, Thanks for clarifying and +1 from me ;)

Perl, 54 bytes
Requires -E.
I really really enjoyed this challenge, I think I'd like to try and improve this answer, but I think that's might be the shortest I can make for now. I've been playing with these answers on and off for a few days now, but feel I'm happy with the 54 byte solution!
s//A_=Y[;A_=A_%O?A_W''/;y/#A-_/#-A/;s/[#-}]+/uc/ee;say

Try it online!
Explanation
By default, most of Perl's string functions work on $_, which is empty to start.
First, s//A_=Y[;A_=A_%O?A_W''/ replaces the empty string in $_ with A_=Y[;A_=A_%O?A_W'', then y/#A-_/#-A/ replaces characters based on the following list (char above becomes char below):
#ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
#$%&'()*+,-./0123456789:;<=>?@A

which updates $_ to contain $_=<>;$_=$_%2?$_:''. Next s/[#-}]+/uc/ee replaces all chars [#-}]+ with uc. Without the /ee this would just be the string uc, but /ee evaluates the contents of the string twice. The first evaluation returns the result of uc, which is an uppercase version of $_ but since $_ contains no alphabetic characters, this just returns the whole string, then the second /e evaluates the string again, which sets $_ to either $_ (the input number) or '' depending on whether or not the number is odd or even.
Finally, since $_ now contains what we want, we call say (which is what requires -E instead of -e) which prints $_ followed by a newline.

Alternative Perl, 93 bytes
92 bytes code + 1 for -p, which I feel would make it non-competing.
s//_/g;s//uc/e;y/\x09-\x0b/_/;s/____/}[/;s/___/%C]/;s/_/{''H/;y/'{}1CDGH/'-)1-3+--/;s/[#-}]+/uc/ee

Contains a tab and a vertical tab in the y///, indicated as \x09 and \x0b.
Try it online!

LOGO, 390 46 52 50 bytes
[ask    1   se[make]iseq    1-3 cos ?/ask   1[1/sum 1   179]?]

That is a template-list that return the input if the input is odd, and cause an error if the input is even.
Usage:
show invoke [ask ... (paste code here) ... ] 5

output
5

since 5 is odd, and
invoke [ask ... (paste code here) ... ] 6

will cause an error because 6 is even.

TI-BASIC, 14 bytes
Input Q
sinֿ¹(gcd(Q²,int(e
Q

This throws a domain error (printing nothing to the homescreen) on an even number.
Input Q             Q is a variable with an odd code. We cannot use "Ans" as it's even.

            int(e   floor(e) = 2; "2" is even.
         Q²         Q may be negative, so we square it which preserves parity.
     gcd(Q²,int(e   1 if Q is odd; 2 if Q is even.
sinֿ¹(gcd(Q²,int(e   Error iff Q is even.

Q                   If there was no error, print Q.

Pyth, 14 11 10 9 bytes

I+Q_+K/Q+3_1KQ
I!sIcQ+3_1Q
I!u+1_GQ1Q
?u+1_GQ1k

Test suite.

That's a clever way, but shouldn't something like I%Qy1Q also work?

@Jakube I clearly didn't figure out y1... However, % is not allowed, sadly.

Why not? % has ascii value 37 and is odd.

@Jakube because apparently I trusted in this list the OP provided (which is wrong)

Japt, 4 bytes
u)çU

Japt uses ISO/IEC 8859-1, so this corresponds to (in decimal) 117 41 231 85.
Test it online!
Explanation
Uu)çU   Implicit: U = input integer
Uu)     Return Python-style U % (missing argument = 2). This gives 1 if U is odd, 0 if even.
   çU   Implicitly convert U to a string and repeat it that many times.
        Implicit: output result of last expression

I first tried solutions using p, which is basically ç with reversed arguments. However, p performs exponentiation if its left argument is a number, so we'd need to explicitly convert it to a string. This solution turns out to actually be a byte shorter, in addition to not containing any odd bytes.

dc, 21 bytes
[c]sa?kKKCI-1;1k%1!=a

Decimal: 91 99 93 115 97 63 107 75 75 67 73 45 49 59 49 107 37 49 33 61 97
As per this IO default, this program leaves the input on the main stack if it is odd and empties the stack otherwise. This can be confirmed by adding the f debug command to the end of the program as is the case on the TIO page.
Try it online!
Explanation
[    # Begin macro definition.
 c   # Clear the main stack.
]sa  # End macro definition and push the macro into register "a".
?k   # Prompt for input and store it into precision parameter "k".
KK   # Push two copies of the input to the main stack.
CI-  # Push C-I = 12-10 = 2 to the main stack
1;1  # Push the value stored in the first index of array "1" (0 by default)
     # to the main stack.
k    # Push 0 into parameter "k" to reset the precision (otherwise the modulus
     # function will not work correctly).
%    # Push the input (mod 2) to the main stack.
1!=a # If the input (mod 2) does not equal 1, execute the macro in register "a".
f    # OPTIONAL: Output the contents of the main stack.

TI-Basic, 18 bytes
Saved 2 bytes thanks to lirtosiast
:Prompt Q
:While 5Q/ᴇ1-int(5Q/ᴇ1
:Q

in bytes (+2 newlines = 3F)
:Prompt Q
 DD     51
:While 5Q/ᴇ1-int(5Q/ᴇ1
 D1    35 3B B1  35 3B
        51 31     51 31
         83 71     83
:Q
 51

See http://tibasicdev.wikidot.com/one-byte-tokens

Why not use fPart(?

@lirtosiast seems to be an even byte (BA = 186) according to http://tibasicdev.wikidot.com/one-byte-tokens

Oh, I misread which entries were rows and which are columns.

I found Input Q[newline]sinֿ¹(gcd(Q²,int(e[newline]Q (14 bytes). May I post as separate answer?

@lirtosiast Wow! It's definitely different enough for a seperate answer. Love it

@lirtosiast don't see the use for ² tough

We need to square to make nonnegative, because gcd( only works on nonnegative integers.

MathGolf, 3 bytes
¥{k

Try it online!
The used bytes are 157, 123, 107.
Explanation
¥     Input modulo 2
 {    Loop that many times
  k   Push input

Bash, 31 bytes
read a
[ $[a%2] = 0 ] ||echo $a

Try it online!
Explanation:
read a                   reading the input and define it on the variable a
[ $[a%2] = 0 ]      outputs exit status 0 when a/2 is 0 and exit status 1 if not.
||                           evaluates only when the exit status left of it is 1
echo $a                displays the variable a

You seem to have missed that this is a restricted source challenge - you are using forbidden bytes. (rd $20|h and newline.)

@ØrjanJohansen fixed I guess

Um no. There is no restriction on the length of the program, but every character in it must have an odd byte value.