title: “Simple” Programming Homework

text:
# Question
Title: “Simple” Programming Homework
Your friend has been caught sleeping in class again! As punishment, his computer science teacher has assigned him homework, knowing that he will not be able to solve it due to not having paid any attention.

The assignment seems deceiving simple at first; all that is required is to output the string:

```
John Doe
```

Unfortunately, the teacher is intent on making the simple assignment much more difficult. Since your friend was not listening when the teacher explained the concept of strings and numbers, the teacher forbids him from using any number character (0-9) or the quotes (`"`, `'`, ```).

Can you help your friend solve this problem with the shortest code possible, and save his computer science grade in the process?

Try to find the shortest code in each language!

<sub>Note: it is encouraged to try to solve this problem in languages where string/character literals exist but cannot be used due to the restrictions (most mainstream languages are like this, e.g. C++).</sub>

# Answer
> 5 votes
# PowerShell, 51 bytes

```
#John Doe
(gc $PsCommandPath)[+$x]-replace(echo \#)

```

Try it online!

# PowerShell, 59 54 bytes

```
$x++;$x++
-join((echo John),(echo Doe).PadLeft($x+$x))

```

Try it online!

# PowerShell, 56 bytes

```
-join((echo John),[char](++$x-shl$x+++$x+$x),(echo Doe))

```

Try it online!

# PowerShell, 57 bytes

```
-join((echo John),[char]([char](echo !)-++$x),(echo Doe))

```

Try it online!

# PowerShell, The Most Trivial Solution™, 10 bytes

(I'm sorry, I said I wanted to avoid trivial solutions, but I did not know this was possible, and felt that this method might benefit PS solutions to other challenges)

```
{John Doe}

```

Try it online!

# Answer
> 5 votes
# JavaScript (V8), ~~80~~ ~~77~~ ~~76~~ ~~65~~ ~~40~~ ~~34~~ 20 bytes

```
_=>/John Doe/.source

```

Turns out the `_=>` might be required.

**History:**

```
/John Doe/.source

```

Oh there's a trivial way to do it. I just wasted an hour :/

**31:**

```
(/John Doe/+[]).slice(-~[],~[])

```

Finally found a way to get rid of that pesky `toString` :p

**37:**

```
/John Doe/.toString().slice(-~[],~[])

```

Why use the function thing at all?

**62:**

```
(function John_Doe(){}).name.replace(/_/,/ /.toString()[-~[]])

```

I probably should have thought about using `/ /` sooner...

**73:**

```
(function John_Doe(){}).name.replace(/_/,{}.toString(x=true)[x-~x-~x-~x])

```

I wasted twenty minutes trying to do this character by character then remembered this.

Golfed three bytes by using `-~x`, which is the same as `+2`.

# Answer
> 5 votes
# C, 41 bytes

```
#define p(x)puts(#x)
main(){p(John Doe);}

```

Try it online!

`#` converts a token passed to a macro to a string literal.

# Answer
> 4 votes
# Vyxal, `s`, 16 bytes

```
\J\o\h\nð\D\o\eW

```

Try it Online!

## Explained

```
\J\o\h\n    # Push the characters J, o, h and n
ð           # Push a space
\D\o\e      # Push the characters D, o and e
W           # Wrap everything into a list. The s flag joins on newlines

```

# Answer
> 3 votes
# Python 3, <sup>~~55~~ ~~43~~</sup> 28 bytes

Saved 12 bytes thanks to Makonede!!!
Saved 15 bytes thanks to ovs!!!

```
print(*dict(John=[],Doe=[]))

```

Try it online!

# Answer
> 3 votes
# CW for languages where the program `John Doe` is valid

Feel free to add to this list if you find a solution in another language.

**NOTE:** Text editors have been excluded as there are way too many of them.

# ///

# Charcoal

# GS2

# HTML

# Keg

# PHP

# Quine

# Text

# Answer
> 2 votes
# 05AB1E, 5 bytes

```
”„ÐÒ«

```

Try it online!

```
”„ÐÒ«  # full program
”„ÐÒ«  # push "John Doe"
       # implicit output

```

# Answer
> 2 votes
# Java, 166 bytes

```
$->{class John_Doe{}final char o=Byte.MAX_VALUE/Byte.MAX_VALUE,t=o+o,f=t+t+o,T=f+f,u=T*T-f,s=f*(f+o)+t;System.out.print(John_Doe.class.getSimpleName().replace(u,s));}

```

Try it online!

# Java, 192 bytes

```
a->{final char O=Byte.MAX_VALUE/Byte.MAX_VALUE,T=O+O,t=T+O,F=t+T,S=F+T,Z=F+F,Y=Z*Z,o=Y+Z+O,J=S*Z+T+T,h=Y+T+T,n=Y+Z,$=Z*t+T,D=F*Z+Z+F+t,e=Y+O;System.out.print(String.valueOf(J)+o+h+n+$+D+o+e);}

```

This uses `Byte.MAX_VALUE/Byte.MAX_VALUE` to obtain the number `1` and then uses it to construct the ASCII codes of all the characters in the string. `final` is needed so that casts from `int` to `char` are not necessary.

Try it online!

# Answer
> 2 votes
# Perl 5 -M5.10.0, 15 bytes

```
say q(John Doe)

```

Try it online! I don't know whether -M5.10.0 is optimal, I just cargo culted it from a random Perl answer.

# Answer
> 2 votes
# JavaScript, 32 bytes

```
_=>(/John Doe/+[]).slice(-~_,~_)

```

When the function is called without arguments, the first argument will be `undefined` and `~undefined` produces `-1`.

Try it online!

*Thanks to tsh for the idea*

# JavaScript (V8), 39 bytes

```
print(...Object.keys({John:[],Doe:[]}))

```

`print` uses a space to separate arguments when printing.

Try it online!

# Answer
> 1 votes
# Bubblegum, ~~10~~ 7 bytes

*-3 bytes by @tsh.*

```
´H&ÒF

```

Try it online! This program gets converted to base 256, then to base 96, and each digit \\$n\\$ gets replaced with the \\$n\\$th printable ASCII character. Hexdump:

```
00000000: 0bb4 4826 02d2 46  ..H&..F

```

# Answer
> 1 votes
# Windows Batch, 13 bytes

```
echo John Doe

```

# Answer
> 1 votes
# Jelly, 8 bytes

```
“®ƊʠỌḂŒ»

```

Try it online!

The  at the beginning isn't defined as a quote in the challenge, so Id say this is valid.

# Answer
> 1 votes
# PowerShell Core, 19 bytes

```
Write-Host John Doe

```

Try it online!

```
Write-Host John Doe  # full program
Write-Host           # output...
           John Doe  # literal

```

# Answer
> 1 votes
# Notepad / Gedit, 15 keystrokes

```
SHIFT+J
o
SHIFT+LEFT ARROW
CTRL+C
RIGHT ARROW
h
n

D
CTRL+V
e

```

# Notepad / Gedit (Boring solution), 8 keystrokes

```
J
o
h
n

D
o
e

```

# Answer
> 1 votes
# brainfuck, 91 bytes

```
-[------->+<]>+.[-->+++<]>.-------.++++++.-[->+++++<]>-.++[->++<]>.[--->+<]>+++.----------.

```

Try it online!

# Answer
> 1 votes
# Julia, 38 bytes

```
print(:John,Char(ceil(π*π*π)),:Doe)

```

Try it online!

# Answer
> 1 votes
# Java (JDK), 134 bytes

```
class John{public static void main(String[]z){System.out.print(John.class.getName()+(char)Float.SIZE+Doe.class.getName());}}enum Doe{}

```

# Java (OpenJDK 8), 131 bytes

```
interface John{static void main(String[]z){System.out.print(John.class.getName()+(char)Float.SIZE+Doe.class.getName());}}enum Doe{}

```

This is an everything java solution - count in the whole file, header and footer. No tio.run link because it depends on the class name, which must be `John` in this case. In Java 8+ you can make it an `interface` and omit `public` in the main method for -3.

`Float.SIZE` and `Integer.SIZE` return `32`, the char code for a space. In this case, `getName()`, `getTypeName()`, `getSimpleName()`, and `getCanonicalName()` will all return just the desired name part of the class/enum. You can make `John` an `enum` for -1, but it would require an extra `;` at the start to declare the enum objects, +1, making it equal length.

You can run this to verify whether it prints the correct String (and that the space character is an actual space, because doing `(char)0`, for example, will leave a blank spot without it technically being a space):

```
interface John { // or class
    public static void main(String[]z) {
        System.out.print((John.class.getName() + (char) Float.SIZE + Doe.class.getName())
            .equals("John Doe"));
        }
    }
enum Doe{}

```

# Answer
> 1 votes
# Pxem, 10 bytes of file name + 0 bytes of content = 10 bytes

* Filename: `John Doe.p`
* Content is empty

What a low effort.

# Answer
> 1 votes
# Deadfish~, 70 bytes

```
{i}dds{i}c{iiii}dddc{d}iiiciiiiiic{{d}ii}iic{iii}iiiiiic{iiii}iiic{d}c

```

Try it online!

It somehow beats Java!

# Answer
> 1 votes
# Vyxal, 8 bytes

```
«:L∞I\«ǐ

```

Try it Online!

Explanation:

```
«:L∞I\«   # Base-256 compressed "john doe"
       ǐ  # Convert To Title Case
          # Implicit output

```

Vyxal doesn't support capital letters in compressed strings, which is why the `ǐ` command is needed.

# Answer
> 0 votes
# PHP, 8 bytes

```
John Doe

```

Try it online!

```
John Doe  # full program
John Doe  # no leading <?, so outputs source

```

# Answer
> 0 votes
# Python 2, ~~56~~ 14+8=22 bytes

```
print __file__

```

Must be saved in a file called `John Doe` in the root directory. However, the path may not even contain a single `/` for this to work. Therefore, this file's full path should be only `John Doe`, and not `/John Doe` or `C:/John Doe`. Theoretically possible but not sure how in practice.

NB: Adding the lengths of the file name and the code was somehow the shortest approach I could find to this challenge (in Python).

# Answer
> -2 votes
# Bash, 13 bytes

```
echo John Doe

```

Try it online!

```
echo John Doe  # full program
echo           # output...
     John Doe  # literal

```

---
Tags: code-golf, restricted-source
---


title: Did I die or not?

text:
# Question
Title: Did I die or not?
Given a permutation of the alphabet and an intended "word", determine if the word was guessed in a game of Hangman, where the permutation is the list of guesses.

For example, given `ASTNORDYUVKFMCLWIHEBQGPJXZ` as the permutation, and `ASTRONAUT` as the word, we know that the word was guessed. Only 2 letters (`DY`) were wrong before guessing `U` to complete the word. At the end of the game, the gallows look like

```
  |
  |
  |
  |
  |
  |
------

```

so the man wasn't hanged and the guesser wins.

However, if the word was `PAYMENT`, then there are 12 wrong guesses (`SORDUVKFCLWI`) before the word is complete (the "filled in" word looks like `_AYM_NT` at the end), so the guesser loses.

The full gallows takes 12 steps to finish:

```
                                      ------   ------   ------   ------   ------   ------   ------   ------
           |        |        |/       |/       |/   |   |/   |   |/   |   |/   |   |/   |   |/   |   |/   |
           |        |        |        |        |        |    O   |    O   |    O   |    O   |    O   |    O
           |        |        |        |        |        |        |    |   |   /|   |   /|\  |   /|\  |   /|\
           |        |        |        |        |        |        |        |        |        |   /    |   / \
           |        |        |        |        |        |        |        |        |        |        |
           |        |\       |\       |\       |\       |\       |\       |\       |\       |\       |\
------   ------   ------   ------   ------   ------   ------   ------   ------   ------   ------   ------

```

So 12 wrong guesses before the final correct letter is a loss and the final correct letter before 12 wrong guesses is a win.

---

You are to take 2 strings as input:

* A 26 character long string, containing 26 unique letters in a consistent case i.e. a permutation of either the uppercase or lowercase alphabet
* A string containing a maximum of 26 unique characters and a minimum of 1 character, in the same case as the permutation

You should then output 2 distinct values to indicate whether the word was guessed before 12 wrong guesses or not.

You may input and output in any convenient method. The length of the second input will never exceed your language's integer maximum.

This is so the shortest code in bytes wins.

## Test cases

```
permutation, word -> output
ABCDEFGHIJKLMNOPQRSTUVWXYZ, CGCC -> 1
ABCDEFGHIJKLMNOPQRSTUVWXYZ, LAB -> 1
ABCDEFGHIJKLMNOPQRSTUVWXYZ, MOP -> 0
ABCDEFGHIJKLMNOPQRSTUVWXYZ, MNOPQRSTUVWXYZ -> 0
ABCDEFGHIJKLMNOPQRSTUVWXYZ, LMNOPQRSTUVWXYZ -> 1
NYLZCBTOAFEQMVJWRHKIUGDPSX, NYLON -> 1
NYLZCBTOAFEQMVJWRHKIUGDPSX, GOLF -> 0
DXAPMHBYRVNKOFQZCSWUEJLTGI, ABCDEFGHIJKLMNOPQRSTUVWXYZ -> 1
INRLVTXOZSAKWJYFBQDMGPHUCE, IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII -> 1
INRLVTXOZSAKWJYFBQDMGPHUCE, EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE -> 0
FICUJKXZYVDGEWRLMANBHOPSTQ, RDRYMUTSDOVSEHWT -> 0
ASTNORDYUVKFMCLWIHEBQGPJXZ, ASTRONAUT -> 1
ASTNORDYUVKFMCLWIHEBQGPJXZ, PAYMENT -> 0

```

Here is a Jelly program which automatically generates test cases in the form

```
permutation
word
output

```

Spoilers for anyone who understands Jelly

# Answer
> 9 votes
# JavaScript (ES6),  ~~43 41~~  40 bytes

Expects `(alphabet)(word)`, where `alphabet` is an array of characters. Returns a Boolean value.

```
a=>w=>a.every(c=>w.match(c)?~a<11:a=~-a)

```

Try it online!

### Commented

```
a =>             // a[] = alphabet, reused as a negative counter of errors
w =>             // w = word to guess
  a.every(c =>   // for each character c in a[]:
    w.match(c) ? //   if c appears at least once in the word:
      ~a < 11    //     make sure that there was less than 12 errors so far
                 //     (this is equivalent to a > -12)
                 //     NB: we only need to test the number of errors when a
                 //     correct character is found, for it means that the word
                 //     was not fully guessed yet
    :            //   else:
      a = ~-a    //     decrement a (always truthy)
  )              // end of every()

```

# Answer
> 7 votes
# , 21 19 bytes

```
12>1#.0=#:@#.@|.@e.

```

Try it online!

Consider:

```
echo 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' f 'CGCC'

```
* `e.` Is each left char an element of the right string?

```
0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

```
* `|.@` Reverse

```
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0

```
* `#:@#.@` We want to remove those leading zeroes, so we convert to decimal number `#.` and then back to a binary one `#:`

```
1 0 0 0 1 0 0

```
* `12>1#.0=` Sum the remaining zeroes and check if there are less than 12.

# Answer
> 7 votes
# Python 3, 42 bytes

```
lambda a,s:max(map(a.find,s))-len({*s})<11

```

`max(map(a.find,s))` gives us the index of the final correct letter. Subtracting this by the number of unique characters in \\$ s \\$, gives us the total number of incorrect guesses. Finally, `...<11` ensures that at most `11` incorrect guesses are made.

Try it online!

# Answer
> 6 votes
# Jelly, 8 bytes

```
iⱮṬ¬S<12

```

Try it online!

-1 byte thanks to caird coinheringaahing

## Explanation

```
iⱮṬ¬S<12   Main Link
 Ɱ         For each element in the right argument (the word to guess)
i          Find its index in the left argument (the guess order)
  Ṭ        Array with 1s in those indices; removes duplicates and only leaves zeroes before the last one, so the number of zeroes is the number of wrong guesses before we guess the word
   ¬       Logical NOT; the 0s and 1s swap
    S      Sum (we could've also done "count zeroes" instead of "NOT -> sum")
     <12   Is the number of wrong guesses less than 12?

```

# Answer
> 4 votes
# Vim, 34 bytes

```
qf11llddqu:s/[^<C-r><C-w>]*$
:s/[<C-r><C-w>]//g
@f

```

Try it online! (falsey test, pangram test)

Takes the secret word followed by the permutation, comma separated.

```
qq11llddqu
qf      q          " define a macro named 'f'
  11l              "   go forward 11 characters (succeeds if it can move at least 1)
     l             "   and one more *exiting f if we can't*
      dd           "   delete the current line
         u         " undo the line deletion for now
:s/[^<C-r><C-w>]*$ " delete the maximal suffix of this line of characters not in the word
                   "   <C-r><C-w> inserts the word under the cursor (i.e. the secret word) into the expression
:s/[<C-r><C-w>]//g " delete all characters which are in the word
@f                 " call f

```

This will delete the (only) line in the buffer if there are at least 12 wrong guesses before the word is complete (falsey), or leave a `','` followed by some letters (i.e. the possibly empty set of wrongly guessed letters).

The `f` macro came out shorter than using the expression register:

```
C<C-r>=len("<C-r>"")<12

```

# Answer
> 3 votes
# Ruby, 45 40 34 bytes

```
->g,s{!g[/.*[#{s}]/].tr(s,'')[12]}

```

Try it online!

-6 bytes thanks to "G B" for the "index into string to verify min length" trick!

I kinda liked the idea of solving it with a regex...

We just greedily match for a string ending in one of the chars from our target string, then remove the target string chars from that match, then check the size.

# Answer
> 3 votes
# JavaScript (Node.js), 39 bytes

```
a=>w=>!a.match(`(.*[^${w}]){12}[${w}]`)

```

Try it online!

# Answer
> 3 votes
# , 46 bytes

```
function(a,w)max(m<-which(a%in%w))-sum(m|1)<12

```

Try it online!

Input is two vectors of characters representing the alphabet (`a`) and the word (`w`). Outputs `TRUE` if I did not die.

Checks that the `max`imum index (`which`) of the elements of `a` that are in `w` is not 12 greater than the number `m` of those elements (which is the number of unique elements of `w`).

# Answer
> 3 votes
# Husk, ~~10~~ 9 bytes

*Edit: -1 byte thanks to Leo*

```
↓12-¹Σhġ€

```

Try it online!

Arg1 = word; Arg2 = alphabet; Outputs truthy if I did die (list of excess moves needed after hangman is already complete), falsy (empty list) if I did not die.

```
        ġ€    # group arg2 by whether each element is present in arg1
       h      # discard the last group (all the letters
              # after the last guess, or the last guess itself)
      Σ       # put groups back together into one list
    -¹        # get only letters not present in arg1
 ↓12          # remove the first 12 of them.

```

# Answer
> 2 votes
# Haskell, 61 bytes

```
(12#)
(l#(h:t))w|elem h w=l>0&&(l#t)w|i<-l-1=i#t$w
(_#_)_=0<1

```

Try it online!

Standard recursive implementation. The relevant function is `(12#)`, which takes as input the alphabet and the word as `String`s and returns `True` for guessed, `False` for dead.

# Answer
> 2 votes
# Charcoal, 17 bytes

```
‹ＬΦ…θ⌈Ｅη⌕θι¬№ηι¹²

```

Try it online! Link is to verbose version of code. Outputs a Charcoal boolean, i.e. `-` for a win, nothing for a loss. Explanation:

```
    θ               Input permutation
   …                Truncated to length
       η            Input word
      Ｅ             Map over characters
         θ          Input permutation
        ⌕           Find index of
          ι         Current character
     ⌈              Take the maximum
  Φ                 Filtered where
            №       Count of
              ι     Current character in
             η      Input word
           ¬        Is zero
 Ｌ                  Take the length
‹                   Is it less than
               ¹²   Literal `12`?

```

# Answer
> 2 votes
# Japt, 10 bytes

```
ôoV ÔÅ¬Ê<C

```

Try it online! or check all test cases

Explanation:

```
ôoV ÔÅ¬Ê<C
ô             # Remove characters from Input 1 where:
 oV           #  It appears in Input 2
              # And split where characters were removed
    Ô         # Reverse the resulting array
     Å        # Remove the first element
      ¬       # Join the remaining strings
       Ê      # Get the total length
        <C    # Return true if less than 12, false otherwise

```

# Answer
> 2 votes
# K (ngn/k), 14 bytes

```
12>+/~2\2/|~^?

```

Try it online!

A straightforward port of @Jonah's J answer.

Implicitly takes a pair of args; `x` as the word, and `y` as the permutation.

* `~^?` check whether each letter in `y` is present in `x` (literally, `not null x find y`)
* `2\2/|` a port of @Jonah's logic to trim trailing 0's appearing after the last 1 (convert the reverse of the boolean list from base 2, then back to base 2; although the resulting list is reversed, this doesn't matter, as...)
* `12>+/~` is 12 greater than the number of 0's in the trimmed list?

# Answer
> 1 votes
# Retina 0.8.2, 35 bytes

```
(.*)(.).*(,.*\2)
$1$3
Dr`
^.{0,11},

```

Try it online! Link includes test cases. Explanation:

```
(.*)(.).*(,.*\2)
$1$3

```

Delete the permutation starting at the last correct letter.

```
Dr`

```

Remove all remaining correct letters from the permutation.

```
^.{0,11},

```

Check that there were no more than 11 incorrect letters left.

# Answer
> 1 votes
# Zsh `-ey`, 40 bytes

```
for c (${1/// })((${2[(I)$c]}?e<12:++e))

```

Try it online! or verify all test cases

Takes input in command-line arguments (`alphabet` `word`) and outputs via status code (`0` = survived, `1` = died). Uses @Arnauld's method.

Explanation:

* `${1/// }`: replace every empty string in the first input with a space. With `-y`, effectively splits into a list of characters.
* `for c ()` for each character `$c`:
    + `(())`: arithmetic expression; succeeds only if the result is non-zero
    + `[(I)]`: find the 1-based index of `$c` in `${2}`: the second input. If there is no instance, returns `0`.
    + `?:`: if that was truthy (i.e. the character is present in the word), then return the `0/1` boolean value of `e<12`. Otherwise, increment `e` and return it (`$e` implicitly starts as `0`)
* `-e` flag: like a logical AND over the whole program, so the program will succeed only if every arithmetic expression also succeeded

# Answer
> 1 votes
# Perl 5 `-pl`, 37 bytes

```
$b=<>;s/[^$b]/0/g;s/0*$//;$_=y/0//<12

```

Try it online!

Changes all non-target letters in the alphabet to `0`, removes trailing `0`s and then counts how many remain to determine if the limit has been reached before completing the target word.

# Answer
> 1 votes
# C#, 78 bytes

```
(g,w)=>{return !w.Distinct().Where(p=>!g.Substring(0,12).Contains(p)).Any();};

```

returns TRUE if any character is NOT contained in the first 12 guesses, if TRUE then test does not pass, so success variable needs to be the opposite (FALSE). if FALSE then test passes, so success variable needs to be the opposite (TRUE).

Explanation:

```
 !                             # NOT
  w.Distinct()                 # Get distinct letters from the word to guess (w)
    .Where                     # find
     p =>                      # each distinct letter to guess (w) into p
      !                        # NOT
       g.Substring(0, 12)      # first 12 characters of guess
        .Contains(p)           # is p contained in string
         .Any()                # returns true if any matched the condition

```

# Answer
> 1 votes
# Julia, 37 bytes

```
a*b=findlast(a.∈b)-length(b∪b)<12

```

expects `permutation*word` with `permutation` a list of characters and `word` a String

`b∪b` is `union(b,b)` which is equivalent to `unique(b)`

Try it online!

# Answer
> 1 votes
# Bash/Zsh, 29 bytes

```
[[ $1 =~ (.*[^$2]){12}[$2] ]]

```

Try it online!

* List of letters is given as first argument
* Word to find is given as second argument
* Exit status is 0 if dead and 1 if alive

This is the builtin equivalent to `egrep -q "(.*[^$2]){12}[$2]" <<< $1`

The idea is to build an extended regex that checks whether there are at least 12 letters not in the word to find (= wrong guesses) before any letter in that word (= guesses that came too late).

(initially 32 bytes, but enhanced with the help of this answer from @tsh who had the same idea long before me)

---
Tags: code-golf, string, decision-problem, subsequence
---


title: Do you want to code a snowman?

text:
# Question
Title: Do you want to code a snowman?
Here is a simple ASCII art snowman:

```
_===_
(.,.)
( : )
( : )

```

Let's make him some friends. This will be the general pattern for our ASCII art snowpeople:

```
 HHHHH
 HHHHH
X(LNR)Y
X(TTT)Y
 (BBB)

```

The leading spaces and the parentheses are always the same for all snowpeople. The different letters represent sections of the pattern that can individually change. Each section has exactly four presets for what ASCII characters can fill it. By mixing and matching these presets for all eight sections, we can make a variety of snowpeople.

# All Presets

<sup>(Notice that spaces are put on otherwise empty lines so the section shape is always correct.)</sup>

### H is for Hat

1. Straw Hat

```

_===_
```
2. Mexican Hat

```
 ___
.....

```
3. Fez

```
  _
 /_\

```
4. Russian Hat

```
 ___
(_*_)

```

### N is for Nose/Mouth

1. Normal `,`
2. Dot `.`
3. Line `_`
4. None

### L is for Left Eye

1. Dot `.`
2. Bigger Dot `o`
3. Biggest Dot `O`
4. Closed `-`

### R is for Right Eye

(Same list as left eye.)

### X is for Left Arm

1. Normal Arm

```

<
```
2. Upwards Arm

```
\

```
3. Downwards Arm

```

/
```
4. None

```

```

### Y is for Right Arm

1. Normal Arm

```

>
```
2. Upwards Arm

```
/

```
3. Downwards Arm

```

\
```
4. None

```

```

### T is for Torso

1. Buttons  `:`
2. Vest `] [`
3. Inward Arms `> <`
4. None

### B is for Base

1. Buttons  `:`
2. Feet `" "`
3. Flat `___`
4. None

# Challenge

Write a program that takes in an eight character string (via stdin or command line) in the format `HNLRXYTB`, where each letter is a digit from 1 to 4 that denotes which preset to use for the corresponding section of the snowperson. Print the full snowperson to stdout.

For example, the input `11114411` is the snowman at the top of the page. (First `1`: he has a straw hat, second `1`: he has a normal nose, etc.)

Another example, the snowperson for input `33232124`:

```
   _
  /_\
\(o_O)
 (] [)>
 (   )

```

# Details

* Any amounts and combinations of leading/trailing spaces and leading/trailing newlines are allowed as long as...

+ the snowperson has all their sections arranged correctly with respect to one another, and
    + there are never more than 64 total whitespace characters (the general pattern is only 7×5, so you probably won't hit this limit).

You don't need to print rows/columns of the pattern if they only contain whitespace. e.g. the empty line of the straw hat is not required.
* You must use the ordering of the parts as they are given above.
* Instead of a program, you may write a function that takes the digit string as an argument. The output should be printed normally or returned as a string.
* You may treat the input as an integer instead of a string if preferred.

# Scoring

The shortest code in bytes wins.

***Bonus question:*** Which of the 65536 distinct snowpeople is your favorite?

# Answer
> 41 votes
# CJam, ~~135~~ ~~134~~ ~~132~~ ~~130~~ ~~126~~ 125 bytes

```
0000000: 4e22285b200a5c225f2a295c2d2e2f6f2c3e4f3a3c3d5d225f  N"([ .\"_*)\-./o,>O:<=]"_
0000019: 2422dd7382d6bfab28707190992f240c362ee510262bd07a77  $".s....(pq../$.6...&+.zw
0000032: 08556de9dcdb566c676817c2b87f5ecb8bab145dc2f2f76e07  .Um...Vlgh....^....]...n.
000004b: 22323536624b623224663d4e2f7b5f2c342f2f7d25723a7e2e  "256bKb2$f=N/{_,4//}%r:~.
0000064: 3d2828342423346222205f0a20222e2a6f6f736572372f4e2a  =((4$#4b" _. ".*ooser7/N*

```

To create the file on your machine, execute `xxd -r > snowman.cjam`, paste the reversible hexdump from above, press `Enter` and finally `Ctrl` \+ `D`.

Alternatively, you can try the code online using the CJam interpreter.

### Bonus

My favorite snowman is Olaf:

```
$ LANG=en_US cjam snowman.cjam <<< 12222212

 _===_
\(o.o)/
 ( : )
 (" ")

```

*Winter's a good time to stay in and cuddle, but put me in summer and I'll be a… happy snowman!*

### Idea

The hex string

```
dd7382d6bfab28707190992f240c362ee510262bd07a7708
556de9dcdb566c676817c2b87f5ecb8bab145dc2f2f76e07

```

encodes the possible choices for all parts of the snowman, including the fixed ones. Let's call this string **P**.

To decode it, we convert **P** (here treated as an array of integers) from base 256 to base 20 and replace each of the resulting integers by the corresponding character of the string **M**:

```
([
"_*)\-./o,>O:<=]

```

This results in the string **T**:

```
/(_*_)"_===_/....., /_\
 ,._
-.oO
-.oO
   <\  /
   >/  \
    : ] [> <
    : " "___
 ((()

```

The first line encodes all hat choices, the last all fixed body parts. The other lines contain the 28 variable body parts.

We split **T** at linefeeds and divide the strings of the resulting array into four parts of equal length. Then, we read the input from STDIN, push the array of its digits in base 10 and select the corresponding elements of the split strings. We take advantage of the fact that arrays wrap around in CJam, so the element at index 4 of an array of length 4 is actually the first element. The last divided string does not correspond to any input, so it will get selected entirely.

We handle the hat by shifting the first element out of the resulting array. The index in **M** of first character, read as a base 4 number, reveals the number of spaces and underscores in the first line of the hat. We print those characters, a linefeed, a space and the remainder of the shifted string. Then, we push an additional linefeed on the bottom of the stack.

For the body parts, we concatenate the string corresponding to all of them. Let's call this string **S**. To assemble the body parts, we perform transliteration: we take each character of the string **M**, compute its index in **sort(M)** and replace it by the corresponding character of **S**. We take advantage of the fact that the transliteration operator automatically pads **S** to match the length of **sort(M)** by repeating the last character of **S** as many times as necessary.

Finally, we divide the resulting string into substrings of length 7 and place a linefeed between each pair of substrings.

### Code

Suppose that the variables `M` and `P` contain the strings **M** and **P**.

```
N        e# Push a linefeed.
M_$      e# Push M and a sorted copy.
P256bKb  e# Push P and convert it from base 256 to base 20.
2$       e# Push a copy of M.
f=       e# Compute T by retrieving the proper chars from M.
N/       e# Split T at linefeeds.
{_,4//}% e# Divide each string into four substrings of equal length.
r:~      e# Read a number from STDIN and push the array of its digits in base 10.
.=       e# Get the corresponding chunks from T.
((       e# Shift out the first string and that string's first character.
4$#      e# Find its index in M.
4b       e# Compute its digits in base 4.
" _
 ".*     e# Repeat the space and underscore that many times in place.
oo       e# Print the result and the shifted string.
s        e# Flatten the remainder of the array. This pushes S.
er       e# Perform transliteration.
7/       e# Split into chunks of length 7.
N*       e# Join using linefeeds.

```

# Answer
> 63 votes
# JavaScript ES6, 210 208 202 bytes

```
s=>` 0
8(213)9
4(6)5
 (7)`.replace(/\d/g,p=>`_===_1 ___
 .....1  _
  /_\\1 ___
 (_*_)1,1.1_11.1o101-1.1o101-1<11/11>11\\11 : 1] [1> <1   1 : 1" "1___1   11\\11 11/11 `.split(1)[s[p>7?p-4:p]-1+p*4]||' ')

```

This is an anonymous function; you use it by executing `([function code])('42232124')`. The most aggravating part of this was the arms, which take up 2 lines, so I had to include code for both top and bottom.

The Stack Snippet below has ungolfed, un-ES6-ified, commented code. And you can use it to easily test the code and try out different combinations. **Edit:** I'm having way too much fun with this. I've added several new features, including a way to generate a random snowman.

Thanks to Yair Rand for saving six bytes.

```
var f=function(s){
  return' 0\n8(213)9\n4(6)5\n (7)' // Start with a placeholder string with all the static components
    .replace(/\d/g,function(p){ // Go through each placeholder number to replace it with its value
    // The massive string below holds all the possible body parts, separated by 1 for easy splitting.
    // The two at the end are for the top of the arms
    return'_===_1 ___\n .....1  _\n  /_\\1 ___\n (_*_)1,1.1_11.1o101-1.1o101\
-1<11/11>11\\11 : 1] [1> <1   1 : 1" "1___1   11\\11 11/11 '.split(1)
    [s[p>7?p-4:p]-1 // Get the value from the input string. If the current body part
                    // is the top of the two-line arms (8 or 9), drop it down to 4 or 5
                    // Subtract 1 to account for the 0-indexed array.
     +p*4] // multiply by 4 to skip to the relevant code
     ||' ' // To save bytes in the above string, spaces are empty strings, so replace them here
  })
}

// Code for the interactive version follows
// http://codepen.io/hsl/pen/bdEgej
function updateRadios(){$('input[type="radio"]').each(function(){if($(this).is(":checked")){var t=$(this).data("p"),i=$(this).data("v");input[t]=i}}),inputS=input.join(""),update()}var input=[],inputS=$("#code").val(),update=function(){$("#p").text(f(inputS)),$("#code").val(inputS)};$('input[type="radio"]').change(updateRadios),$("#code").keyup(function(){inputS=$(this).val(),update()}),updateRadios(),$("#random").click(function(){for(var t=0;8>t;t++)$("div:eq("+t+") input:eq("+Math.floor(4*Math.random())+")").prop("checked",!0);updateRadios()});
```

```
body{font-family:sans-serif}h2{font-size:18px;font-weight:400}label{display:block}div{display:inline-block;margin:0 10px}#code{width:70px}
```

```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><div><h2>Hat</h2><label><input type="radio" name="p1" data-p="1" data-v="1"> Straw hat</label><label><input type="radio" name="p1" data-p="1" data-v="2"> Mexican hat</label><label><input type="radio" name="p1" data-p="1" data-v="3"> Fez</label><label><input type="radio" name="p1" data-p="1" data-v="4" checked> Russian hat</label></div><div><h2>Nose/mouth</h2><label><input type="radio" name="p2" data-p="2" data-v="1"> Normal</label><label><input type="radio" name="p2" data-p="2" data-v="2" checked> Dot</label><label><input type="radio" name="p2" data-p="2" data-v="3"> Line</label><label><input type="radio" name="p2" data-p="2" data-v="4"> None</label></div><div><h2>Left eye</h2><label><input type="radio" name="p3" data-p="3" data-v="1"> Dot</label><label><input type="radio" name="p3" data-p="3" data-v="2" checked> Bigger dot</label><label><input type="radio" name="p3" data-p="3" data-v="3"> Biggest dot</label><label><input type="radio" name="p3" data-p="3" data-v="4"> Closed</label></div><div><h2>Right eye</h2><label><input type="radio" name="p4" data-p="4" data-v="1"> Dot</label><label><input type="radio" name="p4" data-p="4" data-v="2"> Bigger dot</label><label><input type="radio" name="p4" data-p="4" data-v="3" checked> Biggest dot</label><label><input type="radio" name="p4" data-p="4" data-v="4"> Closed</label></div><div><h2>Left arm</h2><label><input type="radio" name="p5" data-p="5" data-v="1"> Normal</label><label><input type="radio" name="p5" data-p="5" data-v="2" checked> Upwards</label><label><input type="radio" name="p5" data-p="5" data-v="3"> Downwards</label><label><input type="radio" name="p5" data-p="5" data-v="4"> None</label></div><div><h2>Right arm</h2><label><input type="radio" name="p6" data-p="6" data-v="1" checked> Normal</label><label><input type="radio" name="p6" data-p="6" data-v="2"> Upwards</label><label><input type="radio" name="p6" data-p="6" data-v="3"> Downwards</label><label><input type="radio" name="p6" data-p="6" data-v="4"> None</label></div><div><h2>Torso</h2><label><input type="radio" name="p7" data-p="7" data-v="1"> Buttons</label><label><input type="radio" name="p7" data-p="7" data-v="2" checked> Vest</label><label><input type="radio" name="p7" data-p="7" data-v="3"> Inward arms</label><label><input type="radio" name="p7" data-p="7" data-v="4"> None</label></div><div><h2>Base</h2><label><input type="radio" name="p8" data-p="8" data-v="1"> Buttons</label><label><input type="radio" name="p8" data-p="8" data-v="2"> Feet</label><label><input type="radio" name="p8" data-p="8" data-v="3"> Flat</label><label><input type="radio" name="p8" data-p="8" data-v="4" checked> None</label></div><br><button id="random">Randomize</button><pre id="p"></pre><input type="text" id="code">
```

# Answer
> 31 votes
# CJam, 164 bytes

Generates the snowman left-to-right, top-to-bottom. This eliminates the need for any kind of string joining or repositioning operations, as I just leave every piece of the snowman on the stack. And then, due to the automatic stack dump at the end of programs:

*CJam wants to build a snowman!*

```
q:Q;SS"
 _===_,___
 ....., _
  /_\,___
 (_*_)"',/0{Q=~(=}:G~N" \ "4G'(".oO-"_2G",._ "1G@3G')" / "5GN"< / "4G'(" : ] [> <   "3/6G')"> \ "5GNS'(" : \" \"___   "3/7G')

```

Try it online.

### Bonus

Thinking outside the box! `32443333` gives a snow(wo)man bride. You've gotta try a bit to see it, but there are the inward arms, fez + downwards arms = veil, and the head is actually in the fez/veil. The generally large form is the billowy dress, and the "eyes" and "nose" are folds in the dress.

```
   _
  /_\
 (-.-)
/(> <)\
 (___)

```

Other "eye" choices are a bit risqué...

# Answer
> 27 votes
# Python, ~~276~~ 289 bytes

```
V='.oO-'
def F(d):
 D=lambda i:int(d[i])-1
 print"  "+("","___"," _ ","___")[D(0)]+"\n "+\
"_. (=./_=._*=.\\__. )"[D(0)::4]+"\n"+\
" \\  "[D(4)]+"("+V[D(2)]+',._ '[D(1)]+V[D(3)]+")"+" /  "[D(5)]+'\n'+\
"< / "[D(4)]+"("+" ]> :    [< "[D(6)::4]+")"+"> \\ "[D(5)]+"\n ("+\
' "_ : _  "_ '[D(7)::4]+")"

```

This code has 8 extra bytes(`\`\*4) for readability.

Builds the snowman up bit by bit.

# Bonus

`F("44444432")` gives "sleepy russian bear":

```
  ___
 (_*_)
 (- -)
 (> <)
 (" ")

```

# Answer
> 22 votes
# Python 2, ~~354~~ ~~280~~ ~~241~~ 261 bytes

```
def s(g):H,N,L,R,X,Y,T,B=[int(c)-1for c in g];e='.oO-';print(' '*9+'_ _ ___ _ _\n\n\n\n    _. (=./_=._*=.\\__. )')[H::4]+'\n'+' \\  '[X]+'('+e[L]+',._ '[N]+e[R]+')'+' /  '[Y]+'\n'+'< / '[X]+"("+' ]> :    [< '[T::4]+')'+'> \\ '[Y]+'\n ('+' "_ : _  "_ '[B::4]+")"

```

Calling `s('33232124')` gives:

```
   _
  /_\
\(o_O)
 (] [)>
 (   )

```

But my favorites are `44242123` and `41341144`:

```
  ___      ___
 (_*_)    (_*_)
\(o -)    (O,-)
 (] [)>  <(   )>
 (___)    (   )

```

# Answer
> 22 votes
# TI-BASIC, 397 bytes

**Important:** If you want to test this out, download it from here and send that file to your calculator. Do *not* try to copy the code below into TI-Connect CE's program editor or SourceCoder 3 or something to build and send it to your calculator; in TI-Connect's case, it'll say it has an invalid token. SC3 uses the backslash as a comment delimiter (`//` starts a comment in SC3; `/\/`, though, will export as `//`) and so it won't export the arms and hat and such correctly, causing the program to both display the incorrect body parts and throw an ERROR:DOMAIN every now and then. Fun stuff!

**Important #2:** I'm too lazy to fix the download at the moment, so when you transfer it to your calc, change the `7` on the third line from the bottom to `X+6`. The code below is fixed if you need to compare.

```
Input Str9
seq(inString("1234",sub(Str9,I,1)),I,1,length(Ans→L1
"      ___   _   ___ →Str1
"_===_..... /_\ (_*_)→Str2
",._ →Str3
"•oO-→Str4
"<\/ →Str5
">/\ →Str6
" : ] [> <   →Str7
" : ¨ ¨___   →Str8
"Str1Str2Str3Str4Str5Str6Str7Str8→Str0
For(X,3,5
Output(X,2,"(   )
End
L1
Output(3,3,sub(Str4,Ans(3),1)+sub(Str3,Ans(2),1)+sub(Str4,Ans(4),1
Ans(5
Output(4-(Ans=2),1,sub(Str5,Ans,1
L1(6
Output(4-(Ans=2),7,sub(Str6,Ans,1
L1-1
For(X,1,2
Output(X+3,3,sub(expr(sub(Str0,X+6,1)),1+3Ans(X+6),3
Output(X,2,sub(expr(sub(Str0,X,1)),1+5Ans(1),5
End

```

**Bonus:** I'm particularly fond of `12341214`.

```
 _===_
 (O.-)/
<( : )
 (   )

```

Some notes:

* It can definitely be golfed more, no question about that. I'm nearly positive that I can combine a majority, if not all, of the outputting into a single For( loop. Also, I'm pretty sure that I can merge some strings together.
* In Str4 (the eyes) I use the "plot dot" (`[2ND] → [0]CATALOG → [3]θ → scroll down, it's between ﹢ (small plus) and · (interpunct)`) as opposed to a period so that the eyes don't line up with the comma, because that looks weird as hell.
* In Str8 (base) I had to use a diaeresis (¨) instead of double quotes because there's no way to escape characters in TI-BASIC, and double quotes are used to start/end strings.
* In TI-BASIC, there's no need to close parentheses and brackets if they're followed by a colon, newline or → (used for var assignment), and double quotes (strings) can stay unclosed when followed by a newline or →.

# Answer
> 21 votes
# CJam, ~~150~~ 145 bytes

Base convert **all** the things!

```
"b8li'
U9gN;|"125:Kb8bl:~f="r  pL|P3{cR`@L1iT"Kb21b"G.HMtNY7VM=BM@$^$dX8a665V"KbFb"=_./ <[(*-oO,\":"f=_"/<[(""\>])"er+4/f=.=7/N*

```

SE mangles unprintables, so here is a copy on Pastebin. Make sure you copy the "RAW Paste Data" part, not the part next to line numbers. You can try it online, but the permalink may not work in some browsers.

## Explanation

The `"b8li'U9gN;|"125:Kb8bp` part generates the array

```
[1 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 2 1 3 0 5 4 0 6 6 6 0 5 0 0 7 7 7 0]

```

which maps each digit of the input to where the digit is used. Anything which is common to all inputs (e.g. leading spaces and `()`) is arbitrarily assigned a 0, except the first which is assigned 1 so that base convert can work.

`l:~f=` then converts each digit to an int and maps accordingly, e.g. for `14441133` we get

```
[2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 2 4 1 2 1 1 3 3 3 1 2 1 1 4 4 4 1]

```

`"G.HMtNY7VM=BM@$^$dX8a665V"KbFb"=_./ <[(*-oO,\":"f=` gives the string

```
"_=./  /  < /  [<(((((_. _ _     _ __*=._-.oO ,._  \"_ :   : _"

```

after which we duplicate, replace `/<[(` with `\>])` and append to give a long string. Then we split the string into groups of 4 and map according to another array `"r pL|P3{cR`@L1iT"Kb21b`, thus getting an array of length-4 strings describing all possible options at each cell (e.g. `_=./` is all possible options for the second character on the second line, starting from the Russian hat).

Finally we map the options to the inputs accordingly `.=`, split into rows of length 7 `7/` and riffle in some newlines `N*`.

## Test runs

```
11111111

 _===_
 (.,.)
<( : )>
 ( : )

22222222
  ___
 .....
\(o.o)/
 (] [)
 (" ")

33333333
   _
  /_\
 (O_O)
/(> <)\
 (___)

44444444
  ___
 (_*_)
 (- -)
 (   )
 (   )

```

# Answer
> 18 votes
# C, ~~280 272~~ 264 bytes

Only partially golfed at this point, but this is a fun challenge.

```
#define P(n)[s[n]&3],
f(char*s){printf("  %.3s\n %.5s\n%c(%c%c%c)%c\n%c(%.3s)%c\n (%.3s)",
"___   ___ _"+*s%4*3,"(_*_)_===_..... /_\\"+*s%4*5,"  \\ "P(4)"-.o0"P(2)
" ,._"P(1)"-.o0"P(3)"  /"P(5)" < /"P(4)"    : ] [> <"+s[6]%4*3," > \\"P(5)
"    : \" \"___"+s[7]%4*3);}

```

(With some extra \n for readability.) I expect the `define` should go away with further golfing.

A more readable version is

```
#define P(n)[s[n]&3],
f(char *s) {
  printf("  %.3s\n"
         " %.5s\n"
         "%c(%c%c%c)%c\n"
         "%c(%.3s)%c\n"
         " (%.3s)",
         "___   ___ _"+*s%4*3,                  /* Top of hat. */
         "(_*_)_===_..... /_\\"+*s%4*5,         /* Lower hat. */
         "  \\ "P(4)                            /* Upper left arm. */
         "-.o0"P(2)                             /* Left eye. */
         " ,._"P(1)                             /* Nose. */
         "-.o0"P(3)                             /* Right eye. */
         "  /"P(5)                              /* Upper right arm. */
         " < /"P(4)                             /* Lower left arm. */
         "    : ] [> <"+s[6]%4*3,               /* Torso. */
         " > \\"P(5)                            /* Lower right arm. */
         "    : \" \"___"+s[7]%4*3              /* Base. */
         );
}

```

# Answer
> 13 votes
# C, 212 bytes

```
d;main(){char*t="##3#b#b3#bbb3#b#b##\r#3b1#+3@12b3@1b-3@1_b3b1#,#\r7#_##+51rR04/1b#61rR0,8#2##\r7?#2#+9#`A#9=###9#^?#,8A#_#\r#+:#%b#:=#b#:#%b#,#",p[9];for(gets(p);d=*t++;putchar(d-3))d=d<51?d:(p[d-51]-53)[t+=4];}

```

A readable version:

```
d;
main()
{
    char *t = "##3#b#b3#bbb3#b#b##\r"
              "#3b1#+3@12b3@1b-3@1_b3b1#,#\r"
              "7#_##+51rR04/1b#61rR0,8#2##\r"
              "7?#2#+9#`A#9=###9#^?#,8A#_#\r"
              "#+:#%b#:=#b#:#%b#,#",
        p[9]; // 9 bytes is just enough for the input string of length 8

    for (gets(p); d = *t++; putchar(d-3))
        d = d < 51 ? d : (p[d - 51] - 53)[t += 4];
}

```

I took the idea from the answer by Reto Koradi. There were several fun improvements I did, which may warrant posting a separate answer:

* Converted from function to program (+10)
* Moved newlines into the control string (-7)
* Added 3 to all character codes to have fewer escaped chars like `\"` (-3)
* Reading from the string with autoincrement; also replaced `t[i++]` by `*t++` (-4)
* Replaced `while` by `for`; removed `{}` (-4)
* Simplified loop termination: reading until `\0` (-9)
* Transformed `t[...],t+=4` to `(...)[t+=4]` to eliminate the comma operator (-1)

Why all that trouble? To share my favorite one, snow ghost:

```
   _
  /_\
\(. .)/
 (   )
 (___)

```

# Answer
> 10 votes
# JavaScript, 489 (without newlines and tabs)

```
x=' ';
d="   ";
h=['\n_===_',' ___ \n.....','  _  \n /_\\ ',' ___ \n(_*-)'];
n=[',','.','_',x];
e=['.','o','O','-'];
y=['>',,'\\',x];
u=['<',,'/',x];
t=[' : ','[ ]','> <',d;
b=[' : ','" "',"___",d];

j=process.argv[2].split('').map(function(k){return parseInt(k)-1});
q=j[4]==1;
w=j[5]==1;

console.log([
    h[j[0]].replace(/(.*)\n(.*)/g, " $1\n $2"),
    (q?'\\':x)+'('+e[j[2]]+n[j[1]]+e[j[3]]+')'+(w?'/':x),
    (!q?u[j[4]]:x)+'('+t[j[6]]+')'+(!w?y[j[5]]:x),
    x+'('+b[j[7]]+')'].join('\n'));

```

run with `node snowman.js 33232124`

# Answer
> 9 votes
# Pyth, 203 bytes

```
M@GCHgc"  ___

  ___
   _"bhzgc" (_*_)
 _===_
 .....
  /_\\"bhzs[g"  \ "@z4\(g"-.oO"@z2g" ,._"@z1g"-.oO"@z3\)g"  / "@z5)s[g" < /"@z4\(gc"
 :
] [
> <"b@z6\)g" > \\"@z5)++" ("gc"
 :
\" \"
___"bez\)

```

Lol. Try it online: Pyth Compiler/Executor

### Explanation

First I define a helper function `g`, which takes a list and a char as input, converts the char into its ASCII-value and takes correspondent element (modular wrapping).

```
M@GCH  def g(G,H): return G[ord(H)]

```

The other things is just printing line by line. For instance the first line is:

```
 c"  ___\n\n  ___\n   _"b     split the string "  ___\n\n  ___\n   _" at "\n"
                         hz   first char in input
g                             apply g and print

```

Btw. I experimented a little bit with `.F"{:^7}"`, which centers a string. Using it, I could save a few spaces in my code, but it doesn't save any bytes at the end.

# Answer
> 9 votes
# R, ~~436~~ 437 bytes

Here's my first try on , using R which isn't the shortest but still fun. At least I'm beating JavaScript (for now)...

```
H=c("_===_"," ___\n .....","  _\n  /_\\"," ___\n (_*_)")
N=c(",",".","_"," ")
L=c(".","o","O","-")
X=c(" ","\\"," "," ")
S=c("<"," ","/"," ")
Y=c(" ","/"," ","")
U=c(">"," ","\\","")
T=c(" : ","] [","> <","   ")
B=c(" : ","\" \"","___","   ")
f=function(x){i=as.integer(strsplit(x,"")[[1]]);cat(" ",H[i[1]],"\n",X[i[5]],"(",L[i[3]],N[i[2]],L[i[4]],")",Y[i[6]],"\n",S[i[5]],"(",T[i[7]],")",U[i[6]],"\n"," (",B[i[8]], ")",sep="")}

```

Testing:

```
> f("12344321")
 _===_
 (O.-)
 (] [)\
 ( : )

```

I actually struggled with `X` and `Y` being multilined but with stuff in between, ended up separating each line in (`X`, `S`) and (`Y`, `U`).

`function` and conversion from string to integer are also very verbose.

**Edit 436 =\> 437**

Had to fix a missing empty space noticed by @OganM

I could reduce to 428 replacing the line breaks between variables with `;`, but the "one-lined" code looks so bad and unreadable I won't be that greedy.

# Answer
> 9 votes
# Haskell, ~~361~~ ~~306~~ 289 bytes

```
o l a b=take a$drop((b-1)*a)l
n="\n"
p i=id=<<["  ",o"    \n _===____ \n ..... _  \n  /_\\ ___ \n (_*_)"11a,n,o" \\  "1e,o"(.(o(O(-"2c,o",._ "1 b,o".)o)O)-)"2d,o" /  "1f,n,o"< / "1e,o"( : )(] [)(> <)(   )"5g,o"> \\ "1f,n," (",o" : )\" \")___)   )"4h]where[a,b,c,d,e,f,g,h]=map(read.(:[]))i

```

Usage:

```
putStrLn $ p "12333321"

 _===_
 (O.O)
/(] [)\
 ( : )

```

How it works: index every element of the list of `[hat options, left upper arm options, left eye options, ..., base options]` with the corresponding input number and concatenate it into a single list. I've split the left and right arm into an upper and lower part, so that I can build the snowman line by line.

My favorite is the classic `11112211`.

Edit: switched from list of strings to strings for the parts (hat, eye, ...). Needs a second parameter, the length of the substring to take.

Edit II: extracted common substrings

# Answer
> 9 votes
# PowerShell, 199 bytes

Inspired by Reto Koradi and anatolyg.

```
for($t='  0 _ _0 ___0 _ _
 0_. (0=./_0=._*0=.\_0_. )
4 \  (2.oO-1,._ 3.oO-)5 /
4< / (6 ]> 6:   6 [< )5> \
 (7 "_ 7: _ 7 "_ )';$d=$t[$i++];$r+="$d"){if($d-ge48){$d=$t[$i+"$args"["$d"]-49]
$i+=4}}$r

```

Try it online!

Note: The line 3 has 2 trail spaces, line 4 has a trail space.

My favorite is `44444444` "sleepy russian guard":

```
 ___
(_*_)
(- -)
(   )
(   )

```

# Answer
> 8 votes
# CJam, ~~200~~ 191 bytes

This can surely be golfed a lot. (Specially if I base encode it). But here goes for starters:

```
7S*"_===_  ___  .....   _    /_\   ___  (_*_)"+6/2/Nf*",._ "1/".oO-"1/_" <\  /   >/  \  "2/4/~" : ] [> <    : \" \"___   "3/4/~]l~Ab:(]z::=:L0=N4{L=}:K~0='(2K1K3K')5K0=N4K1='(6K')5K1=NS'(7K')

```

Input goes into STDIN. For example, input `23232223` gives:

```
  ___
 .....
\(o_O)/
 (] [)
 (___)

```

Try it online here

# Answer
> 8 votes
# Python 3, ~~349~~ ~~336~~ ~~254~~ 251 bytes

So much for doing my thesis.

Here's the content of the file *snowman.py*:

```
l='_===_| ___\n .....|  _\n  /_\| ___\n (_*_)| : |] [|> <|   |>| |\| | : |" "|___|   '.split('|')
l[4:4]=' \  .oO-,._ .oO- /  < / '
def s(a):print(' {}\n{}({}{}{}){}\n{}({}){}\n ({})'.format(*[l[4*m+int(a[int('0421354657'[m])])-1]for m in range(10)]))

```

And this is how I conjure my favourite snowman:

```
s('11112311')

 _===_
\(.,.)
 ( : )\
 ( : )

```

## Explanation

```
# Create a list containing the 4 * 10 body parts of the snowman in order of drawing:
#   hats,
#   upper left arms, left eyes, noses, right eyes, upper right arms,
#   lower left arms, torso's, lower right arms,
#   bases
l='_===_| ___\n .....|  _\n  /_\| ___\n (_*_)| : |] [|> <|   |>| |\| | : |" "|___|   '.split('|')
l[4:4]=' \  .oO-,._ .oO- /  < / '
# This is the function that draws the snowman
# All the lines of this function are golfed in a single statement, but seperated here for clearity
def s(a):
    # In this list comprehension I put the elements of l that are chosen according to the parameters
    list_comprehension = []
    # m is the number of the body part to draw
    for m in range(10):
        # Get the index for the choice of the m-th bodypart
        # (example: the 2nd bodypart (m = 1: the upper left arm) is in the 4th place of the arguments list)
        choice_index = int('0421354657'[m])
        # n is the parameter of the current bodypart
        n = int(a[choice_index]) - 1
        # Add the body part from list l to the list comprehenseion
        list_comprehension.append( l[4 * m + n] )
    # Print the list comprehension with the static parts
    print(' {}\n{}({}{}{}){}\n{}({}){}\n ({})'.format(*list_comprehension))

```

# Answer
> 8 votes
# R 414 Bytes

Slightly modified version of Molx's version

```
W =c("_===_"," ___\n .....","  _\n  /_\\"," ___\n (_*_)",",",".","_"," ",".","o","O","-"," ","\\"," "," ","<"," ","/"," "," ","/"," ","",">"," ","\\",""," : ","] [","> <","   "," : ","\" \"","___","   ")
f=function(x){i=as.integer(strsplit(x,"")[[1]]);cat(" ",W[i[1]],"\n",W[i[5]+12],"(",W[i[3]+8],W[i[2]+4],W[i[4]+8],")",W[i[6]+20],"\n",W[i[5]+16],"(",W[i[7]+28],")",W[i[6]+24],"\n"," (",W[i[8]+32], ")",sep="")}

```

Just merged the seperate variables into one. Shawing of some space that was used for `X=c(` routine.

# Answer
> 8 votes
## C, ~~233~~ 230 bytes

```
char*t="  0 _ _0 ___0 _ _   0_. (0=./_0=._*0=.\\_0_. ) 4 \\  (2.oO-1,._ 3.oO-)5 /  4< / (6 ]> 6:   6 [< )5> \\  (7 \"_ 7: _ 7 \"_ ) ";i,r,d;f(char*p){while(r++<35){d=t[i]-48;putchar(t[d<0?i:i+p[d]-48]);i+=d<0?1:5;r%7?0:puts("");}}

```

With newlines and whitespace for better readability:

```
char* t = "  0 _ _0 ___0 _ _   0_. (0=./_0=._*0=.\\_0_. ) 4 \\  (2.oO-1,._ 3.oO-)5 /  4< / (6 ]> 6:   6 [< )5> \\  (7 \"_ 7: _ 7 \"_ ) ";
i, r, d;
f(char* p)
{
    while (r++ < 35)
    {
        d = t[i] - 48;
        putchar(t[d < 0 ? i : i + p[d] - 48]);
        i += d < 0 ? 1 : 5;
        r % 7 ? 0 : puts("");
    }
}

```

The whole thing is fairly brute force. It uses a table that contains one entry for each of the 35 (5 lines with length 7) characters. Each entry in the table is either:

* A constant character: , `(`, `)`. Length of table entry is 1 character.
* Index of body part, followed by the 4 possible characters depending on the part selection in the input. Length of table entry is 5 characters.

The code then loops over the 35 characters, and looks up the value in the table.

# Answer
> 7 votes
# Haskell, 333 bytes

My first submission! Builds the snowman from top to bottom, left to right. I split the arms into two functions for each arm, the part next to head and the part next to the body.

The function s takes a list of integers and concatenates the output of the functions which produce the body parts given correct sublists of the input.

```
a=y["\n _===_\n","  ___ \n .....\n","   _  \n  /_\\ \n","  ___ \n (_*_)\n"]
d=y",._ "
c=y".oO-"
e=y"< / "
j=y" \\  "
f=y"> \\ "
k=y" /  "
y w n=w!!(n-1)
h=y[" : ","] [","> <","   "]
b=y[" ( : ) \n"," (\" \") \n"," (___) \n"," (   ) \n"]
s(m:x:o:p:n:q:t:l:_)=putStr$a m++j x:'(':c o:d n:c p:')':k q:'\n':e x:'(':h t++')':f q:'\n':b l

```

It relies on the function

```
y :: [a] -> Int -> a
y w n=w!!(n-1)

```

which returns the nth element of the list it is given. This allows for the list of hats in a, as well as things like

```
k=y" /  "

```

all of these functions use a beta reduction so their argument is passed as the index to the y function.

Output:

```
λ> s $ repeat 1

 _===_
 (.,.)
<( : )>
 ( : )

λ> s $ repeat 2
  ___
 .....
\(o.o)/
 (] [)
 (" ")

λ> s $ repeat 3
   _
  /_\
 (O_O)
/(> <)\
 (___)

λ> s $ repeat 4
  ___
 (_*_)
 (- -)
 (   )
 (   )

```

# Answer
> 5 votes
# JavaScript (ES6), 247

Not as good ad @NinjaBearMonkey's :(

Test in snippet (with Firefox)

```
S=p=>([h,n,c,d,l,r,t,b,e,x]=[...p,' .oO-',`1_===_1 ___
 .....1  _
  /_\\1 ___
 (_*_)1 : 1] [1> <1   1 : 1" "1___1   `.split(1)],` ${x[h]}
${'  \\  '[l]}(${e[c]+' ,._ '[n]+e[d]})${'  /  '[r]}
${' < / '[l]}(${x[3-~t]})${' > \\ '[r]}
 (${x[7-~b]})`)

// TEST //

function go()
{
  var n=N.value
  if (/^[1-8]{8}$/.test(n)) {
    s=S(n)
    OUT.innerHTML = s+'\n'+n+'\n\n'+ OUT.innerHTML
  }
  else N.focus()
}

```

```
<input id=N maxlength=8><button onclick="go()">Test</button>
<pre id=OUT></pre>
```

# Answer
> 3 votes
# 05AB1E, ~~137~~ ~~135~~ ~~128~~ ~~122~~ 121 bytes

```
…( )7ÝJ»•αγʒδÓ₂©8¥ŽQxΣxêÿ•sÅвJIvN”</[(
._-=:"ÆŸ,*”º•DùÙÂ+;Èγтáì³ÓW©ÎÂ_`ƒ≠îj*ΓçÊ~ÞÒ¸β¦oåb/õ47/vÎΓ”›≠øØZµλÝº•20вè¶¡Nè4äyè.;

```

-6 bytes thanks to *@Grimy*.

Try it online or verify a few more test cases.

**Explanation:**

We first create the template-string:

```
…( )         # Push string "( )"
7ÝJ          # Push a list in the range [0,7] joined together: "01234567"
»            # Join both by a newline: "( )\n01234567"
•αγʒδÓ₂©2°ćì₂òη₆½•
             # Push compressed integer 80545642885242518310229085147411483894
 s           # Swap to get the earlier created string at the top of the stack
  Åв         # Convert the large integer to base-"( )\n01234567",
             # which basically converts to base-length, and indexes into the string:
             #  [" ","0","0","0","0","0","\n"," ","0","0","0","0","0","\n","4","(","2","1","3",")","5","\n","4","(","6","6","6",")","5","\n"," ","(","7","7","7",")"]
    J        # And join it to a single string: " 00000\n 00000\n4(213)5\n4(666)5\n (777)"

```

Which looks like this:

```
 00000
 00000
4(213)5
4(666)5
 (777)

```

Then I loop over the digits of the input:

```
I            # Get the input
 v           # Loop `y` over each of its digits:

```

And do the following:
Push the (0-indexed) index `N` of the list:

```
  N          # Push the index of the loop

```

Push all possible parts as a list of character lists:

```
  ”</[(
  ._-=:"ÆŸ,*”
            "# Push dictionary string "</[(\n._-=:" Oo,*"
   º         # Mirror each line: "</[()]\>\n._-=:" Oo,**,oO ":=-_."
  •DùÙÂ+;Èγтáì³ÓW©ÎÂ_`ƒ≠îj*ΓçÊ~ÞÒ¸β¦oåb/õ47/vÎΓ”›≠øØZµλÝº•
             # Push compressed integer 492049509496347122906361438631265789982480759119518961177677313610613993948059787418619722816092858096158180892708001681647316210
   20в       # Convert it to Base-20 as list: [15,10,10,10,15,3,10,19,10,4,15,15,15,15,15,10,12,12,12,10,15,10,10,10,15,9,9,9,9,9,15,15,10,15,15,15,1,10,6,15,8,15,18,9,10,8,11,9,17,16,8,11,9,17,16,8,15,15,15,0,6,15,15,1,8,15,15,15,7,1,15,15,6,8,15,15,15,15,13,15,5,15,2,7,15,0,8,15,15,15,15,13,15,14,15,14,10,10,10]
      è      # Index each into the string: [" ","_","_","_"," ","(","_","*","_",")"," "," "," "," "," ","_","=","=","=","_"," ","_","_","_"," ",".",".",".",".","."," "," ","_"," "," "," ","/","_","\"," ","\n"," ",",",".","_","\n","-",".","o","O","\n","-",".","o","O","\n"," "," "," ","<","\"," "," ","/","\n"," "," "," ",">","/"," "," ","\","\n"," "," "," "," ",":"," ","]"," ","[",">"," ","<","\n"," "," "," "," ",":"," ","""," ",""","_","_","_"]
       ¶¡    # Split it by the newline character: [[" ","_","_","_"," ","(","_","*","_",")"," "," "," "," "," ","_","=","=","=","_"," ","_","_","_"," ",".",".",".",".","."," "," ","_"," "," "," ","/","_","\"," "],[" ",",",".","_"],["-",".","o","O"],["-",".","o","O"],[" "," "," ","<","\"," "," ","/"],[" "," "," ",">","/"," "," ","\"],[" "," "," "," ",":"," ","]"," ","[",">"," ","<"],[" "," "," "," ",":"," ","""," ",""","_","_","_"]]

```

Use the loop index `N` to get the character-list of the part we are currently working with:

```
  Nè         # Index the loop index into it
             #  i.e. 6 → [" "," "," "," ",":"," ","]"," ","[",">"," ","<"]

```

Then split the character list into four equal part, and use the input-digit `y` (which is 1-indexed) to index into it. (NOTE: Since 05AB1E is 0-indexed, but the input is 1-indexed, it would be logical to decrease the digit by 1 before indexing. However, since 05AB1E has automatic wraparound (i.e. indexing `3` in list `[1,3,5]` will result in `1`), I simply rotated the parts once so parts with nr 4 in the challenge description, are at the front of the lists.)

```
    4ä       # Split it into 4 equal parts
             #  i.e. [[" "," "," "],[" ",":"," "],["]"," ","["],[">"," ","<"]]
      yè     # Index the input-digit `y` into it (with automatic wraparound)
             #  i.e. 4 → [" "," "," "]

```

And then replace the 0-indexed index of the loop we pushed at first, one by one with the part-characters:

```
  .;         # Replace first; every index of the loop `N` in the template-string
             # is replaced one by one with the characters

```

And in the end the result is output implicitly.

See this 05AB1E tip of mine (section *How to compress large integers?* and *How to compress integer lists?*) to understand how the compression parts work.

---

As for my favorite, it's still the same 'snow rabbit' as 1.5 year ago when I posted my Java solution:

```
44114432:
   _
 (_*_)
 (. .)
 (> <)
 (" ")

```

# Answer
> 2 votes
# Java 8, ~~548~~ ~~545~~ ~~432~~ ~~401~~ ~~399~~ 397 bytes

```
a->{int q=50,H=a[0]-49,N=a[1],L=a[2],R=a[3],X=a[4],Y=a[5];return"".format(" %s%n %s%n%c(%c%c%c)%c%n%c(%s)%c%n (%s)",H<1?"":H%2<1?" ___":"  _","_===_s.....s /_\\s(_*_)".split("s")[H],X==q?92:32,L<q?46:L<51?111:L<52?79:45,N<q?44:N<51?46:N<52?95:32,R<q?46:R<51?111:R<52?79:45,Y==q?47:32,X<q?60:32+X%2*15,"   s : s] [s> <".split("s")[a[6]%4],92-(Y%3+Y%6/4)*30,"   s : s\" \"s___".split("s")[a[7]%4]);}

```

-2 bytes thanks to *@ceilingcat*.

Try it here.

**Explanation:**

```
a->{             // Method with character-array parameter and String return-type
  int q=50,      //  Temp integer with value 50 to reduce the byte-count
      H=a[0]-49, //  The hat-character as unicode value minus 49: 1=0; 2=1; 3=2; 4=3
      N=a[1],L=a[2],R=a[3],X=a[4],Y=a[5];
                 //  Most of the other characters as unicode values: 1=49; 2=50; 3=51; 4=52
  return"".format(" %s%n %s%n%c(%c%c%c)%c%n%c(%s)%c%n (%s)",
                                               // Return the snowman with:
    H<1?"":H%2<1?" ___":"  _",                 //  The top of the hat
    "_===_s.....s /_\\s(_*_)".split("s")[H],   //  + the bottom of the hat
    X==q?92:32,                                //  + the top of the left arm
    L<q?46:L<51?111:L<52?79:45,                //  + the left eye
    N<q?44:N<51?46:N<52?95:32,                 //  + the nose
    R<q?46:R<51?111:R<52?79:45,                //  + the right eye
    Y==q?47:32,                                //  + the top of the right arm
    X<q?60:32+X%2*15,                          //  + the bottom of the left arm
    "   s : s] [s> <".split("s")[a[6]%4],      //  + the torso
    92-(Y%3+Y%6/4)*30,                         //  + the bottom of the right arm
    "   s : s\" \"s___".split("s")[a[7]%4]);}  //  + the feet

```

**My favorite:**

```
44114432:
   _
 (_*_)
 (. .)
 (> <)
 (" ")

```

I don't know why, but it looks kinda cute. Like a bunny with a Russian hat instead of ears.

# Answer
> 2 votes
# C# 9.0 (.NET 4.8) - ~~1813 1803 1821 1815~~ 1812+30=~~1843 1833 1851 1845~~ 1842 bytes

A Windows Forms application; likely can be improved on in terms of size. Contains a massive one-liner. The extra 30 bytes is from adding `<LangVersion>9.0</LangVersion>` to the project file.

```
using System;using System.Windows.Forms;class P:Form{string[]h={$@"
_===_",$@"___
.....",$@"_
/_\",$@"___
(_*_)"},s={" : ","] [","> <","   "},z={" : ","\" \"","___","   "};string n=",._ ",e=".oO-",x="< / ",y="> \\ ";TextBox t;Button b,d;Label l;[STAThread]static void Main(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Application.Run(new P());}P(){t=new();b=new();d=new();l=new();SuspendLayout();t.Location=new(0,0);t.MaxLength=8;t.Size=new(269,23);t.TabIndex=0;b.Location=new(-1,22);b.Size=new(200,25);b.TabIndex=1;b.Text="Build the snowman!";b.UseVisualStyleBackColor=true;b.Click+=m;d.Location=new(198,22);d.Size=new(72,25);d.TabIndex=2;d.Text="Random";d.UseVisualStyleBackColor=true;d.Click+=(_,_)=>{int a=0;Random r=new();for(int i=0;i<8;i++)a+=r.Next(1,5)*(int)Math.Pow(10,i);m(a.ToString(),null);};l.AutoSize=false;l.Font=new("Consolas",9);l.Location=new(0,41);l.Size=new(269,73);l.TextAlign=System.Drawing.ContentAlignment.MiddleCenter;Font=new("Segoe UI",9);ClientSize=new(269,114);Controls.Add(l);Controls.Add(t);Controls.Add(b);Controls.Add(d);MaximizeBox=false;FormBorderStyle=FormBorderStyle.FixedSingle;Text="Snowman Maker";l.SendToBack();t.BringToFront();ResumeLayout(true);}void m(object q,EventArgs k){t.Enabled=false;b.Enabled=false;d.Enabled=false;if(q is string j)t.Text=j;if(t.Text.Length!=8||!int.TryParse(t.Text,out _))MessageBox.Show("Invalid input format.");else{int[]a=new int[8];for(int i=0;i<8;i++){a[i]=t.Text[i]-'0'-1;if(a[i]>3){MessageBox.Show("Invalid input format.");t.Enabled=true;b.Enabled=true;d.Enabled=true;return;}}l.Text=$@"{h[a[0]]}
{(a[4]==1?'\\':' ')}({e[a[2]]}{n[a[1]]}{e[a[3]]}){(a[5]==1?'/':' ')}
{x[a[4]]}({s[a[6]]}){y[a[5]]}
({z[a[7]]})";}t.Enabled=true;b.Enabled=true;d.Enabled=true;}}

```

A more readable version, with comments (though with the same confusing variable naming):

```
using System;
using System.Windows.Forms;
class Program : Form
{
    string[] h = {$@"
_===_",$@"___
.....",$@"_
/_\",$@"___
(_*_)"}, // Hats
    s = {" : ","] [","> <","   "}, // Torso
    z = {" : ","\" \"","___","   "}; // Base
    string n = ",._ ", e = ".oO-", x = "< / ", y = "> \\ "; // Nose, eyes, left arm, right arm
    //Controls
    TextBox t;
    Button b, d;
    Label l;
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.Run(new Program()); // I put all the control code in Program; please don't do this in normal code
    }
    Program()
    {
        // Initialize everything
        t = new(); // Taking advantage of the short contructors in C# 9.0
        b = new();
        d = new();
        l = new();
        SuspendLayout();
        // TextBox properties
        t.Location = new(0, 0);
        t.MaxLength = 8;
        t.Size = new(269, 23);
        t.TabIndex = 0;
        // 'Build the snowman' button properties
        b.Location = new(-1, 22);
        b.Size = new(200, 25);
        b.TabIndex = 1;
        b.Text = "Build the snowman!";
        b.UseVisualStyleBackColor = true;
        b.Click += m;
        // 'Random' button properties
        d.Location = new(198,22);
        d.Size = new(72,25);
        d.TabIndex = 2;
        d.Text = "Random";
        d.UseVisualStyleBackColor = true;
        d.Click += (_,_) =>
        {
            int a = 0;
            Random r = new();
            for(int i = 0; i < 8; i++)
                a += r.Next(1,5) * (int)Math.Pow(10,i); // Math.Pow returns a number that satisfies 1 <= n < 5, not 1 <= n <= 5
            m(a.ToString(), null); // Since I don't need the "sender" field, I use it to send the random input. Please don't do this in a normal program.
        };
        // Label properties
        l.AutoSize = false;
        l.Font = new("Consolas", 9);
        l.Location = new(0, 41);
        l.Size = new(269, 73);
        l.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // This lets us omit some spaces, while making the form look nicer as well
        // Form properties
        Font = new("Segoe UI", 9);
        ClientSize = new(269, 114);
        Controls.Add(l);
        Controls.Add(t);
        Controls.Add(b);
        Controls.Add(d);
        MaximizeBox = false;
        FormBorderStyle=FormBorderStyle.FixedSingle;
        Text="Snowman Maker";
        l.SendToBack();
        t.BringToFront();
        ResumeLayout(true);
    }
    // Event handler for the 'Build the snowman' button
    void m(object sender, EventArgs k)
    {
        // Disable all the inputs, in case the user tries to mess with the data while the function is running.
        // This is probably unneeded since modern computers run so quickly, but I kept it anyway.
        t.Enabled = false;
        b.Enabled = false;
        d.Enabled = false;
        if(sender is string j) // Accept input from 'Random' button
            t.Text=j;
        if(t.Text.Length != 8|| !int.TryParse(t.Text, out _)) // Discard the out parameter since we don't need it
            MessageBox.Show("Invalid input format.");
        else
        {
            int[] a = new int[8];
            // Read from the TextBox.
            for (int i = 0; i < 8; i++)
            {
                a[i] = t.Text[i] - '0' - 1;
                if(a[i] > 3)
                {
                    MessageBox.Show("Invalid input format.");
                    // Re-enable the inputs and cancel the operation.
                    t.Enabled = true;
                    b.Enabled = true;
                    d.Enabled = true;
                    return;
                }
            }
            // Set the label text; uses an interpolated multiline string ($ makes it interpolated, @ makes it accept newlines and automatically escape characters (excluding " ))
            l.Text=$@"{h[a[0]]}
{((a[4] == 1) ? '\\' : ' ')}({e[a[2]]}{n[a[1]]}{e[a[3]]}){((a[5] == 1) ? '/' : ' ')}
{x[a[4]]}({s[a[6]]}){y[a[5]]}
({z[a[7]]})";
        }
        t.Enabled = true;
        b.Enabled = true;
        d.Enabled = true;
    }
}

```

The compact version was so painful to edit (I absolutely hate scrolling left and right) that I split it into a lot of lines and removed the unnecessary newlines after I was done with it:

```
using System;using System.Windows.Forms;class P:Form{string[]h={$@"
_===_",$@"___
.....",$@"_
/_\",$@"___
(_*_)"},s={" : ","] [","> <","   "},z={" : ","\" \"","___","   "};string n=",._ ",e=".oO-",x="< / ",y="> \\ ";TextBox t;
Button b,d;Label l;[STAThread]static void Main(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new P());}P(){t=new();b=new();d=new();l=new();SuspendLayout();t.Location=new(0,0);t.MaxLength=8;t.Size=new(269,23
);t.TabIndex=0;b.Location=new(-1,22);b.Size=new(200,25);b.TabIndex=1;b.Text="Build the snowman!";b.UseVisualStyleBackColor=true;b.Click+=m;d.
Location=new(198,22);d.Size=new(72,25);d.TabIndex=2;d.Text="Random";d.UseVisualStyleBackColor=true;d.Click+=(_,_)=>{int a=0;Random r=new();
for(int i=0;i<8;i++)a+=r.Next(1,5)*(int)Math.Pow(10,i);m(a.ToString(),null);};l.AutoSize=false;l.Font=new("Consolas",9);l.Location=new(0,41);
l.Size=new(269,73);l.TextAlign=System.Drawing.ContentAlignment.MiddleCenter;Font=new("Segoe UI",9);ClientSize=new(269,114);Controls.Add(l);
Controls.Add(t);Controls.Add(b);Controls.Add(d);FormBorderStyle=FormBorderStyle.FixedSingle;MaximizeBox=false;Text="Snowman Maker";l.
SendToBack();t.BringToFront();ResumeLayout(true);}void m(object q,EventArgs k){t.Enabled=false;b.Enabled=false;d.Enabled=false;if(q is string
j)t.Text=j;if(t.Text.Length!=8||!int.TryParse(t.Text,out _))MessageBox.Show("Invalid input format.");else{int[]a=new int[8];for(int i=0;i<8;
i++){a[i]=t.Text[i]-'0'-1;if(a[i]>3){MessageBox.Show("Invalid input format.");t.Enabled=true;b.Enabled=true;d.Enabled=true;return;}}l.Text=$@"{h[a[0]]}
{(a[4]==1?'\\':' ')}({e[a[2]]}{n[a[1]]}{e[a[3]]}){(a[5]==1?'/':' ')}
{x[a[4]]}({s[a[6]]}){y[a[5]]}
({z[a[7]]})";}t.Enabled=true;b.Enabled=true;d.Enabled=true;}}

```

To run this code, make a Windows Forms Application project in Visual Studio for .NET Framework 4.8 (or whatever editor you use for C#), remove Form1.cs and delete it from the project, save the project, and add `<LangVersion>9.0</LangVersion>` to the project file. Then, you can copy the code into Program.cs (overwrite everything) and run it.

# Answer
> 1 votes
# F#, 369 bytes

```
let f(g:string)=
 let b=" "
 let p=printfn
 let i x=int(g.[x])-49
 p"  %s  "["";"___";" _ ";"___"].[i 0]
 p" %s "["_===_";".....";" /_\ ";"(_*_)"].[i 0]
 p"%s(%c%c%c)%s"[b;"\\";b;b].[i 4]".oO-".[i 2]",._ ".[i 1]".oO-".[i 3][b;"/";b;b;b].[i 5]
 p"%s(%s)%s"["<";b;"/";b].[i 4][" : ";"] [";"> <";"   "].[i 6][">";b;"\\";b].[i 5]
 p" (%s) "[" : ";"\" \"";"___";"   "].[i 7]

```

Try it online!

Because `g` uses an array accessor, I need to explicitly specify the type in the function definition as a `string`, which is why the function definition has `(g:string)`.

Apart from that, it's usually an array of `strings` accessed by an index. The hat, left and right arms which would go on separate lines are split into separate top and bottom arrays. The `i` function changes a number in the argument `g` into the array index. And the letter `b` replaces the one-space strings in the arrays.

Great challenge! My favourite snowman is probably `242244113`:

```
  ___
 .....
 (o o)
 ( : )
 ( : )

```

im watching you

# Answer
> 1 votes
# PHP, 378 bytes

```
<?$f=str_split;$r=$f($argv[1]);$p=[H=>'   _===____..... _  /_\ ___(_*_)',N=>',._ ',L=>'.oO-',R=>'.oO-',X=>' <\  /  ',Y=>' >/  \  ',T=>' : ] [> <   ',B=>' : " "___   '];echo preg_replace_callback("/[A-Z]/",function($m){global$A,$p,$r,$f;$g=$m[0];return$f($f($p[$g],strlen($p[$g])/4)[$r[array_search($g,array_keys($p))]-1])[(int)$A[$g]++];},'  HHH
 HHHHH
X(LNR)Y
X(TTT)Y
 (BBB)');

```

Try it online!

I like wise Mr. Owl `31333342`

```
   _
  /_\
 (O,O)
/(   )\
 (" ")

```

# Answer
> 1 votes
## Python 2.7, 257 bytes (i think)

```
H,N,L,R,X,Y,T,B=map(int,i)
l='\n'
s=' '
e=' .o0-'
F='  \  / '
S=' < / \ >'
o,c='()'
print s+'      _ _ ___ _ _\n\n\n\n    _. (=./_=._*=.\__. )'[H::4]+l+F[X]+o+e[L]+' ,._ '[N]+e[R]+c+F[-Y]+l+S[X]+o+'  ]> :    [< '[T::4]+c+S[-Y]+l+s+o+'  "_ : _  "_ '[B::4]+c

```

where 'i' is the input as an string (e.g "13243213")

# Answer
> 1 votes
# Clojure (~~407~~ 402 bytes)

```
(defn a[s](let[[H N L R X Y T B](into[](map #(-(int %)49)(into[]s)))h(["""  ___""   _""  ___"]H)i([" _===_"" .....""  /_\\"" (_*_)"]H)n([","".""_"" "]N)e[".""o""O""-"]l([" ""\\"" "" "]X)m(["<"" ""/"" "]X)r(["""/"""""]Y)u([">""""\\"""]Y)t([" : ""] [""> <""   "]T)b([" : ""   ""___""   "]B)d(["""\" \""""""]B)f(str \newline)](str h f i f l "(" (e L) n (e R) ")" r f m "(" t ")" u f " (" b ")" f "  " d)))

```

Hopefully that's clear to everyone.

And if not...

Ungolfed version:

```
(defn build-a-snowman [s]
  (let [ [H N L R X Y T B] (into [] (map #(- (int %) 49) (into [] s)))
         hat1     ([""       "  ___"  "   _"   "  ___" ] H) ; first line of hats
         hat2     ([" _===_" " ....." "  /_\\" " (_*_)"] H) ; second line of hats
         nose     ([","      "."      "_"      " "     ] N)
         eye      ["."      "o"      "O"      "-"     ]
         left1    ([" "      "\\"     " "      " "     ] X) ; left arm, upper position
         left2    (["<"      " "      "/"      " "     ] X) ; left arm, lower position
         right1   ([""       "/"      ""       ""      ] Y) ; right arm, upper position
         right2   ([">"      ""       "\\"     ""      ] Y) ; right arm, lower position
         torso    ([" : "    "] ["    "> <"    "   "   ] T)
         base1    ([" : "    "   "    "___"    "   "   ] B) ; first line of base
         base2    ([""       "\" \""  ""       ""      ] B) ; second line of base
         nl       (str \newline) ]
    (str hat1 nl
         hat2 nl
         left1 "(" (eye L) nose (eye R) ")" right1 nl
         left2 "(" torso ")" right2 nl
         " (" base1 ")" nl
         "  " base2)))

```

Tests:

```
(println (a "33232124"))  ; waving guy with fez
(println (a "11114411"))  ; simple ASCII-art snowman
(println (a "34334442"))  ; mouse
(println (a "41214433"))  ; commissar with monocle
(println (a "41212243"))  ; commissar celebrating success of five-year plan
(println (a "41232243"))  ; commissar after too much vodka

```

My favorite:

34334442 - mouse

Try it online!

# Answer
> 0 votes
# Dart, 307 bytes

```
f(i,{r='.o0-',s=' : '}){i=i.split('').map((j)=>int.parse(j)-1).toList();return' ${['_===_',' ___ \n.....',' /_\\ ',' ___ \n (_*_)'][i[0]]}\n${' \\  '[i[4]]}(${r[i[2]]+',._ '[i[1]]+r[i[3]]})${' /  '[i[5]]}\n${'< /  '[i[4]]}(${[s,'] [','> <','  '][i[6]]})${'> \\ '[i[5]]}\n (${[s,'" "','___','   '][i[7]]})';}

```

Try it online!

# Answer
> 0 votes
# Zsh, 247 bytes

try it online!!

```
(){H='_===_h ___
 .....h  _
  /_\h ___
 (_*_)'
W=' \  ' L=.oO- N=,._\  Y=' /  '
X='< / ' T=' : ] [> <   ' Z='> \ '
B=' : " "___   '
<<<" ${H[(ws:h:)$1]}
$W[$5]($L[$3]$N[$2]$L[$4])$Y[$6]
$X[$5](${T:3*($7-1):3})$Z[$6]
 (${B:3*($8-1):3})"
} ${(s::)1}

```

fav snowman:

```
43232122 Cossack dancer
  ___
 (_*_)
\(o_O)
 (] [)>
 (" ")

```

---
Tags: code-golf, string, ascii-art
---


title: I before E, except after C

text:
# Question
Title: I before E, except after C
You may be aware of the famous old rhyme, *"I before E, except after C"*. It is a rule taught to aid in the spelling of certain English words.

Quoting Wikipedia:

> If one is not sure whether a word is spelled with the digraph *ei* or *ie*, the rhyme suggests that the correct order is *ie* unless the preceding letter is *c*, in which case it is *ei*.

It is well known that this rule is not always correct (e.g. `weird`, `leisure`, `ancient`). That is why you will be asked to write an algorithm which accurately determines the spelling of these words.

## Task

The following wordlist (found here) consists of 2967 valid words, each of which contains either `ei` or `ie` as a substring.

The input is a single word \\$ w \\$ from the wordlist, **but the `ie`s and `ei`s may be flipped** (all occurrences of `ie` are replaced with `ei`, and vice versa). You are to output a boolean value indicating whether \\$ w \\$ was flipped. The values do not need to be `True` and `False`, so long as they are consistent. Your program must work correctly for all words, including their flipped counterparts (for a total of 5934 cases to consider). Here I've provided of a list of all possible test cases.

**Note that you are not given this list as input.** You must find a way to determine, for any word in the list, whether or not it is flipped but you cannot take the list itself as input.

Just to clarify, no word in the wordlist contains `iei` or `eie` as a substring, nor do a word and its flipped version both exist in the wordlist. As such, these ambiguous cases do not need to be considered. However, words such as `friendlier` or `eighties` which contain more than one occurrence of `ei` or `ie` do exist in the wordlist, in which case both occurrences are flipped (`friendlier` -\> `freindleir`, `eighties` -\> `ieghteis`).

Since this is , the shortest code in bytes wins.

*As a side note, simply applying the "I before E, except after C" rule will be correct for `4954/5934` of the cases.*

# Answer
# JavaScript (ES6), 338 bytes

A regex-based solution. This can probably be optimized some more.

Returns `0` (not flipped) or `1` (flipped).

```
w=>/dief|egh|etei|it?ei/.test(w)|/^(a?th0[rs]|d0st|r?0|h0r?[1s]|w0r)|b0[gt]|c0(l|t[es1]|v)|cl01|d0(f|n[1es]|ra|tie|ty)|0([aijop]|c1|[df]o|g[hln]|na?[fgor]|rlo|[rs]u|s[ahims]|tf|tm)|f0n?[at]|g0g|h0(fe|k|n|re)|ip01|k0n|n0t|no?th0|o0s|r0n1|rel01|rg0st|s0(l|ne|z)|t0n[es1]|u0n|un01|v0(l|n[1es])|yth0/.test(w.replace(/ei|ie/,0)+1)^/ei/.test(w)

```

Try it online!

(The total number of errors is reported in the *Debug* section of TIO, so you can collapse the *Footer* and *Output* sections if you just want to see that.)

### How?

We first get rid of a few edge cases with the following regular expression:

```
/dief|egh|etei|it?ei/

```

which matches these flipped inputs (for which it's especially hard to tell that they are indeed flipped):

```
diefeid, diefeis, ieghteis, ieghteith, inhomogenieteis, pompiei, soceiteis,
wieghteir, wieghteist

```

Otherwise, we replace the first occurrence of either `ei` or `ie` in the input word with `0` and append a trailing `1`:

```
w.replace(/ei|ie/, 0) + 1

```

We test whether the resulting string is matched by a large regular expression consisting of 23 patterns which are associated to words for which `0` must be `ei`.

Examples:

* `ath0stically1` is matched by `^(a?th0[rs]|d0st|r?0|h0r?[1s]|w0r)`
* `rec0ved1` is matched by `c0(l|t[1es]|v)`
* `mad0ra1` is matched by `d0(f|n[1ens]|ra|tie|ty)`
* `ineffic0ncy1` is not matched by any expression
> 22 votes

# Answer
# Python 3, ~~770~~ 642 bytes

```
import zlib,base64
A=zlib.decompress(base64.b85decode(b'c$_7UYjVRd2!yY)S5qWp)5uZ=uru!IySP90V_|rGMa^-E&VNdB;H1S_2f|8290;)j7yV7J%d^Wq23sMpSzu$qo;^u@D9IyHvE~Y_aZ`-##Ee}q7bO~)P3UUc!*KBGJAe35sGn4Dg*q$hg)r7k+@W(Z-3BEF?F-tdS^~S|4-B0443B>&x}e|ad5xF>_ITn*?1VMqLoI4vi7nBIZ6>m-KsG}&MdPkJnYWr$LA@PyH5$<?F;L6Jv~;{Uj}p&oDC6}95|fNJ')).decode('utf-8').split()
g=lambda i:i[:2]=='ei'or i.replace('ei','')in'dst hr hrs hst rn thr thrs thst vn wr brun lorel nucl taip'.split()or any(w in i for w in A)
f=lambda i:'eei'in i or'eii'in i or(not('eie'in i or'iei'in i)and(i.index('ei')<i.index('ie')if'ei' in i and 'ie' in i else('ie'in i)^g(i.replace('ie','ei'))))

```

Try it online!

Ungolfed

```
l = 'eigh ceiv eing eism eign einv reins reim feit veil seiz neit einf odu eird istic rna igl tera seil eiss reini heists tm rpr isu eip heik dece ceil feint herein fy ido eish nceit ucl rlo olt noe eio dri caf trad rote icat hein iress heife mr ji oly mad iru ifo eia egr cys alb uein reic onot nthe ndee kein isin isan inon iger code cave beig weirs veins veine seine reine deity deists atheist'.split()

def f(i):
  if 'eei' in i or 'eii' in i: return True
  if 'eie' in i or 'iei' in i: return False
  if 'ie' in i and 'ei' in i: return i.index('ei')<i.index('ie')
  # there now can't be 'ei' and 'ie' in i
  if 'ei' in i:
    return goodei(i)
  return not goodei(j)

def goodei(i):
  if i[:2] == 'ei': return True
  if i in 'brunei lorelei nuclei taipei deist heir heirs heist rein their theirs theist vein weir'.split(): return True
  for w in l:
    if w in i: return True
  return False

```

The basic idea is that most of the time, if 'ie' is in the word, then it's a real word. So the code first gets rid of cases where there are both ei and ie in the word, and then checks if the word (with ie's replaced with ei's) is a real word.

The way it checks if a word with ei is a real word, is it uses a big list of strings that are present in only real words.
> 7 votes

# Answer
# Python 3, ~~12,707~~ 12,219 bytes

(Thanks to ovs and caird coinheringaahing)

```
import zlib,base64
print(input()in str(zlib.decompress(base64.a85decode(b'Gar>nl]U9ZcgCa<oj+@,\'?AS1nH1b=o[Rk#ee2NMWifr*#`LJC+U"3NCT@F/s/+P^XUT5B[lgj.<d`u6:Hb_TF^sV:L\'l=S/;0*L>"WSdNO[-TSF4jrG//I)2&?mN5GuDk*e_R=A\\%t.fC[LC&pH#7g?%!p7&73\\!d/)tIu4%`Y7HlX^It/F:BMTia&e3ae-Y3celTM.]6\\TLJbPK,^(?D(X.bh5A<^KUa(%76YA)Ge/]f)J@<GsX^IT5JFBJrdM/`>?O\\s@r8]YHpbSR2r>cm]VXSSgK/Zfd@X&nGlV?=Za;Fbe`25!/?3&=j]p1R+)V1n;)E*3JF.qr[=S\'&8gq^@"Q@[FOkho\\c:Y["8!Bd3WhGrrf_@ljZA!urR#*n-Dk_NrTdje9\'sib*]PU(e+(4#jV""]]ETlM=WW*"Ch.CMkGjTT4/2.`W->F_\'mT%bif6o!R#Z3Uf&:B+Y)3]/1_;qR`U:C4X\\6a`F!SH0([s@:sK(F:WqD9-WH<X4BNZ:n_oZ8kVDYQF4/KO8`M-hXcF`91sguVcqPu6Y?"tmtm[0,s4iCjSct]$aAIm..-:5Ua7\\ic5P(@nFSX><:2WMT`H$0W\\Q:c7]jt_cku>!$?Npb^9)Z0;e.piJ.O),rKUfX2>`inD&g`+N4DYAKZdgXmm(7V2Z4m.D0Lp@!dD^7E4I3J0#9_=3%+okq^L.MmZ_P:r_DeM[(%<0O\\*)t%7h=3/Hr[&0NKe%]cI84G&\'t?f!^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9s-^#Q9&GNM[6!]cIr,lhX.19:ur>cdigjUUL;W0\\J;m$m]8J.Qe;p?egMoI1lcW=NdEO4YORd)S")Q+d)jW"8hSIj_2g^Nm<37m3*(rssg.bO,'))).split('\\r\\n'))

```

Searches for the input in a compressed string. Definitely could use some improvement.
> 5 votes

# Answer
# Jelly, ~~439~~ 418 bytes

```
“£ɦ^“PȮ’ḶḤ‘2¦×3‘FḃØ⁵ịØJ⁾“»jⱮVŒl;“þðxiṄḂÞẹṅŻÞÑɗðṁṙGm³L⁽ẉṇ/yƥɠỵỊ£nżsCµ®ỵ⁾ọȧƇẏƑtNgŻỊ⁺ẈɓỤɼʂrƓėɓẓøb6^ḍḃ"vṂỴ÷ƭVṖẇƥƑ¤æⱮẆẓ\6SNḌ|¢YỤṘ⁽r&AµwƓTṃṭṚHẇ¶(ȮçðṁÑLẉṃı-ÆẸbCṄ¢ɲʂ§ȦS³ịẆu⁽ạİ*ṁ©ß¬ḌZɗẒ¦ṫṃÑ+ṬẠ½ṠȷḂðȧç⁾xḥẹ)ẒɗJĿḍʋƲṚɠ_yỴ\9j6ḥḍƘḥÇ2Hƙṃ⁸Ụ°ṭ¹Ḍṭñ9Ẏ²ẈḍyẇƇ[ṃİḅ⁾µỌø§}UḳỤḷCs4ṗȤ7ȦĠƲżḤ,:ṡÑjb`AOẓḷỴƲY½;ẹ5£ẈṂQ:Ṁ¹ḋ4q+£Ø³ĖĊȷ#4&¶C⁾ÞẒƲṾı0"ɲFɠðƁḊḅ8yṪÐnŒN§i²ȧ2ẆƈUỌỤḟ¥$²Ɓj³ḥ-ƤṢṆƑġ⁽ṫƥG_BẈṇØ_¬ñẹ)¤rŀḍƑʂỴḞ`⁷¹ḤdƘbọzi³©E»Ḳ¤ḟ“ßGW€)Ɗ6ɱ8ʂṖṗ¥ṙ®×ɓƲ⁹»Ḳ¤;;€”s$$e@

```

Try it online!

A monadic link taking a string as input and outputting `0` for incorrect and `1` for correct.

Takes advantage of the dictionary in Jelly, but has to add some additional non-dictionary words as remove a few that are in the dictionary.

Slow when used repeatedly because the dictionary is generated each time. Now generates the dictionary purely using Jelly (rather than calling Python code directly)
> 4 votes

# Answer
# Python 3, 3384 bytes

```
import re,zlib,base64
G,H=["".join(map(chr,zlib.decompress(base64.a85decode(x)))).split()for x in[b'Gar?3CQa?!%"PP@eS)db*<_:.:\\C<.o7j7C6bYeu*^[Y=?7CpeN&,$aRJ0:HPcnf*]g<auqG$d6NX]:OM9:<gI?X".<gEtbcgB8TRe!nBg,QG?+FR.jgR`H-nMCOR(e>rR["sGCjjaHAkSMe#S]7`d73cUEKGOh0hl2pKYh+5uL\\N-U_#nCoV!Dn]i(Q,eK,+?HhOW>JC)p>Tijak_Zn+`5f=$0;nGHbL_f=\'$`a:$T7_OX<Shd8l!7b%tP0%Ca%EsK[K.D6*G9+4ok-($\'"@GfPTLm1qq/`Ng/`he.\\W#pb1=;,UbtsJ!mMu"_#,8u-#u9"8:V\\Qg+BRUsi\\I@q0M]HZPpiFCGJ\\8FW6X:[`_+F4d&@J>(lq.H\\=*5;,hgaR[k]T2]1Rp\\a-,#+!D(]`V6ngIXVEo[b1EAp/oa9W01K?jh[PutO\\,u7I(Lf<eUumH](R80*0g:F0SJgfbLoJ&),suqDE[@b9]9JK?C2Z%JR0O&\'b_\'a*O\'`T)R$D+YcR5#ajGD90U[SdCR9ZQE=$.(<.c9J5+dXM$m$7O%JL1tbd/&L#7o27Y$(YOfMf0AXVu#dP^2D4>nb/VI8O3Yk5(bO->Cn[lmE@8qBRa?Q_/fgN=GT)VcCR>K7*]gh^!b:\\&rB7,?"A4TbEKfNI4D$a3Q$4Uj;90/;t%J)prQ8.\'`JrngCEmQ#_Kc/EpPL3QC\'<)<M94XZ!jQ-Ba-7YZ5!i/mn#1PKno<nW*lQV=ej4=-#8deA%3T3b^#8itGakSRs9Zh\\oft&1CD_8!^sl]aZE@0l67;)</Z*:T!E1618bG(=\'--qUSQ9&=qU<qRoP=0o!9qXl)Zu95g#FPcp(`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9J65&PsLF=@##-D]);C-&&o"^VE0"E^<.U*K&J!L]t980_G&tpej$2_PLJ@DniaRN`P$JIE>"!C^g-s0a3.9\\ns&.!O$"AY7fQ?nl35I5BS"f:[QW!`iJ)Wj\\UaWs4Z"j?.I?X`//sE5-iYYDnn#<_0\\IXpm?Lf+*)mPq<B9b0;S""IZ3P0C(5#"$Dfh84Y:oa.p;bc5EUOFh#\\q71Dt=\\<qq]h)XF.9g1iVX2s<h*Za("A-g@ZZlNT#b/F\\.MQl9c']]
f=lambda s:s in G or(s not in H and re.search("seil|ie(?!ng|sm)|eing|eism",s))

```

Try it online!

You could probably save more bytes with a smarter regex. Basically, just a tradeoff between longer regex and shorter encoded strings.

`G` is the list of true cases, `H` is a list of false cases. `s in G or` makes it so if it's a true case, it gets marked as such. `s not in H and` makes it so if it's a false case, it gets marked as such. If neither is true, then it is checked with the regex `/seil|ie(?!ng|sm)|eing|eism/`. Finding a longer regex to match even just like 3-4 more words is certainly worth it, I just didn't want to spend too much time.
> 3 votes

---
Tags: code-golf, string, decision-problem, natural-language
---