Post History
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...
#7: Post edited
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
- 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
- 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
- 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
- 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
- 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
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"