Skip to main content
added 63 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 7 bytes

2Bṗ4ṫ6Y

Try it online!

(5 bytes if trailing lines of nybbles are allowed, 2Bṗ4Y)

How?

Prints in descending order.

2Bṗ4ṫ6Y - Main link, no arguments
2B      - 2 converted to binary -> [1,0]
  ṗ4    - Cartesian 4th power -> [[1,1,1,1], [1,1,1,0], ..., [0,0,0,0]]
                            i.e.  16       , 15         ..., 0
    ṫ6  - tail from 6th item  -> [[1,0,1,0], [1,0,0,1], ..., [0,0,0,0]]
                            i.e.  10       , 9        , ..., 0
      Y - join with line feeds
        - implicit print

An alternative 7-byter is 2ṗ4Ịṫ6Y, the [1,0] is replaced with [1,2] and is the "is insignificant" monad (abs(z)<=1), converting 2s to 0s.

Jelly, 7 bytes

2Bṗ4ṫ6Y

Try it online!

How?

Prints in descending order.

2Bṗ4ṫ6Y - Main link, no arguments
2B      - 2 converted to binary -> [1,0]
  ṗ4    - Cartesian 4th power -> [[1,1,1,1], [1,1,1,0], ..., [0,0,0,0]]
                            i.e.  16       , 15         ..., 0
    ṫ6  - tail from 6th item  -> [[1,0,1,0], [1,0,0,1], ..., [0,0,0,0]]
                            i.e.  10       , 9        , ..., 0
      Y - join with line feeds
        - implicit print

An alternative 7-byter is 2ṗ4Ịṫ6Y, the [1,0] is replaced with [1,2] and is the "is insignificant" monad (abs(z)<=1), converting 2s to 0s.

Jelly, 7 bytes

2Bṗ4ṫ6Y

Try it online!

(5 bytes if trailing lines of nybbles are allowed, 2Bṗ4Y)

How?

Prints in descending order.

2Bṗ4ṫ6Y - Main link, no arguments
2B      - 2 converted to binary -> [1,0]
  ṗ4    - Cartesian 4th power -> [[1,1,1,1], [1,1,1,0], ..., [0,0,0,0]]
                            i.e.  16       , 15         ..., 0
    ṫ6  - tail from 6th item  -> [[1,0,1,0], [1,0,0,1], ..., [0,0,0,0]]
                            i.e.  10       , 9        , ..., 0
      Y - join with line feeds
        - implicit print

An alternative 7-byter is 2ṗ4Ịṫ6Y, the [1,0] is replaced with [1,2] and is the "is insignificant" monad (abs(z)<=1), converting 2s to 0s.

added 557 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 7 bytesbytes

2Bṗ4ṫ6Y

Try it online!Try it online!

How?

Prints in descending order.

2Bṗ4ṫ6Y - Main link, no arguments
2B      - 2 converted to binary -> [1,0]
  ṗ4    - Cartesian 4th power -> [[1,1,1,1], [1,1,1,0], ..., [0,0,0,0]]
                            i.e.  16       , 15         ..., 0
    ṫ6  - tail from 6th item  -> [[1,0,1,0], [1,0,0,1], ..., [0,0,0,0]]
                            i.e.  10       , 9        , ..., 0
      Y - join with line feeds
        - implicit print

An alternative 7-byter is 2ṗ4Ịṫ6Y, the [1,0] is replaced with [1,2] and is the "is insignificant" monad (abs(z)<=1), converting 2s to 0s.

Jelly, 7 bytes

2Bṗ4ṫ6Y

Try it online!

Jelly, 7 bytes

2Bṗ4ṫ6Y

Try it online!

How?

Prints in descending order.

2Bṗ4ṫ6Y - Main link, no arguments
2B      - 2 converted to binary -> [1,0]
  ṗ4    - Cartesian 4th power -> [[1,1,1,1], [1,1,1,0], ..., [0,0,0,0]]
                            i.e.  16       , 15         ..., 0
    ṫ6  - tail from 6th item  -> [[1,0,1,0], [1,0,0,1], ..., [0,0,0,0]]
                            i.e.  10       , 9        , ..., 0
      Y - join with line feeds
        - implicit print

An alternative 7-byter is 2ṗ4Ịṫ6Y, the [1,0] is replaced with [1,2] and is the "is insignificant" monad (abs(z)<=1), converting 2s to 0s.

Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 7 bytes

2Bṗ4ṫ6Y

Try it online!