[Question]
  [
In chess, the Fool's Mate is the fastest possible way to reach checkmate. It is reached with Black's second move. In chess notation, one possible sequence of moves that achieves Fool's Mate is `1.f3 e6 2.g4 Qh4#`.
[![Position after 1.f3 e6 2.g4 Qh4#](https://i.stack.imgur.com/PVtzc.png)](https://i.stack.imgur.com/PVtzc.png)
This is not the only possible way to achieve this checkmate (in the same number of moves). There are three things that can be varied while still taking the same number of moves:
1. White can move the f-pawn first or the g-pawn first,
2. White can move the f-pawn to f3 or f4, and
3. Black can move the e-pawn to e6 or e5.
This gives 8 possible games that end in Fool's Mate. Print them all in standard chess notation. They are:
```
1.f3 e5 2.g4 Qh4#
1.f3 e6 2.g4 Qh4#
1.f4 e5 2.g4 Qh4#
1.f4 e6 2.g4 Qh4#
1.g4 e5 2.f3 Qh4#
1.g4 e5 2.f4 Qh4#
1.g4 e6 2.f3 Qh4#
1.g4 e6 2.f4 Qh4#
```
The order in which the games are printed does not matter, so e.g. this is OK:
```
1.g4 e5 2.f4 Qh4#
1.f3 e6 2.g4 Qh4#
1.g4 e6 2.f4 Qh4#
1.f4 e5 2.g4 Qh4#
1.f4 e6 2.g4 Qh4#
1.g4 e5 2.f3 Qh4#
1.g4 e6 2.f3 Qh4#
1.f3 e5 2.g4 Qh4#
```
  
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 61
This is a pretty good challenge for [bash brace expansions](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html)
```
printf '1.%s Qh4#
' f{3,4}\ e{5,6}\ 2.g4 g4\ e{5,6}\ 2.f{3,4}
```
[Try it online!](https://tio.run/##S0oszvj/v6AoM68kTUHdUE@1WCEww0SZS10hrdpYx6Q2RiG12lTHDEgb6aWbKKSbIAtAlPz/DwA "Bash – Try It Online")
[Answer]
# [JavaScript (V8)](https://v8.dev/), 80 bytes
*-2 bytes by using a full program, as suggested by [@dingledooper](https://codegolf.stackexchange.com/users/88546/dingledooper)*  
*-2 bytes thanks to [@Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)*
```
for(n=8;n--;)print(`1.${n&2?G='g4':F} e${6-n%2} 2.${n&2?F=`f${n&4||3}`:G} Qh4#`)
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNEts/j/Py2/SCPP1sI6T1fXWrOgKDOvRCPBUE@lOk/NyN7dVj3dRN3KrVYhVaXaTDdP1ahWwQgq52abkAZimdTUGNcmWLnXKgRmmCgnaP7/DwA "JavaScript (V8) – Try It Online")
### How?
We iterate from \$n=7\$ to \$n=0\$ and use each bit to decide what should be displayed:
```
bit : 2 1 0
      | | |
      | | +--> use 'e5' if set, use 'e6' if clear
      | +----> g-pawn first if set, f-pawn first if clear
      +------> use 'f4' if set, use 'f3' if clear
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `j`, 36 bytes
```
\f43f+56fẊ‛g4vJ:RJƛ÷`1.Π eΠ 2.Π Qh4#
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJqIiwiIiwiXFxmNDNmKzU2ZuG6iuKAm2c0dko6UkrGm8O3YDEuzqAgZc6gIDIuzqAgUWg0IyIsIiIsIiJd)
This was... annoying
```
         Ẋ                           # Cartesian product of...
\f43f+                               # ["f3", "f4"]               
      56f                            # and [5, 6]
          ‛g4vJ                      # Append "g4" to each
               :RJ                   # Reverse each and append to the original 
                  ƛ                  # Over each...
                   ÷                 # Push each into the stack
                    `1.Π eΠ 2.Π Qh4# # Format into the final output.
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~104~~ ~~99~~ ~~90~~ 89 bytes
```
f(i){for(i=9;--i;printf("1.%c%d e%d 2.%c%d Qh4#\n",102+i/5,4+3/~i,6-i%2,103-i/5,4-i/7));}
```
[Try it online!](https://tio.run/##S9ZNT07@n5uYmaehqVDNpQAEaRqa1ly1/9M0MjWr0/KLNDJtLa11dTOtC4oy80rSNJQM9VSTVVMUUoHYCMIMzDBRjslT0jE0MNLO1DfVMdE21q/L1DHTzVQ1Agoa64IFgaS5pqZ17f///5LTchLTi//rlgMA "C (gcc) – Try It Online")
-3 bytes thanks to [Steffan](https://codegolf.stackexchange.com/users/92689/steffan)
-1 byte thanks to [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld)
-9 bytes thanks to [AZTECCO](https://codegolf.stackexchange.com/users/84844/aztecco)
-1 byte thanks to [c--](https://codegolf.stackexchange.com/users/112488/c)
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~62~~ 60 bytes
```
g4#f3¶f3#g4
#
 e5 2.
.+
1.$& Qh4#
3
$&$%'¶$%`4
5
$&$%'¶$%`6
```
[Try it online!](https://tio.run/##K0otycxL/P@fK91EOc340LY0Y@V0Ey5lLoVUUwUjPS49bS5DPRU1hcAME2UuYy4VNRVV9UPbVFQTTLhMkXhm//8DAA "Retina 0.8.2 – Try It Online") Edit: Saved 2 bytes thanks to @DLosc. Explanation:
```
g4#f3¶f3#g4
```
Insert the two pawn orders for White.
```
#
 e5 2.
```
Insert Black's first move in between each pair.
```
.+
1.$& Qh4#
```
Append Black's second move to each pair.
```
3
$&$%'¶$%`4
```
Duplicate each game but with `f3` changed to `f4`.
```
5
$&$%'¶$%`6
```
Duplicate each game but with `e5` changed to `e6`.
[Answer]
# [Python 3](https://docs.python.org/3/), 76 bytes
```
print('1.%s%s e%%s 2.%s%s Qh4#\n'*4%(*'g4f3g4f4f4g4f3g4',)*2%(*'55556666',))
```
[Try it online!](https://tio.run/##K6gsycjPM/7/v6AoM69EQ91QT7VYtVghVRVIGEHYgRkmyjF56lomqhpa6ukmacZADIQQlrqOppYRSMIUCMyAACig@f8/AA "Python 3 – Try It Online")
Can definitely be improved.
### [Python 3](https://docs.python.org/3/), 73 bytes
```
for x in 5,6:print(f'1.%c%c e{x} 2.%c%c Qh4#\n'*4%(*'g4f3g4f4f3g4f4g4',))
```
[Try it online!](https://tio.run/##K6gsycjPM/7/Py2/SKFCITNPwVTHzKqgKDOvRCNN3VBPNVk1WSG1uqJWwQjCDswwUY7JU9cyUdXQUk83STMGYiiZbqKuo6n5/z8A "Python 3 – Try It Online")
This is 3 bytes shorter, but prints an empty line in the middle.
[Answer]
# [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), ~~380~~ 378 bytes
```
[S S S T    S S S N
_Push_n=8][N
S S N
_Create_Label_LOOP][S S S T N
_Push_1][T  S S T   _Subtract:_n=n-1][S N
S _Duplicate_n][N
T   T   S N
_If_negative_Jump_to_Label_EXIT][S S S T    N
_Push_1][T  N
S T _Print_as_number][S S S T   S T T   T   S N
_Push_46_.][T   N
S S _Print_as_character][S N
S _Duplicate_n][S S S T S S N
_Push_4][T  S T S _Integer_divide][S S S T  T   S S T   T   S N
_Push_102][T    S S S _Add][T   N
S S _Print_as_character][S S S T    S S N
_Push_4][S S S T    T   N
_Push_3][S T    S S T   S N
_Copy_0-based_2nd:_n][S S S T   S N
_Push_2][T  S S S _Add][T   S T S _Integer_divide][T    S S T   _Subtract][T    N
S T _Print_as_number][S S S T   S S S S S N
_Push_32_<space>][T N
S S _Print_as_character][S S S T    T   S S T   S T N
_Push_101_e][T  N
S S _Print_as_character][S N
S _Duplicate_n][S S S T S N
_Push_2][T  S T T   _Modulo][S S S T    T   S N
_Push_6][S N
T   _Swap_top_two][T    S S T   _Subtract][T    N
S T _Print_as_number][S S S T   S S S S S N
_Push_32_<space>][T N
S S _Print_as_character][S S S T    S N
_Push_2][T  N
S T _Print_as_number][S S S T   S T T   T   S N
_Push_46_.][T   N
S S _Print_as_character][S N
S _Duplicate_n][S S S T S S N
_Push_4][T  S T S _Integer_divide][S S S T  T   S S T   T   T   N
_Push_103][S N
T   _Swap_top_two][T    S S T   _Subtract][T    N
S S _Print_as_character][S N
S _Duplicate_n][S S S T T   S N
_Push_6][T  S T S _Integer_divide][S S S T  S S N
_Push_4][S N
T   _Swap_top_two][T    S S T   _Subtract][T    N
S T _Print_as_number][S S S T   S S S S S N
_Push_32_<space>][T N
S S _Print_as_character][S S S T    S T S S S T N
_Push_81_Q][T   N
S S _Print_as_character][S S S T    T   S T S S S N
_Push_108_h][T  N
S S _Print_as_character][S S S T    S S N
_Push_4][T  N
S T _Print_as_number][S S S T   S S S T T   N
_Push_35_#][T   N
S S _Print_as_character][S S S T    S T S N
_Push_10_\n][T  N
S S _Print_as_character][N
S N
N
_Jump_to_Label_LOOP]
```
Letters `S` (space), `T` (tab), and `N` (new-line) added as highlighting only.  
`[..._some_action]` added as explanation only.
[**Try it online**](https://tio.run/##jVBBCoAwDDunr@jXRAS9CQo@v65pq/MgygiUJE3KjnnZp20dxslMVdEg0uCzwAlRAYoQOqBwCk46nGxmcAQh9FGkSoXbmZUOvpIiIYMzKlqvHq9BaHHY267@PxZdUnlwe/SrCfU3uYmH2h3CiG6NcwsXsxM) (with raw spaces, tabs and new-lines only).
**Explanation in pseudo-code:**
Port of [*@jdt*'s C answer](https://codegolf.stackexchange.com/a/252165/52210), with `3+(i>1)` replaced with `4-3/(n+2)`:
```
Integer n = 8
Start LOOP:
  n = n - 1
  If (n < 0):
    Stop program with an error, by jumping to an undefined label
  Print "1."
  Print n//4+102 as character
  Print 4-3//(n+2) as integer
  Print " e"
  Print 6-n%2 as integer
  Print " 2."
  Print 103-n//4 as character
  Print 6-n//4 as integer
  Print " Qh4#\n"
  Go to next iteration of LOOP
```
[Answer]
# [Regenerate](https://github.com/dloscutoff/Esolangs/tree/master/Regenerate) `-a`, 42 bytes
```
1.(f[34] e[56] 2.g4|g4 e[56] 2.f[34]) Qh4#
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72qKDU9NS-1KLEkdVm0km6iUuyCpaUlaboWN7UM9TTSoo1NYhVSo03NYhWM9NJNatJN4DywnKZCYIaJMkQHVOMCKA0A)
### Explanation
The logic is a bit clunkier than I'd like, but Regenerate doesn't have any string-based conditionals (yet).
```
1.(f[34] e[56] 2.g4|g4 e[56] 2.f[34]) Qh4#
1.                                          Match 1.
  (                |                )       Then match one of these two patterns:
   f[34]                                      f3 or f4
         e[56]                                followed by e5 or e6
               2.g4                           followed by 2.g4
                                            or
                    g4                        g4
                       e[56]                  followed by e5 or e6
                             2.f[34]          followed by 2.f3 or 2.f4
                                      Qh4#  Finally, match Qh4#
                                            The -a flag outputs all possible matches
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~37~~ 36 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
56āÌ'fìâ„g4δšDí«ε`"1.ÿ eÿ 2.ÿ Qh4#",
```
[Try it online.](https://tio.run/##yy9OTMpM/f/f1CzS53CPetrhNYcXPWqYl25ybsvRhS6H1x5afW5rgpKh3uH9CqlAbARiBGaYKCvp/P//X1c3L183J7GqEgA)
If outputting as a list of lines is allowed, the trailing `",` can be removed for -2 bytes: [try it online](https://tio.run/##yy9OTMpM/f/f1OxI4@Ee9bTDaw4vetQwL93k3JajC10Orz20@tzWBCVDvcP7FVKB2AjECMwwUf7/HwA).
**Explanation:**
```
56            # Push 56
  ā           # Push a list in the range [1,length] (without popping): [1,2]
   Ì          # Increase each by 2: [3,4]
    'fì      '# Prepend an "f" to each: ["f3","f4"]
       â      # Get the cartesian product of these two:
              #  [[5,"f3"],[5,"f4"],[6,"f3"],[6,"f4"]]
          δ   # Map over each inner list:
        „g4 š #  Prepend string "g4" to the list
              #   [["g4",5,"f3"],["g4",5,"f4"],["g4",6,"f3"],["g4",6,"f4"]]
D             # Duplicate this list of lists
 í            # Reverse each inner list:
              #  [["f3",5,"g4"],["f4",5,"g4"],["f3",6,"g4"],["f4",6,"g4"]]
  «           # Merge the two lists together
ε             # Foreach over each inner list:
 `            #  Pop and push the items of the list to the stack
  "1.ÿ eÿ 2.ÿ Qh4#"
              #  Push this string, where the `ÿ` are automatically one by one filled
              #  with the items
    ,         #  Pop and print it with trailing newline
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 37 bytes
```
ＦＥ34⁺g4fιＦ⪪ι²Ｅ56⪫⟦1.⁻ικ eλ 2.κ Qh4#⟧ω
```
[Try it online!](https://tio.run/##JYzBCsIwEER/ZVkvG4iCNXrxD4RCxaN4CMXapUtSYtXPXzd6e8y8mX6Mpc9RVIdcgNo4E@4Ceujk9SR8hMGYnXPw6y@z8ELsobGkK5yW/2R/MO2UOdEVtxvjlpPtTZycB4S7RVKhqeVU6TyGFd48fOz8qKrrt3wB "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
ＦＥ34⁺g4fι
```
Loop over the strings `g4f3` and `g4f4` representing the alternatives for White's pairs of moves.
```
Ｆ⪪ι²
```
Loop over each of White's possible moves from the current pair.
```
Ｅ56⪫⟦1.⁻ικ eλ 2.κ Qh4#⟧ω
```
Map over the characters `5` and `6` and output the following joined together for each line:
* The literal string `1.`
* The other move for White from the current pair
* The literal string  `e`
* The character `5` or `6` from the innermost loop
* The literal string  `2.`
* The move for White from the inner loop
* The literal string  `Qh4#`
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 37 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
“ḲṚẉċ‘ḤD“feg”żⱮ;Ṛ€$“1.““2.“Qh4#”żⱮK€Y
```
A full program that prints the eight games.
**[Try it online!](https://tio.run/##y0rNyan8//9Rw5yHOzY93Dnr4a7OI92PGmY83LHEBSiYlpr@qGHu0T2PNq6zBso@alqjAhQ11AMSQGQEogMzTJRharyBCiL//wcA "Jelly – Try It Online")**
```
“ḲṚẉċ‘ḤD“feg”żⱮ;Ṛ€$“1.““2.“Qh4#”żⱮK€Y - Main Link: no arguments
“ḲṚẉċ‘                                - code-page indices = [177,182,227,232]
      Ḥ                               - double           -> [354,364,454,464]
       D                              - decimal digits   -> [[3,5,4],[3,6,4],[4,5,4],[4,6,4]]
        “feg”                         - "feg"
             żⱮ                       - map with zip     -> [[['f',3],['e',5],['g',4]],[['f',3],['e',6],['g',4]],[['f',4],['e',5],['g',4]],[['f',4],['e',6],['g',4]]]
                  $                   - last two links as a monad:
                Ṛ€                    -   reverse each   -> [[['g',4],['e',5],['f',3]],[['g',4],['e',6],['f',3]],[['g',4],['e',5],['f',4]],[['g',4],['e',6],['f',4]]]
               ;                      -   concatenate    -> [[['f',3],['e',5],['g',4]],[['f',3],['e',6],['g',4]],[['f',4],['e',5],['g',4]],[['f',4],['e',6],['g',4]],[['g',4],['e',5],['f',3]],[['g',4],['e',6],['f',3]],[['g',4],['e',5],['f',4]],[['g',4],['e',6],['f',4]]]
                   “1.““2.“Qh4#”      - ["1.","","2.","Qh4#"]
                                żⱮ    - map with zip     -> [[["1.",['f',3]],[[],['e',5]],["2.",['g',4]],["Qh4#"]],[["1.",['f',3]],[[],['e',6]],["2.",['g',4]],["Qh4#"]],[["1.",['f',4]],[[],['e',5]],["2.",['g',4]],["Qh4#"]],[["1.",['f',4]],[[],['e',6]],["2.",['g',4]],["Qh4#"]],[["1.",['g',4]],[[],['e',5]],["2.",['f',3]],["Qh4#"]],[["1.",['g',4]],[[],['e',6]],["2.",['f',3]],["Qh4#"]],[["1.",['g',4]],[[],['e',5]],["2.",['f',4]],["Qh4#"]],[["1.",['g',4]],[[],['e',6]],["2.",['f',4]],["Qh4#"]]]
                                  K€  - space-join each  -> [["1.",['f',3],' ',[],['e',5],' ',"2.",['g',4],' ',"Qh4#"],["1.",['f',3],' ',[],['e',6],' ',"2.",['g',4],' ',"Qh4#"],["1.",['f',4],' ',[],['e',5],' ',"2.",['g',4],' ',"Qh4#"],["1.",['f',4],' ',[],['e',6],' ',"2.",['g',4],' ',"Qh4#"],["1.",['g',4],' ',[],['e',5],' ',"2.",['f',3],' ',"Qh4#"],["1.",['g',4],' ',[],['e',6],' ',"2.",['f',3],' ',"Qh4#"],["1.",['g',4],' ',[],['e',5],' ',"2.",['f',4],' ',"Qh4#"],["1.",['g',4],' ',[],['e',6],' ',"2.",['f',4],' ',"Qh4#"]]
                                    Y - newline-join     -> ["1.",['f',3],' ',[],['e',5],' ',"2.",['g',4],' ',"Qh4#",'\n',"1.",['f',3],' ',[],['e',6],' ',"2.",['g',4],' ',"Qh4#",'\n',"1.",['f',4],' ',[],['e',5],' ',"2.",['g',4],' ',"Qh4#",'\n',"1.",['f',4],' ',[],['e',6],' ',"2.",['g',4],' ',"Qh4#",'\n',"1.",['g',4],' ',[],['e',5],' ',"2.",['f',3],' ',"Qh4#",'\n',"1.",['g',4],' ',[],['e',6],' ',"2.",['f',3],' ',"Qh4#",'\n',"1.",['g',4],' ',[],['e',5],' ',"2.",['f',4],' ',"Qh4#",'\n',"1.",['g',4],' ',[],['e',6],' ',"2.",['f',4],' ',"Qh4#"]
                                      - implicit, smashing print
```
[Answer]
# MATLAB, 72 bytes
Somewhat straight-forward, but it's not how the tutorial tells you to do it. [Uses this little-known syntax](https://codegolf.stackexchange.com/a/111979).
```
function a b
```
is equivalent to
```
function('a','b')
```
Which means that two string inputs `'a'` and `'b'` can be entered `a b` instead of `('a','b')`, saving 6 bytes.
---
First make a string template that is equal to a row, but with "wild cards" for the characters that varies. All strings have `1.`,  `e`,  `2.`,  `Qh4#\n`. All other characters are stored in the string in the end.
I tried to find a way to use the pattern with similarities between rows, but string manipulation is verbose in Octave.
```
printf 1.%c%c e%c 2.%c%c Qh4#\n f35g4f36g4f45g4f46g4g45f3g45f4g46f3g46f4
```
[Try it online!](https://tio.run/##y08uSSxL/f@/oCgzryRNQ91QTzVZNVkhFYiNIMzADBPlmDx1HfU0Y9N0kzRjMyBhAmKZAFnpJqZpxiACyDIDsczSTNQ1//8HAA "Octave – Try It Online")
[Answer]
# C (gcc), 156 131 130 111 105 103 90 bytes
Some bytes lost because of @Steffan.
```
main(i){for(;i++<9;printf("1.%c%d e%d 2.%c%d Qh4#\n",102|i>5,4-3/i,5+i%2,102|i<6,4-i/8));}
```
Explained:
* import modules
* declare main
* declare iterator
* keep looping 8 times
* + print according to the format specifiers
* + - if i is lesser than 5, the first character is f, else g
* + - if i is less than 3, the first number is 3, else 4
* + - if i is odd and is less than six, or is six, then 5, else 6
* + - if i is less than 5, then 'g', else 'f'
* + - if i is less than 5 or is even, then 4, else 3.
* + add a newline
[Answer]
# [Python 3](https://docs.python.org/3/), 118 bytes
```
for f in 0,1:
 x='f3','f4';y='g4',
 if f:y,x=x,y
 [print(f'1.{w} e{r} 2.{W} Qh4#')for w in x for W in y for r in[5,6]]
```
[Try it online!](https://tio.run/##HcyxCoMwFAXQPV9xocNr4SG1ph0s@YhODuLYV7NECYIJId@eGrcznTVu8@K6UmTxEFiHO7e9QjAkHTGJpnc09NPEClYgfeRgAkeFcfXWbVehtkl7xjf5jEeThozPrC90q@Nex4DKoTKe9AfHJ7@mqZQ/ "Python 3 – Try It Online")
]