Skip to main content
added 37 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

05AB1E, 3737 36 bytes

56YLÌ'fìâ„g4δšDí«ε`"156āÌ'fìâ„g4δšDí«ε`"1.ÿ eÿ 2.ÿ Qh4#",

Try it online.

If outputting as a list of lines is allowed, the trailing ", can be removed for -2 bytes: try it onlinetry it online.

Explanation:

56             # Push 56
  YLā           # Push paira 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 (in reversed order) to the stack
  "1.ÿ eÿ 2.ÿ Qh4#"
               #  Push this string, withwhere the `ÿ` are automatically one by one filled
              #  with the items
    ,          #  Pop and print it with trailing newline

05AB1E, 37 bytes

56YLÌ'fìâ„g4δšDí«ε`"1.ÿ eÿ 2.ÿ Qh4#",

Try it online.

If outputting as a list of lines is allowed, the trailing ", can be removed for -2 bytes: try it online.

Explanation:

56             # Push 56
  YL           # Push pair [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 (in reversed order) to the stack
  "1.ÿ eÿ 2.ÿ Qh4#"
               #  Push this string, with the `ÿ` automatically filled with the items
    ,          #  Pop and print it with trailing newline

05AB1E, 37 36 bytes

56āÌ'fìâ„g4δšDí«ε`"1.ÿ eÿ 2.ÿ Qh4#",

Try it online.

If outputting as a list of lines is allowed, the trailing ", can be removed for -2 bytes: try it online.

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
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

05AB1E, 37 bytes

56YLÌ'fìâ„g4δšDí«ε`"1.ÿ eÿ 2.ÿ Qh4#",

Try it online.

If outputting as a list of lines is allowed, the trailing ", can be removed for -2 bytes: try it online.

Explanation:

56             # Push 56
  YL           # Push pair [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 (in reversed order) to the stack
  "1.ÿ eÿ 2.ÿ Qh4#"
               #  Push this string, with the `ÿ` automatically filled with the items
    ,          #  Pop and print it with trailing newline