[Question]
  [
Halloween is almost here, the holiday after which most people need to wean themselves off a hollow diet of sugar.
Write a program that takes in a positive integer. If the integer is less than 31 (1 through 30), output this ASCII-art jack-o'-lantern, looking to the right as if looking forward to Halloween:
```
 _____I_____
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|
```
If the input *is* 31 (the October date Halloween is on), output the same ASCII-o'-lantern, but looking left:
```
 _____I_____
| | | | | | |
| |^| |^| | |
| | |^| | | |
| |VvVvV| | |
|_|_|_|_|_|_|
```
If the input is greater than 31, output a bloated-looking ASCII-o'-lantern who probably ate too much candy. He can face either left or right since queasyness can be disorientating. So output:
```
 _____I_____
| | | | | | |
| |o| |o| | |
| | |^| | | |
| |XXXXX| | |
|_|_|_|_|_|_|
```
*or*
```
 _____I_____
| | | | | | |
| | |o| |o| |
| | | |^| | |
| | |XXXXX| |
|_|_|_|_|_|_|
```
Whichever you prefer. It may even be different for different numbers above 31.
**The shortest code in bytes wins.**
  
[Answer]
# [아희(Aheui)](http://esolangs.org/wiki/Aheui), 914 bytes
```
붕빠뿌빠삮빠싸빠받따싼사주따반따퍄속맣이
숚뽀빠소뚜번범뻐터번선야챠슊산받발따다뿌
분뽀더번투빠뿌삮뿌다뿌쑬섣뽀빠뼈ㅇ뚜범쑬
받발따또싾솒빠쏟싿솓아삲쏠쑧뽀터벋터볼설
뿌뻐뻐뻐선썬뻐퍼섟썫선뻐퍼샧셗뺘쎣뺘뼈선
받따반타파빠빠받따받반타타싾삲빠빠빠빠뿌
숟썭뻐선썭뻐섣썭뻐선썭뻐섣썯터범떠범뻐선
빠싽술빠싽산빠싽삳빠싽숟삮쎨뿌서탸쥬싸셔
쀼이썭솓쀼섣싻이연우섞빠쏠뱐선반노쌹뻐숛
손빠쓞유삯쏢으산뽀쌹쏡야뼈섣싺이셗처솓썱
아솓썲솑쏢삱쏜빠쌄숞뚜범범섩뻐분터뿌뻐튜
번이손쎫ㅇ야샨우쌃이쀼뱔뿌떠뽀투또뿌뽀노
본떠벋뻐떠번떠숃볌쎬볌섩뿌빠뽀펴봄벌뽀뻐
샯이멓삭뭏ㅇㅇ이멓샥뎌뵥뿌븀범이멓삭뭏맣
맣이ㅇ몋섨희ㅇㅇㅇㅇㅇ먛뻐살뽀ㅇ솕멓샮속
```
[Try it here! (please copy and paste the code manually)](http://jinoh.3owl.com/aheui/jsaheui_en.html)
Aheui might not be for golfing, but it's fun nonetheless. :)
**Outputs:**
N = 10
```
 _____I_____ 
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|
```
N = 31
```
 _____I_____ 
| | | | | | |
| |^| |^| | |
| | |^| | | |
| |VvVvV| | |
|_|_|_|_|_|_|
```
N = 40
```
 _____I_____ 
| | | | | | |
| |o| |o| | |
| | |^| | | |
| |XXXXX| | |
|_|_|_|_|_|_|
```
[Answer]
# JavaScript (ES6), ~~185~~ ~~142~~ ~~140~~ 136 bytes
Now you can tweet-a-pumpkin!
```
n=>` _____I_____
0 4 1
02421
0 |^| 1
031
|_|_|_|_|_|_|`.replace(/\d/g,x=>x-2?x-3?x^n>30?"| |":"| | |":n>31?"XXXXX":"VvVvV":n>31?"o":"^")
```
Probably still room for improvement...
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 73 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
“ẋƥḷỊKNṇ&JƝ¡'Ɲṣ,c;|Ṙɗ.hṿ#⁴ɠ³Ṙṅ’b8ị“ I|o^Xv_”
<32ị“o^XV“vX”y¢s13µ¹U31=³¤?Y
```
Full program  
**[TryItOnline!](http://jelly.tryitonline.net/#code=4oCc4bqLxqXhuLfhu4pLTuG5hyZKxp3CoSfGneG5oyxjO3zhuZjJly5o4bm_I-KBtMmgwrPhuZjhuYXigJliOOG7i-KAnCBJfG9eWHZf4oCdCjwzMuG7i-KAnG9eWFbigJx2WOKAnXnConMxM8K1wrlVMzE9wrPCpD9Z&input=&args=MzE)**
Might be possible to golf this with the aid of bounce, `ŒḄ`.
### How?
```
“ẋƥḷỊKNṇ&JƝ¡'Ɲṣ,c;|Ṙɗ.hṿ#⁴ɠ³Ṙṅ’b8ị“ I|o^Xv_” - Link 1, Jack construction
“ẋƥḷỊKNṇ&JƝ¡'Ɲṣ,c;|Ṙɗ.hṿ#⁴ɠ³Ṙṅ’              - a base 250 integer
                               b8            - convert to base 8
                                 ị           - index into
                                  “ I|o^Xv_” - literal " I|o^Xv_"
                                             - makes this, without the line feeds:
                                                _____I_____ 
                                               | | | | | | |
                                               | |o| |o| | |
                                               | | |^| | | |
                                               | |XvXvX| | |
                                               |_|_|_|_|_|_|
<32ị“o^XV“vX”y¢s13µ¹U31=³¤?Y - Main link: n
<32                          - 1 if n is less than 32 else 0
   ị                         - index into
    “o^XV“vX”                - list of strings, ["o^XV","vX"]
             y               - map those characters (o->^ and X->V OR v->X) in string:
              ¢              -    call last link (1) as a nilad
               s13           - split into chunks of length 13
                  µ          - monadic chain separation
                          ?  - ternary if:
                         ¤   -     nilad and links as a nilad
                     31=³    -         31 equals first argument
                   ¹         -     identity (do nothing if true)
                    U        -     upend (reverse each if false)
                           Y - join with line feeds
              
```
[Answer]
# Ruby, 137 bytes
Face points left on and after the 31st.
```
->n{puts ' _____I_____',(0..4).map{|i|s=[?|]*7*' _'[i/4]
s[5-n/31*2,5]=' | | o| |o |^| VvVvV_|_|_'[i*5,5];s.tr('ovV','^vVoX'[n/32*3,3])}}
```
**Ungolfed in test program**
```
f=->n{
  puts ' _____I_____',                                #Draw top of pumpkin
  (0..4).map{|i|                                      #then 5 more lines
    s=[?|]*7*' _'[i/4]                                #of 7 | separated by space or _ .
    s[5-n/31*2,5]=' | | o| |o |^| VvVvV_|_|_'[i*5,5]  #Add a line of face with 'o' eyes and 'VvVvV' mouth.
    s.tr('ovV','^vVoX'[n/32*3,3])                     #Substitute characters as necessary.
  }
}
f[gets.to_i]
```
[Answer]
# Pyth - 84 bytes
Manual base compression.
```
+dj\Im*5\_2Xjb@_MBsMc5@L"^|_V ve"jC"mËÝ8|0càvll+Ç²Sïë¬Ê"7qQ31"Vve"?>Q31"XXo""Vv^
```
[Test Suite](http://pyth.herokuapp.com/?code=%2Bdj%5CIm%2a5%5C_2Xjb%40_MBsMc5%40L%22%5E%7C_V+ve%22jC%22%14m%C3%8B%C3%9D8%7C0%1Cc%C2%8D%C3%A0vll%2B%C3%87%C2%B2S%C3%AF%C3%AB%C2%AC%C3%8A%C2%88%227qQ31%22Vve%22%3F%3EQ31%22XXo%22%22Vv%5E&test_suite=1&test_suite_input=30%0A31%0A32&debug=0).
[Answer]
# PHP, ~~178~~ ~~176~~ 171 bytes
```
$e="| | ";$b=($n=$argv[1]-31)?" |^":"^| ";$c=$n<1?VvVvV:XXXXX;$a=$n<1?$b:" |o";echo" _____I_____\n$e$e$e|\n| |$a|$a$e\n$e|$b$e|\n| |",$n?" |$c":"$c| ","$e\n|_|_|_|_|_|_|";
```
could save 5 bytes with physical linebreaks. Run with `-r`.
[Answer]
## [Charcoal](http://github.com/somebody1234/Charcoal), 71 bytes
```
ＮβＡ‹β³²τＡ§o^τεＡ§XVτφＡ§XvτθＦ³«Ｐ↑⁵|_»↑⁵←I←×_⁵‖Ｏ→↙↙←←ε↙←^↖↓ε↓→φθφθφ¿⁼β³¹‖←
```
**Note**: This code does not work in the most recent commit as of posting, because string indexing is broken. It should, however, work in [this version](https://github.com/somebody1234/Charcoal/commit/a148001cce2b2e4eb46fb56b03503b4de922d3fc) from October 25. It also runs successfully on the version currently on [Try It Online](http://charcoal.tryitonline.net/#code=77yuzrLvvKHigLnOssKzwrLPhO-8ocKnb17PhM6177yhwqdYVs-Ez4bvvKHCp1h2z4TOuO-8psKzwqvvvLDihpHigbV8X8K74oaR4oG14oaQSeKGkMOXX-KBteKAlu-8r-KGkuKGmeKGmeKGkOKGkM614oaZ4oaQXuKGluKGk8614oaT4oaSz4bOuM-GzrjPhsK_4oG8zrLCs8K54oCW4oaQ&input=MzA).
### Explanation
Charcoal is a language designed for ASCII-art. Output is put onto a canvas, which is printed at the end of the program.
**Setup**
Get input and calculate face characters:
```
Ｎβ        Input number into beta
Ａ‹β³²τ    Assign beta<32 to tau for easy reuse
Ａ§o^τε    Assign appropriate eye character (selected via indexing into "o^") to epsilon
Ａ§XVτφ    Assign outside and middle mouth character to phi
Ａ§Xvτθ    Assign other mouth character to theta
```
**Draw the pumpkin**
```
Ｆ³«  »    Do this three times:
Ｐ↑⁵       Draw a 5-character line upward (using | by default); don't move the cursor
|_         Draw that string, rightward
```
After this loop, we have
```
| | | 
| | | 
| | | 
| | | 
|_|_|_
```
Next:
```
↑⁵         Draw a 5-character line upward
←I         Draw the stem leftward
←×_⁵       Draw 5 underscores leftward
‖Ｏ→       Reflect the canvas rightward, overlapping in the middle
```
Result:
```
 _____I_____ 
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|_|_|_|_|_|_|
```
**Draw the face**
We will draw the face looking rightward and change it later if necessary.
```
↙↙←←ε      Move to the correct spot and draw the right eye (our right, pumpkin's left)
↙←^        Move to the correct spot and draw the nose
↖↓ε        Move to the correct spot and draw the left eye
↓→φθφθφ    Move to the correct spot and draw the mouth with alternating characters
```
Result (for input `31`):
```
 _____I_____ 
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|
```
Reflect if it's Halloween:
```
¿⁼β³¹      If beta equals 31:
‖←         Reflect canvas leftward
```
Final output:
```
 _____I_____ 
| | | | | | |
| |^| |^| | |
| | |^| | | |
| |VvVvV| | |
|_|_|_|_|_|_|
```
[Answer]
# [V](http://github.com/DJMcMayhem/V), 97 bytes
```
é|6i| Y5PÒ_r $.7|rIGÓ /_
3G3f r^jll.kll.5G3f RVvVvVLá
Àé*ñ30|l2GGkld$PñGñ31|l3GÓÞ/o
5GÓãv/XñÍª
```
[Try it online!](http://v.tryitonline.net/#code=w6l8Nml8IBtZNVDDkl9yICQuN3xySUfDkyAvXwozRzNmIHJeamxsLmtsbC41RzNmIFJWdlZ2VhtMw6EKw4DDqSrDsTMwfGwyRxZHa2xkJFDDsUfDsTMxfGwzR8OTw54vbwo1R8OTw6N2L1jDscONwqo&input=&args=MzA)
I'm dissapointed with how long this turned out. It is more convoluted than usual since V can barely handle numbers, a *lot* of bytes come from creating hacky conditionals. I would post a detailed explanation, but it took a long time to come up with, so I might get around to it later. Here is a hexdump:
```
0000000: e97c 3669 7c20 1b59 3550 d25f 7220 242e  .|6i| .Y5P._r $.
0000010: 377c 7249 47d3 202f 5f0a 3347 3366 2072  7|rIG. /_.3G3f r
0000020: 5e6a 6c6c 2e6b 6c6c 2e35 4733 6620 5256  ^jll.kll.5G3f RV
0000030: 7656 7656 1b4c e10a c0e9 2af1 3330 7c6c  vVvV.L....*.30|l
0000040: 3247 1647 6b6c 6424 50f1 47f1 3331 7c6c  2G.Gkld$P.G.31|l
0000050: 3347 d3de 2f6f 0a35 47d3 e376 2f58 f1cd  3G../o.5G..v/X..
0000060: aa                                       .
```
FYI this will run *very* slowly. It will take about 10 seconds. I know why this happens, and I'm looking into fixes.
[Answer]
# Pyth, 76 bytes
```
+dX*11\_5\IjbmX.<.[14d"| "yqQ31<G3?>Q31"XXo""Vv^"c"
|c| |c
|^
|ababa"bt*7"_|
```
[Try it online.](http://pyth.herokuapp.com/?code=%2BdX%2a11%5C_5%5CIjbmX.%3C.%5B14d%22%7C+%22yqQ31%3CG3%3F%3EQ31%22XXo%22%22Vv%5E%22c%22%0A%7Cc%7C+%7Cc%0A%7C%5E%0A%7Cababa%22bt%2a7%22_%7C&input=30&test_suite_input=30%0A31%0A32&debug=0)
Uses no compression. (I tried using some to a version of the face data string, but it ended up the same length.)
[Answer]
# Java 7, 237 bytes
```
String c(int n){char a=n==31?94:n>31?'o':32,b=n<31?'^':32;return(" _____I_____ \n~~~~~~|\n~|"+a+"|"+b+"|"+a+"|"+b+"~|\n~~|"+(n>31?94:a)+"|"+b+"~~|\n~"+(n<31?"~|VvVvV|":n==31?"|VvVvV~|":"|XXXXX~|")+" |\n|_|_|_|_|_|_|").replace("~","| ");}
```
**Ungolfed & test code:**
[Try it here.](https://ideone.com/VPs8Os)
```
class M{
  static String c(int n){
    char a = n == 31
              ? 94
              : n > 31
                 ? 'o'
                 : 32,
         b = n < 31
              ? '^'
              : 32;
    return (" _____I_____ \n~~~~~~|\n~|"+a+"|"+b+"|"+a+"|"+b+"~|\n~~|"
        +(n > 31
           ? 94
           :a)
        +"|"+b+"~~|\n~"
        +(n < 31
           ? "~|VvVvV|"
           : n == 31
              ? "|VvVvV~|"
              : "|XXXXX~|")
        +" |\n|_|_|_|_|_|_|")
      .replace("~", "| ");
  }
  public static void main(String[] a){
    System.out.println(c(12));
    System.out.println();
    System.out.println(c(31));
    System.out.println();
    System.out.println(c(100));
  }
}
```
**Output:**
```
 _____I_____ 
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|
 _____I_____ 
| | | | | | |
| |^| |^| | |
| | |^| | | |
| |VvVvV| | |
|_|_|_|_|_|_|
 _____I_____ 
| | | | | | |
| |o| |o| | |
| | |^| | | |
| |XXXXX| | |
|_|_|_|_|_|_|
```
[Answer]
# C++, ~~222~~ ~~204~~ 194 bytes
-18 bytes thanks to Kevin Cruijssen and -10 bytes for explicit top part
```
using S=std::string;S f(int n){char L[80],o=2*(n>30),i=-1;while(i++<80)L[i]=47<i&i<53?88:i%2?'|':i==20|i==24|i==36?n<32|i>35?94:'o':(i-o)%14?i-o<55?32:95:10;return" _____I_____ "+S(L+o,L+70+o);}
```
Ungolfed
```
#include <string>
using S=std::string;
S f(int n){
 char L[80];
 int o=2*(n>30);
 for (int i=0;i<80;i++){
  L[i]=
   (47<i && i<53) ?
   'X' :
   (
    (i%2) ?
    '|' :
    (
     i==20||i==24||i==36 ?
     (n<32||i>35?'^':'o') :
     ((i-o)%14?(i-o<55?' ':'_'):'\n')
    )
   );
 }
 return " _____I_____ " + S(L+o,L+70+o);
}
```
[Answer]
# PHP, 222 Bytes
```
for($s=" ".str_pad("I",11,_,2)." \n";$i<5;$i++)$s.=str_pad("",13,$i<4?"| ":"|_")."\n";$p=($a=$argv[1])<31||!($a%2)?2:0;$s=substr_replace($s,$a>31?XXXXX:VvVvV,$p+59,5);$s[$p+31]=$s[$p+35]=($a>31?o:"^");$s[$p+47]="^";echo$s;
```
## Output
```
input:29
 _____I_____ 
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|
input:30
 _____I_____ 
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|
input:31
 _____I_____ 
| | | | | | |
| |^| |^| | |
| | |^| | | |
| |VvVvV| | |
|_|_|_|_|_|_|
input:32
 _____I_____ 
| | | | | | |
| | |o| |o| |
| | | |^| | |
| | |XXXXX| |
|_|_|_|_|_|_|
input:33
 _____I_____ 
| | | | | | |
| |o| |o| | |
| | |^| | | |
| |XXXXX| | |
|_|_|_|_|_|_|
input:34
 _____I_____ 
| | | | | | |
| | |o| |o| |
| | | |^| | |
| | |XXXXX| |
|_|_|_|_|_|_|
input:35
 _____I_____ 
| | | | | | |
| |o| |o| | |
| | |^| | | |
| |XXXXX| | |
|_|_|_|_|_|_|
```
[Answer]
## Groovy Script, ~~273~~ ~~265~~ ~~216~~ ~~202~~ 198 bytes
```
i=args[0]as int
a=i<32?'^| |^':'o| |o'
b=i<32?'VvVvV':'XXXXX'
j=i>30
print" _____I_____\n| | | | | | |\n| |${j?"$a| ":" |$a"}| |\n| | |${j?'^| ':' |^'}| | |\n| |${j?"$b| ":" |$b"}| |\n|_|_|_|_|_|_|"
```
Ungolfed version
```
i = args[0] as int
a = i < 32 ? '^| |^' : 'o| |o'
b = i < 32 ? 'VvVvV' : 'XXXXX'
j = i > 30
print """ _____I_____
| | | | | | |
| |${j ? "$a| " : " |$a"}| |
| | |${j ? '^| ' : ' |^'}| | |
| |${j ? "$b| " : " |$b"}| |
|_|_|_|_|_|_|"""
```
[Try it here](https://goo.gl/AVB3XS)
### Edit
As Titus mentioned, I can save some size with `i < 32` instead of `i in 1..31`
### Edit 2
Removed all possible spaces around operators... Forgot to do so in the beginning
### Edit 3
Rewrote ternary conditions to use the saved variable, replaced `;` with newlines, removed explicit variable definition
### Edit 4
As Otávio mentioned, I can save another 4 bytes if I switch from `| |${j ? ' |^| | ' : ' | |^| '}| |` to `| | |${j ? '^| ' : ' |^'}| | |`
[Answer]
## JavaScript (ES6), ~~163~~ 125 bytes
```
f=
n=>` _____I_____
3 5 4
30504
3 |^| 4
3121214
|_|_|_|_|_|_|`.replace(/\d/g,c=>(n>31?`oXX`:`^Vv`)[c]||(c-3^n>30?`| |`:`| | |`))
;
```
```
<input type=number oninput=o.textContent=f(this.value)><pre id=o>
```
Now shamelessly stealing @ETHproduction's trick for positioning the face. Encoding: `0` is an eye, `1` and `2` are teeth, `3` is the left side, `4` is the right side and `5` is the bridge of the nose.
[Answer]
## Ruby, 168 bytes
```
->i{s=(Zlib.inflate Base64.decode64 "eJxTiAcBTzDJVaOABCG8OCiGycUhyYWVASGYF48EuRTwGhmHZkgckhzMQBKNzIdibEZGgAA2IwFZA1N4").lines;puts i<31?s[0..5]:i<32?s[6..11]:s[12..17]}
```
Probably far from optimal. Requires the `base64` and `zlib` libraries. 
Call as a lambda function.
[Answer]
# Python 2, 167 bytes
```
i=input()
b='| |';e='^o'[i>31]+b;print'\n'.join(x[::[1,-1][i>30]]for x in[' _____I_____ ','| '*5+b,b+' |'+e+e,b+' | |^| '+b,b+' |'+['VvVvV','X'*5][i>31]+b,'|_'*6+'|'])
```
[Answer]
## C# 6, 223 215 bytes
`int d=int.Parse(args[0]);var x="| | |\n| |";var s=d<31?" |^| |^| |\n| | | |^"+x+" |VvVvV":(d==31?"^| |^"+x+" |^| "+x+"VvVvV| ":"o| |o"+x+" |^| "+x+"XXXXX| ");Write(" _____I_____\n| | | | "+x+s+"| |\n|_|_|_|_|_|_|");`
Entire program ungolfed:
```
using static System.Console;
namespace Halloween
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int d = int.Parse(args[0]);
            var x = "| | |\n| |";
            var s = d < 31 ? " |^| |^| |\n| | | |^" + x + " |VvVvV" 
                           : (d == 31 ? "^| |^" + x + " |^| " + x + "VvVvV| " 
                                      : "o| |o" + x + " |^| " + x + "XXXXX| ");
            Write(" _____I_____\n| | | | " + x + s + "| |\n|_|_|_|_|_|_|");
        }
    }
}
```
]