Skip to main content
golfed a byte
Source Link
ETHproductions
  • 50.1k
  • 6
  • 94
  • 240

Japt, 13 1212 11 bytes

Saved a byte thanks to @Shaggy

9ó8_ì[1J0]9ó8_ìJõ é)Å

Try it online!Try it online! Uses -R flag to put each item on its own line.

Explanation

9ó8_ì[1J0]9ó8_ìJõ é)Å
9ó8             Create the range [9, 9+8). [9, 10, ..., 16]
   _            Map each item in this range through this function:
    ì[1J0] Jõ é)        Generate the range [-1...1] and rotate to get [1, -1, 0].
    ì             Convert the item to an array of base-3 digits,
                   mapping [0,1,2] to [1,-1,0]. [[-1, 1, 1], [-1, 1,-1], [-1, 1, 0],
                                                 [-1,-1, 1], [-1,-1,-1], [-1,-1, 0],
                                                 [-1, 0, 1], [-1, 0,-1]]
           Å       Remove the first item (gets rid of the leading -1).

Japt, 13 12 bytes

9ó8_ì[1J0] Å

Try it online! Uses -R flag to put each item on its own line.

Explanation

9ó8_ì[1J0] Å
9ó8             Create the range [9, 9+8). [9, 10, ..., 16]
   _            Map each item in this range through this function:
    ì[1J0]         Convert the item to an array of base-3 digits,
                   mapping [0,1,2] to [1,-1,0]. [[-1, 1, 1], [-1, 1,-1], [-1, 1, 0],
                                                 [-1,-1, 1], [-1,-1,-1], [-1,-1, 0],
                                                 [-1, 0, 1], [-1, 0,-1]]
           Å       Remove the first item (gets rid of the leading -1).

Japt, 13 12 11 bytes

Saved a byte thanks to @Shaggy

9ó8_ìJõ é)Å

Try it online! Uses -R flag to put each item on its own line.

Explanation

9ó8_ìJõ é)Å
9ó8             Create the range [9, 9+8). [9, 10, ..., 16]
   _            Map each item in this range through this function:
     Jõ é)        Generate the range [-1...1] and rotate to get [1, -1, 0].
    ì             Convert the item to an array of base-3 digits,
                  mapping [0,1,2] to [1,-1,0]. [[-1, 1, 1], [-1, 1,-1], [-1, 1, 0],
                                                [-1,-1, 1], [-1,-1,-1], [-1,-1, 0],
                                                [-1, 0, 1], [-1, 0,-1]]
          Å       Remove the first item (gets rid of the leading -1).
golfed a byte
Source Link
ETHproductions
  • 50.1k
  • 6
  • 94
  • 240

Japt, 1313 12 bytes

9ó9_ì39ó8_ì[1J0] ÅmÉÃfdÅ

Try it online!Try it online! Uses -R flag to put each item on its own line.

Explanation

9ó9_  ì39ó8_ì[1J0] Å  mÉ Ã fd
9ó9Z{Zì3 s1 m-1} fd    Ungolfed
9ó9       9ó8             Create the range [9, 9+99+8). [9, 10, ..., 17]16]
   Z{     _     }       Map each item Z in this range through this function:
     Zì3        ì[1J0]         Convert Zthe item to an array of base-3 digits. [[1,0
                   mapping [0,0]1,2] to [1,0-1,1]0]. [[-1, ...1, [11],2 [-1,2]]
 1,-1], [-1, 1, 0],
     s1              Remove the first item. [[0,0], [0,1], ..., [2,2]]
            m-1          Subtract [-1 from each,-1, item.1], [[[-1,-1,-1], [-1,0], ...-1, [10],1]]
                 f     In the result, keep only the items X where
                  d [-1, 0, 1], [-1, 0,-1]]
 some of the items of X are truthy   Å       Remove the first item (removesgets [0,0]rid of the leading -1).

Japt, 13 bytes

9ó9_ì3 ÅmÉÃfd

Try it online! Uses -R flag to put each item on its own line.

Explanation

9ó9_  ì3 Å  mÉ Ã fd
9ó9Z{Zì3 s1 m-1} fd    Ungolfed
9ó9                    Create the range [9, 9+9). [9, 10, ..., 17]
   Z{          }       Map each item Z in this range through this function:
     Zì3                 Convert Z to an array of base-3 digits. [[1,0,0], [1,0,1], ..., [1,2,2]]
         s1              Remove the first item. [[0,0], [0,1], ..., [2,2]]
            m-1          Subtract 1 from each item. [[-1,-1], [-1,0], ..., [1,1]]
                 f     In the result, keep only the items X where
                  d      some of the items of X are truthy (removes [0,0]).

Japt, 13 12 bytes

9ó8_ì[1J0] Å

Try it online! Uses -R flag to put each item on its own line.

Explanation

9ó8_ì[1J0] Å
9ó8             Create the range [9, 9+8). [9, 10, ..., 16]
   _            Map each item in this range through this function:
    ì[1J0]         Convert the item to an array of base-3 digits,
                   mapping [0,1,2] to [1,-1,0]. [[-1, 1, 1], [-1, 1,-1], [-1, 1, 0],
                                                 [-1,-1, 1], [-1,-1,-1], [-1,-1, 0],
                                                 [-1, 0, 1], [-1, 0,-1]]
           Å       Remove the first item (gets rid of the leading -1).
added explanation
Source Link
ETHproductions
  • 50.1k
  • 6
  • 94
  • 240

Japt, 13 bytes

9ó9_ì3 ÅmÉÃfd

Try it online! Uses -R flag to put each item on its own line.

Explanation

9ó9_  ì3 Å  mÉ Ã fd
9ó9Z{Zì3 s1 m-1} fd    Ungolfed
9ó9                    Create the range [9, 9+9). [9, 10, ..., 17]
   Z{          }       Map each item Z in this range through this function:
     Zì3                 Convert Z to an array of base-3 digits. [[1,0,0], [1,0,1], ..., [1,2,2]]
         s1              Remove the first item. [[0,0], [0,1], ..., [2,2]]
            m-1          Subtract 1 from each item. [[-1,-1], [-1,0], ..., [1,1]]
                 f     In the result, keep only the items X where
                  d      some of the items of X are truthy (removes [0,0]).

Japt, 13 bytes

9ó9_ì3 ÅmÉÃfd

Try it online! Uses -R flag to put each item on its own line.

Japt, 13 bytes

9ó9_ì3 ÅmÉÃfd

Try it online! Uses -R flag to put each item on its own line.

Explanation

9ó9_  ì3 Å  mÉ Ã fd
9ó9Z{Zì3 s1 m-1} fd    Ungolfed
9ó9                    Create the range [9, 9+9). [9, 10, ..., 17]
   Z{          }       Map each item Z in this range through this function:
     Zì3                 Convert Z to an array of base-3 digits. [[1,0,0], [1,0,1], ..., [1,2,2]]
         s1              Remove the first item. [[0,0], [0,1], ..., [2,2]]
            m-1          Subtract 1 from each item. [[-1,-1], [-1,0], ..., [1,1]]
                 f     In the result, keep only the items X where
                  d      some of the items of X are truthy (removes [0,0]).
Source Link
ETHproductions
  • 50.1k
  • 6
  • 94
  • 240
Loading