Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 206 characters in body; added 1 character in body; added 3 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

Jelly, 34 bytes

Ẏ9ḟƑƇṭ8ドルṢ€ȯW)ẎQ
;þ;Z,ドルƝ€ẎW€çƬ$ṪLo1

Try it online!

A dyadic link taking the dimensions as the left and right arguments and returning an integer. The TIO footer generates a 4x4 table similar to the one in the question; the argument for the footer is the size of the table to generate.

Full explanation to follow, but in brief this generates all possible dominoes and then builds all possible lists of those dominoes that don’t have any overlaps. It would be fairly straightforward to extend this to larger polyominoes (though the first part of the code would be a bit more complex); here’s an initial attempt.

Jelly, 34 bytes

Ẏ9ḟƑƇṭ8ドルṢ€ȯW)ẎQ
;þ;Z,ドルƝ€ẎW€çƬ$ṪLo1

Try it online!

A dyadic link taking the dimensions as the left and right arguments and returning an integer. The TIO footer generates a 4x4 table similar to the one in the question; the argument for the footer is the size of the table to generate.

Full explanation to follow, but in brief this generates all possible dominoes and then builds all possible lists of those dominoes that don’t have any overlaps. It would be fairly straightforward to extend this to larger polyominoes (though the first part of the code would be a bit more complex).

Jelly, 34 bytes

Ẏ9ḟƑƇṭ8ドルṢ€ȯW)ẎQ
;þ;Z,ドルƝ€ẎW€çƬ$ṪLo1

Try it online!

A dyadic link taking the dimensions as the left and right arguments and returning an integer. The TIO footer generates a 4x4 table similar to the one in the question; the argument for the footer is the size of the table to generate.

Full explanation to follow, but in brief this generates all possible dominoes and then builds all possible lists of those dominoes that don’t have any overlaps. It would be fairly straightforward to extend this to larger polyominoes (though the first part of the code would be a bit more complex); here’s an initial attempt.

Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

Jelly, 34 bytes

Ẏ9ḟƑƇṭ8ドルṢ€ȯW)ẎQ
;þ;Z,ドルƝ€ẎW€çƬ$ṪLo1

Try it online!

A dyadic link taking the dimensions as the left and right arguments and returning an integer. The TIO footer generates a 4x4 table similar to the one in the question; the argument for the footer is the size of the table to generate.

Full explanation to follow, but in brief this generates all possible dominoes and then builds all possible lists of those dominoes that don’t have any overlaps. It would be fairly straightforward to extend this to larger polyominoes (though the first part of the code would be a bit more complex).

AltStyle によって変換されたページ (->オリジナル) /