Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

71%
+3 −0
Challenges Label a hinged tetromino

Given a hinged tetromino, give it a unique, consistent label independent of location, rotation, and reflection. Tetrominoes A tetromino is a connected subset of the square tiling, composed of 4 s...

2 answers  ·  posted 1y ago by trichoplax‭  ·  last activity 1y ago by RubenVerg‭

#7: Post edited by user avatar trichoplax‭ · 2023-07-07T18:41:31Z (over 1 year ago)
Emphasise that label must stay the same when moved
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • All 8 of these rotated and reflected versions must have the same label.
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - Apart from the 4 squares of the hinged tetromino, all other squares are empty.
  • - You may take input in any convenient format that does not include full or partial precalculation. For example:
  • - A string or sequence of strings.
  • - A 1 or 2 dimensional list/array/vector.
  • - A sequence of coordinates (even a sequence of X coordinates and a separate sequence of Y coordinates if you wish).
  • - A 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background.
  • - A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given a hinged tetromino, give it a unique, consistent label independent of location, rotation, and reflection.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • All 8 of these rotated and reflected versions must have the same label. Translating, rotating, or reflecting a hinged tetromino must not change its label.
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - Apart from the 4 squares of the hinged tetromino, all other squares are empty.
  • - You may take input in any convenient format that does not include full or partial precalculation. For example:
  • - A string or sequence of strings.
  • - A 1 or 2 dimensional list/array/vector.
  • - A sequence of coordinates (even a sequence of X coordinates and a separate sequence of Y coordinates if you wish).
  • - A 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background.
  • - A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#6: Post edited by user avatar trichoplax‭ · 2023-06-24T10:40:58Z (over 1 year ago)
Explicitly allow separate sequences for X coordinates and Y coordinates
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • All 8 of these rotated and reflected versions must have the same label.
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - Apart from the 4 squares of the hinged tetromino, all other squares are empty.
  • - You may take input in any convenient format that does not include full or partial precalculation. For example:
  • - A string or sequence of strings.
  • - A 1 or 2 dimensional list/array/vector.
  • - A sequence of coordinates.
  • - A 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background.
  • - A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • All 8 of these rotated and reflected versions must have the same label.
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - Apart from the 4 squares of the hinged tetromino, all other squares are empty.
  • - You may take input in any convenient format that does not include full or partial precalculation. For example:
  • - A string or sequence of strings.
  • - A 1 or 2 dimensional list/array/vector.
  • - A sequence of coordinates (even a sequence of X coordinates and a separate sequence of Y coordinates if you wish).
  • - A 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background.
  • - A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#5: Post edited by user avatar trichoplax‭ · 2023-06-20T15:47:53Z (over 1 year ago)
Emphasise that the label must be the same for rotations and reflections
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - Apart from the 4 squares of the hinged tetromino, all other squares are empty.
  • - You may take input in any convenient format that does not include full or partial precalculation. For example:
  • - A string or sequence of strings.
  • - A 1 or 2 dimensional list/array/vector.
  • - A sequence of coordinates.
  • - A 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background.
  • - A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • All 8 of these rotated and reflected versions must have the same label.
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - Apart from the 4 squares of the hinged tetromino, all other squares are empty.
  • - You may take input in any convenient format that does not include full or partial precalculation. For example:
  • - A string or sequence of strings.
  • - A 1 or 2 dimensional list/array/vector.
  • - A sequence of coordinates.
  • - A 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background.
  • - A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#4: Post edited by user avatar trichoplax‭ · 2023-06-18T16:49:43Z (over 1 year ago)
Explicitly state that other than the hinged tetromino, the input is all empty squares
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - You may take input in any convenient format that does not include full or partial precalculation. For example:
  • - A string or sequence of strings.
  • - A 1 or 2 dimensional list/array/vector.
  • - A sequence of coordinates.
  • - A 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background.
  • - A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - Apart from the 4 squares of the hinged tetromino, all other squares are empty.
  • - You may take input in any convenient format that does not include full or partial precalculation. For example:
  • - A string or sequence of strings.
  • - A 1 or 2 dimensional list/array/vector.
  • - A sequence of coordinates.
  • - A 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background.
  • - A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#3: Post edited by user avatar trichoplax‭ · 2023-06-17T23:19:47Z (over 1 year ago)
