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 »
Sandbox

Post History

60%
+1 −0
Sandbox Label the hinged tetrominoes - [FINALIZED]

posted 1y ago by trichoplax‭  ·  edited 1y ago by trichoplax‭

#7: Post edited by user avatar trichoplax‭ · 2023-06-17T17:20:12Z (over 1 year ago)
Mark as finalized
  • Label the hinged tetrominoes
  • Label the hinged tetrominoes - [FINALIZED]
  • 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"
  • # Now posted: [Label a hinged tetromino](https://codegolf.codidact.com/posts/288502)
  • ---
  • 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"
#6: Post edited by user avatar trichoplax‭ · 2023-06-17T17:12:19Z (over 1 year ago)
Pedantic punctuating
  • 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)
  • ## 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"
#5: Post edited by user avatar trichoplax‭ · 2023-06-17T15:34:53Z (over 1 year ago)
Include "consistent" in description to match the output rules
  • Given a hinged tetromino, give it a unique 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)
  • ## 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"
#4: Post edited by user avatar trichoplax‭ · 2023-06-17T15:33:13Z (over 1 year ago)
Consistently use "hinged tetromino" rather than "tetraplet"
  • Given a hinged tetromino, give it a unique 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 tetraplet 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 tetraplet
  • - The label for each tetraplet can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other tetraplet).
  • - Each label must be consistent (a given tetraplet 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 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"
#3: Post edited by user avatar trichoplax‭ · 2023-06-17T14:17:46Z (over 1 year ago)
Use my own images so they both have consistent design
  • Given a hinged tetromino, give it a unique 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, thanks to Wikipedia]:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://en.wikipedia.org/wiki/File:All_5_free_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, thanks to Wikipedia]:
  • [![the 22 hinged tetrominoes](https://upload.wikimedia.org/wikipedia/commons/4/46/Tetrakings.png)](https://en.wikipedia.org/wiki/File:Tetrakings.png)
  • ## 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 tetraplet 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 tetraplet
  • - The label for each tetraplet can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other tetraplet).
  • - Each label must be consistent (a given tetraplet 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"
  • [5 tetrominoes, thanks to Wikipedia]: https://en.wikipedia.org/wiki/File:All_5_free_tetrominoes.svg
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [22 hinged tetrominoes, thanks to Wikipedia]: https://en.wikipedia.org/wiki/File:Tetrakings.png
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given a hinged tetromino, give it a unique 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 tetraplet 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 tetraplet
  • - The label for each tetraplet can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other tetraplet).
  • - Each label must be consistent (a given tetraplet 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-17T11:25:28Z (over 1 year ago)
Test SVG from a GitHub repo
  • Given a hinged tetromino, give it a unique 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, thanks to Wikipedia]:
  • [![the 5 tetrominoes](https://upload.wikimedia.org/wikipedia/commons/5/50/All_5_free_tetrominoes.svg)](https://en.wikipedia.org/wiki/File:All_5_free_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, thanks to Wikipedia]:
  • [![the 22 hinged tetrominoes](https://upload.wikimedia.org/wikipedia/commons/4/46/Tetrakings.png)](https://en.wikipedia.org/wiki/File:Tetrakings.png)
  • ## 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 tetraplet 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 tetraplet
  • - The label for each tetraplet can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other tetraplet).
  • - Each label must be consistent (a given tetraplet 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"
  • [5 tetrominoes, thanks to Wikipedia]: https://en.wikipedia.org/wiki/File:All_5_free_tetrominoes.svg
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [22 hinged tetrominoes, thanks to Wikipedia]: https://en.wikipedia.org/wiki/File:Tetrakings.png
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
  • Given a hinged tetromino, give it a unique 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, thanks to Wikipedia]:
  • [![the 5 tetrominoes](https://raw.githubusercontent.com/trichoplax/hinged-tetromino-image/main/tetrominoes.svg)](https://en.wikipedia.org/wiki/File:All_5_free_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, thanks to Wikipedia]:
  • [![the 22 hinged tetrominoes](https://upload.wikimedia.org/wikipedia/commons/4/46/Tetrakings.png)](https://en.wikipedia.org/wiki/File:Tetrakings.png)
  • ## 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 tetraplet 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 tetraplet
  • - The label for each tetraplet can be anything you choose, including nothing (no output).
  • - Each label must be unique (it must not be the label for any other tetraplet).
  • - Each label must be consistent (a given tetraplet 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"
  • [5 tetrominoes, thanks to Wikipedia]: https://en.wikipedia.org/wiki/File:All_5_free_tetrominoes.svg
  • [hinged tetromino]: https://en.wikipedia.org/wiki/Pseudo-polyomino "Wikipedia article on Pseudo-polyomino"
  • [22 hinged tetrominoes, thanks to Wikipedia]: https://en.wikipedia.org/wiki/File:Tetrakings.png
  • [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#1: Initial revision by user avatar trichoplax‭ · 2023-06-17T10:50:04Z (over 1 year ago)
Label the hinged tetrominoes
Given a hinged tetromino, give it a unique 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, thanks to Wikipedia]:

[![the 5 tetrominoes](https://upload.wikimedia.org/wikipedia/commons/5/50/All_5_free_tetrominoes.svg)](https://en.wikipedia.org/wiki/File:All_5_free_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, thanks to Wikipedia]:

[![the 22 hinged tetrominoes](https://upload.wikimedia.org/wikipedia/commons/4/46/Tetrakings.png)](https://en.wikipedia.org/wiki/File:Tetrakings.png)

## 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 tetraplet 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 tetraplet
- The label for each tetraplet can be anything you choose, including nothing (no output).
- Each label must be unique (it must not be the label for any other tetraplet).
- Each label must be consistent (a given tetraplet 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"

[5 tetrominoes, thanks to Wikipedia]: https://en.wikipedia.org/wiki/File:All_5_free_tetrominoes.svg

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

[22 hinged tetrominoes, thanks to Wikipedia]: https://en.wikipedia.org/wiki/File:Tetrakings.png

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