[Question]
  [
This challenge is a simple ASCII-art challenge inspired by the [solar eclipse](https://www.timeanddate.com/eclipse/globe/2017-august-21) that happened on August 21, 2017. Given an input `0 <= n <= 4`, output the corresponding stage of the eclipse described below:
```
n=0:
   *****
 **     **
*         *
*         *
**       **
  *******
n=1:
   *****
 **  *****
*   *******
*   *******
**   ******
  *******
n=2:
   *****
 *********
***********
***********
***********
  *******
n=3:
   *****
 *****  **
*******   *
*******   *
******   **
  *******
n=4:
   *****
 **     **
*         *
*         *
**       **
  *******
```
---
# Rules
* You can 0 or 1 index, state what you chose.
* The chars used are space and `*`, you may use any printable char for `*` (other than space).
* Trailing spaces are optional (you may or may not have them).
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), lowest byte-count is the winner.
  
[Answer]
# [Python 2](https://docs.python.org/2/), ~~161~~ ~~149~~ ~~142~~ 135 bytes
```
lambda n,u=u' *':u'''   *****
 ****
**
**
****
  *******'''.translate({1:u[0<n<3],2:u[0<n<4],3:u[1<n<4]})
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFPp9S2VF1BS92qVF1dXUFBQQsEuIAUMzMTIyOQCWQwMzEB2YxobDCHEawGqk1LC2iGXklRYl5xTmJJqka1oVVptIFNno1xrI4RlGkSq2MMZBqCmbWa/wuKMvNKFNI0MvMKSks0NDX/mwAA "Python 2 – Try It Online")
-7 thanks to [Mr. Xcoder](https://codegolf.stackexchange.com/users/59487/mr-xcoder).
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~82~~ ~~81~~ ~~55~~ 43 bytes
*-38 bytes thanks to Neil!*
```
Ｎν”{“⟲ＦEd⧴_³⟲”‖Ｏ¿﹪ν⁴«Ｆ﹪ν²Ｇ↗³↑²↖²↙³*↑¤*¿⁼ν¹‖
```
[Try it online!](https://tio.run/##TU7BCsIwDL33K8JO7dgOU096VUFwOgbevMzZboPYzq6biPjttd0EhZDk5SXvpawLXaoCrd3JtjeH/nbhmkpGMt1IQwMACMPwLMGnb3jop2HASM4F8tIcB66xaCkjpBFAU3XtUVEZwYIxeBGnAkLpf2LmiEzhs1KSLk9t3lS1iWAegQOOHeueCzP1a/WQE3IbgTceNVM1cH/NRrRtEOmP9I9s7n2BnfdLnN/3WcpW5G1tYuPBxh1@AA "Charcoal – Try It Online") Link is to verbose version.
I did for the heck of it. :P ~~I'll probably get out-golfed by 40 bytes.~~ ~~26~~ 38 bytes... Close enough?
[Answer]
# [Cinnamon Gum](https://github.com/quartata/cinnamon-gum), 70 bytes
Hexdump:
```
0000000: 6c33 5053 5050 d002 012e 20a5 0002 4026  l3PSPP.... ...@&
0000010: 9001 0568 6c20 07a6 0648 4080 b521 8a19  ...hl ...H@..!..
0000020: 30a6 1644 1093 0de3 a098 6184 6206 422d  0..D......a.b.B-
0000030: 6136 c20c 6374 3380 3cb8 5aa0 1436 36ba  a6..ct3.<.Z..66.
0000040: 5f4c 280f 0f00                           _L(...
```
[Try it online!](https://tio.run/##dY@xTsRADER7vmJoEM1Zs@td3wZRnBAFBUUkOhq02VwA6S408P3BudAykm1Z1jzb7XOe6/lr3r3/nJeFm@5gTRWZ@ZKIkYxgiEdE1gyubWI04KT9S9@LCx6Hm6sLIDii8wJmKw6LBPfVQEvFjYUYcgwoNXRYfR@nNT8dRK5FNkR0hNI9wVJCYKfgeFRUdk4MJcEiDSnGEaDIo1xUZZCH3YbQ9ZGgBt/fYLpPUPXd2oaCXCsRkk/VhgpUE2nfKvfyKmL2d0VyRJ5SQyycwInE/3p7vvULlkV/AQ "Cinnamon Gum – Try It Online")
I have been waiting *so long* to find out how to use this language. :P
So, Cinnamon Gum is Bubblegum, but it's more of a "real" language than Bubblegum.
The first byte (`l`) sets the mode to dictionary mode. The rest of the bytes is the following string compressed.
```
0&   *****
 **     **
*         *
*         *
**       **
  *******;1&   *****
 **  *****
*   *******
*   *******
**   ******
  *******;2&   *****
 *********
***********
***********
***********
  *******;3&   *****
 *****  **
*******   *
*******   *
******   **
  *******;4&   *****
 **     **
*         *
*         *
**       **
  *******
```
This essentially makes a lookup table with each text assigned to a number. The program then takes input and outputs the respective text.
[Answer]
## JavaScript (ES6), ~~103~~ 102 bytes
```
f=
n=>`   *****
 **66733**${s=`
*666777333*`}${s}
**6667333**
  *******`.replace(/\d/g,c=>" *"[c*2>>n&1])
```
```
<input type=number min=0 max=4 oninput=o.textContent=f(this.value)><pre id=o>
```
Edit: Saved 1 byte thanks to @darrylyeo.
[Answer]
# VI, 108 bytes
```
D:let@a=@"%2?@":@"%4?"X":"\\d"<CR>
3i <Esc>5a*<Esc>Yphr*$a*<Esc>O**1110333**<Esc>YPi <Esc>3lx3lx"0px4lyl2p$xYp
:%s/<C-r>a/ /g<CR>
:%s/\d/*/g<CR>
```
`<CR>` is the `Enter` stroke, `<C-?>` corresponds to `Control + ?`, and `<Esc>` to `Escape` obviously. Each of these count for 1 byte (see [meta](https://codegolf.meta.stackexchange.com/questions/8995/how-should-vim-answers-be-scored)). The line breaks in the solution is for readability. Only `<CR>` represents real `Enter` strokes.
## Input
The input file should contain only 1 character, representing `n`.
## Launch
VI should be started like :
```
vi -u NONE input
```
## Explanations
There are 3 parts in the solution. I will describe the 2nd part first (2nd line), since it is the easiest to explain.
### Drawing the sun
The command to draw the sun is :
```
3i <Esc>5a*<Esc>Yphr*$a*<Esc>O**1110333**<Esc>YPi <Esc>3lx3lx"0px4lyl2p$xYp
```
The sun must be drawn with , `*`, `0`, `1` and `3`, like this :
```
   *****
 **11033**
*111000333*
*111000333*
**1110333**
  *******
```
A symmetry would have helped to reduce the bytes size of this part, but it's not that important. I will not explain the full line, but the pattern `*****` is used to easily generate the last line, and the pattern `**1110333**` has been taken as a reference to generate the 3 other lines containing `0`, `1` and `3`.
It is important to use `0`, `1` and `3` for sun parts that can be filled (see next explanations). Drawing this sun takes **55 bytes**, and can probably be golfed with some tricks.
### Filling the sun according to `n`
To correctly fill the sun, the instructions to follow are :
* if `n = 0`, then `0`, `1` and `3` (all digits) should be replaced with
* if `n = 1`, then `1` should be replaced with , the other digits with `*`
* if `n = 2`, then `0`, `1` and `3` (all digits) should be replaced with `*`
* if `n = 3`, then `3` should be replaced with , the other digits with `*`
* if `n = 4`, then `0`, `1` and `3` (all digits) should be replaced with  (like `n = 0`)
From that, we can infer that the substitutions required are :
* replace some digits by  (**first substitution**)
* replace all other digits by `*` (**second substitution**)
Note that "some digits" can mean "no digits" (`n = 2` for example). And "all other digits" can also represent "no digits", if all digits have already been replaced by the first substitution (`n = 0` for example).
The **second substitution** can be easily written in **11 bytes** :
```
:%s/\d/*/g<CR>
```
The **first substitution** depends on `n`, so first we have to calculate what digits are going to be replaced. If replaced characters are stored in register `a`, the substitution command is written in also **11 bytes** :
```
:%s/<C-r>a/ /g<CR>
```
`<C-r>a` is replaced by the content of register `a` when the command is typed.
To calculate the value of `a`, following the previous instructions, the algorithm is (in pseudo-code) :
```
n := read()
if (n % 2 != 0)
then
    a := n
else
    if(n % 4 != 0)
    then
        a := "X"
    else
        a := "\d"
```
`"X"` string is used because when `n = 2`, no digits are replaced by spaces. Any string that is not the sun could be used here, as long as the first substitution does nothing.
This could be written in **31 bytes** :
```
D                                   # yank and delete the first character of the file (n) to register "" (yank by default) : n = @"
 :let@a=                            # define register "a content
        @"%2                        # if (n % 2 != 0)
            ?                       # then
             @"                     #   n
               :                    # else
                @"%4                #   if (n % 4 != 0)
                    ?               #   then
                     "X"            #       "X"
                        :           #   else
                         "\\d"      #       "\\d"
                              <CR>  # calculate "a
```
## Solution
Put all these parts in the right order, and you have the solution :
```
D:let@a=@"%2?@":@"%4?"X":"\\d"<CR>                                              # calculate the digits to replace with spaces
3i <Esc>5a*<Esc>Yphr*$a*<Esc>O**1110333**<Esc>YPi <Esc>3lx3lx"0px4lyl2p$xYp     # draw the sun with spaces, stars, 0, 1 and 3
:%s/<C-r>a/ /g<CR>                                                              # replace the pattern stored in register "a with spaces
:%s/\d/*/g<CR>                                                                  # replace the remaining digits with stars
```
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), ~~40~~ 39 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
"⁽Ρūa╔Ƨ ‘╥▓.4%?52"¹ο1¹‘╬¡╬5.H?:±}.2=?╬8
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=JTIyJXUyMDdEJXUwM0ExJXUwMTZCYSV1MjU1NCV1MDFBNyUwOSV1MjAxOCV1MjU2NSV1MjU5My40JTI1JTNGNTIlMjIlQjkldTAzQkYxJUI5JXUyMDE4JXUyNTZDJUExJXUyNTZDNS5IJTNGJTNBJUIxJTdELjIlM0QlM0YldTI1NkM4,inputs=Mw__)
[Answer]
# PHP, 114+1 bytes
+1 byte for `-R`. Thanks @Neil for the shifting hint.
```
for(;$c="   *****
 **66733**
*666777333*
*666777333*
**6667333**
  *******"[$i++];)echo+$c?" *"[$c*2>>$argn&1]:$c;
```
uses underscore for `*`, 0-indexed. Run as pipe with `-nR` or [try it online](http://sandbox.onlinephpfunctions.com/code/b401e2216289548411f20cea123052be7d84e144).
Requires PHP 5.5 or later:  
older PHP does not understand literal string indexing (parse error);  
PHP 7.1 complains about non-numeric values (replace `+$c` with `$c>0` to fix).
[Answer]
# Java 8, ~~225~~ ~~213~~ ~~211~~ 200 bytes
```
n->{String y="   ",z="***",a=n<2|n>3?y:z,b=n<1|n>2?y:z,c=n%4<1?" ":"*",d=a+(n%4<1?y:z)+b;return y+z+"**\n **"+(n<2|n>3?"  ":"**")+c+(n<1|n>2?"  ":"**")+"**\n*"+d+"*\n*"+d+"*\n**"+a+c+b+"**\n  *"+z+z;}
```
-11 bytes thanks to *@ceilingcat*.
[Try it here.](https://tio.run/##dVDLboMwELz3K1aWKgEmqElzCjj5gubSY9uDeaRyShYEJhKkfDudgA@5VLLlnd2ZsXbO@qpXVV3wOf@ZslK3Lb1pw7cnIsO2aE46K@h4h0TvtjH8TZmHCbEfozni4rRWW5PRkZgUTbza3xy3VwJCEQ5KBEEgQq042fzy/vXQ74YwBVoDbWaUKX7eJuuDILET4OZKS29pYezLNG4K2zVMvRwk7D6ZYAmKc8RPd2EgfJndu4vzQ3fWQJGjeixQaUhSZ0rAgxzicYqX7eouLbGdW/JamZwuyMhbdvz4Iu0vAZ2qZs7GqJeYTKJoi0dKN0WAfWuLS1R1NqohtSV7HCFOf87yH4abjXPa4/QH)
[Answer]
# [Python 2](https://docs.python.org/2/), ~~170~~ 169 bytes
* -1 byte thanks to @TheIOSCoder: use of exec
```
def f(x,k=0):exec'print"".join(ord(i)*" *"[j%2]for j,i in enumerate(["		","	","	!",""][x%4]))[11*k:][:11];k+=1;'*6
```
[Try it online!](https://tio.run/##RY7RCoIwGEbZv8z0KdZA2kyimXSh@CRjF5EbTWkTMbCnt/BC7w7n48DXf8eXd/k8N9oQw6asq6@81JN@nvrBupHSS@utY35omOUpJSmVbZIr4wfSZpZYR7T7vPXwGDWTFAc7CAChCCIcAoRAs8VBgBA@4AjvVxeh48oBAAr/e4iXRskpKRTnUoi0K5UshVBVd65FdUrvs2GCx8u52LB8w9uGBZ@LHw "Python 2 – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 181 bytes
```
lambda n,s=' ',a='*':"""   *****
 **%s**
*%s*
*%s*
**%s**
  *******"""%[(s*5,s*9,s*9,s*7),(s*2+a*3,s*3+a*6,s*3+a*6,s*3+a*4),(a*5,a*9,a*9,a*7),(a*3+s*2,a*6+s*3,a*6+s*3,a*4+s*3)][n%4]
```
[Try it online!](https://tio.run/##XY7NCoMwEITvfYpFkJg1PWj8oYJPYj1saW0DNorx0qdPN9WDdGH3Y4YZ2Pmzviab@6G9@pHetzuBVa4VIBS1AkUTRREAYJgTI3bMcPezGXsAkdNxlzgslcPLvrVU7OQpoWalmdUfC04Qd4jz29Y/R6fcY1Ux9YFFoOw7Gxe9H6YFDBgLC9nnIyllw@8AzIuxKwyJkQcpzgKzzH8B "Python 2 – Try It Online")
Very naive approach, ~~workin' on golfin'~~ nvm.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 46 bytes
```
„* •zÇRéóĀ—ÚÂÐoʒ<]ÜA›¶Ò¿H¶ ∞m•b3äûIèSèJ6äIií}»
```
[Try it online!](https://tio.run/##AVkApv8wNWFiMWX//@KAniog4oCiesOHUsOpw7PEgOKAlMOaw4LDkG/Kkjxdw5xB4oC6wrbDksK/SMK2IOKInm3igKJiM8Okw7tJw6hTw6hKNsOkSWnDrX3Cu///MQ "05AB1E – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `j`, 48 bytes
```
‛* »>ṪÞ£Ǔḟṅ↲Ṅ²3@qx⋎
ṡµ⌈İ∆µ^X1»bṅ3/∞?if⌊İṅ6/?1=[R
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJqIiwiIiwi4oCbKiDCuz7huarDnsKjx5PhuJ/huYXihrLhuYTCsjNAcXjii45cbuG5ocK14oyIxLDiiIbCtV5YMcK7YuG5hTMv4oieP2lm4oyKxLDhuYU2Lz8xPVtSIiwiIiwiMSJd)
## How?
```
‛* »>ṪÞ£Ǔḟṅ↲Ṅ²3@qx⋎
ṡµ⌈İ∆µ^X1»bṅ3/∞?if⌊İṅ6/?1=[R
‛*                    # Push string "* "
   »>ṪÞ£Ǔḟṅ↲Ṅ²3@qx⋎\nṡµ⌈İ∆µ^X1»
                      # Push compressed integer 90018261496673587326026870693610373816328976440801592144686583
b                     # Convert it to binary
 ṅ                    # Join by nothing
  3/                  # Split it into 3 equal parts
    ∞                 # Palindromise this list
     ?                # Push the input
      i               # Index it into the list
       f              # Convert to list of characters
        ⌊             # Convert each to an integer
         İ            # Index each into the other string ("* ")
          ṅ           # Join by nothing
           6/         # Split into six equal parts
             ?1=[     # If the input is equal to one:
                 R    # Reverse each
```
]