Tidy up input section
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - You may take input in any convenient format that does not include full or partial precalculation.
  • - For example, this could be a string or sequence of strings, a 1 or 2 dimensional list/array/vector, a sequence of coordinates, or a 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background. A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - You may take input in any convenient format that does not include full or partial precalculation. For example:
  • - A string or sequence of strings.
  • - A 1 or 2 dimensional list/array/vector.
  • - A sequence of coordinates.
  • - A 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background.
  • - A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#2: Post edited by user avatar trichoplax‭ · 2023-06-17T22:37:09Z (over 1 year ago)
Add section on equivalence
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - You may take input in any convenient format that does not include full or partial precalculation.
  • - For example, this could be a string or sequence of strings, a 1 or 2 dimensional list/array/vector, a sequence of coordinates, or a 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background. A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given a hinged tetromino, give it a unique, consistent label.
  • ## Tetrominoes
  • A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.
  • Here are the 5 tetrominoes:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)
  • ## Hinged tetrominoes
  • A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.
  • Here are the 22 hinged tetrominoes:
  • [![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)
  • ## Equivalence
  • The following 8 shapes are all considered to be the same hinged tetromino. They are equivalent because any one can be reached from any other by some combination of rotation, reflection, and translation:
  • [![8 equivalent hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/equivalent_hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/equivalent_hinged_tetrominoes.svg)
  • ## Input
  • - A 4 by 4 grid containing a hinged tetromino.
  • - You may take input in any convenient format that does not include full or partial precalculation.
  • - For example, this could be a string or sequence of strings, a 1 or 2 dimensional list/array/vector, a sequence of coordinates, or a 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background. A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.
  • ## Output
  • - A label for the hinged tetromino.
  • - The label for each hinged tetromino can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other hinged tetromino).
  • - Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).
  • ## Scoring
  • This is a [code golf challenge]. Your score is the number of bytes in your code.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#1: Initial revision by user avatar trichoplax‭ · 2023-06-17T17:18:49Z (over 1 year ago)
Label a hinged tetromino
Given a hinged tetromino, give it a unique, consistent label.

## Tetrominoes
A ***[tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can only be **edge connection**.

Here are the 5 tetrominoes:

[![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/tetrominoes.svg)

## Hinged tetrominoes
A ***[hinged tetromino]*** is a connected subset of the square tiling, composed of 4 squares, where connection can be **edge connection** or **corner connection**.

Here are the 22 hinged tetrominoes:

[![the 22 hinged tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/hinged_tetrominoes.svg)](https://github.com/trichoplax/hinged-tetromino-image/blob/main/hinged_tetrominoes.svg)

## Input
- A 4 by 4 grid containing a hinged tetromino.
- You may take input in any convenient format that does not include full or partial precalculation.
- For example, this could be a string or sequence of strings, a 1 or 2 dimensional list/array/vector, a sequence of coordinates, or a 16 bit variable where each 1 bit represents part of the hinged tetromino and each 0 bit represents part of the background. A variable with more than 16 bits where only 16 of the bits are used would also be acceptable.

## Output
- A label for the hinged tetromino.
- The label for each hinged tetromino can be anything you choose, including nothing (no output).
- Each label must be unique (it must not be the label for any other hinged tetromino).
- Each label must be consistent (a given hinged tetromino must always result in the same label, regardless of rotation, reflection, or translation).

## Scoring
This is a [code golf challenge]. Your score is the number of bytes in your code.

> Explanations are optional, but I'm more likely to upvote answers that have one.


[tetromino]: https://en.wikipedia.org/wiki/Tetromino "Wikipedia article on Tetromino"

[hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"

[code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"