Post History
Sandbox
Pinwheel words [FINALIZED]
#14: Post edited
Pinwheel words
- Pinwheel words [FINALIZED]
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- The 3 rotation types will be given the challenge-specific names ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- m : m
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- m : w
- o : o
- p : b
- q : d
- t : f
- w : m
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HIDE" : ["HIDE"]
- "CHEM" : ["CHEW"]
- "COM" : ["COW"]
- "DEWI" : ["DEMI"]
- "MAY" : ["YAM"]
- "MEEK" : ["WEEK"]
- "MICK" : ["WICK"]
- "MIT" : ["TIM"]
- "MON" : ["NOW"]
- "MONS" : ["SNOW"]
- "MOOD" : ["WOOD"]
- "NIM" : ["WIN"]
- "OAT" : ["TAO"]
- "OHM" : ["WHO", "MHO", "OHW", "OHM"]
- "OWT" : ["TWO"]
- "SNOW" : ["MONS"]
- "TAO" : ["OAT"]
- "TIM" : ["MIT"]
- "TWO" : ["OWT"]
- "WAY" : ["YAW"]
- "WEEK" : ["MEEK"]
- "WHO" : ["OHM", "OHW", "MHO", "WHO"]
- "WICK" : ["MICK"]
- "WIN" : ["NIM"]
- "WOE" : ["MOE"]
- "WOOD" : ["MOOD"]
- "YAW" : ["WAY"]
- "bib" : ["did"]
- "blob" : ["qolq", "dold", "plop", "blob"]
- "blow" : ["molq", "wold", "plom", "blow"]
- "Bob" : ["Bop"]
- "bom" : ["woq", "mod", "pow", "bom"]
- "bool" : ["looq", "lood", "pool", "bool"]
- "boom" : ["wooq", "mood", "poow", "boom"]
- "Bop" : ["Bob"]
- "box" : ["xoq", "xod", "pox", "box"]
- "Cob" : ["Cop"]
- "cob" : ["cop"]
- "did" : ["bib"]
- "dooms" : ["swoop"]
- "fob" : ["top"]
- "fool" : ["tool"]
- "HEM" : ["HEW"]
- "HEW" : ["HEM"]
- "hold" : ["ploy"]
- "loom" : ["wool", "mool", "loow", "loom"]
- "MIA" : ["AIM"]
- "mod" : ["pow", "bom", "woq", "mod"]
- "mold" : ["plow", "blom", "wolq", "mold"]
- "molt" : ["wolf"]
- "mood" : ["poow", "boom", "wooq", "mood"]
- "moot" : ["woof"]
- "owns" : ["sumo"]
- "plop" : ["dold", "qolq", "blob", "plop"]
- "plow" : ["mold", "wolq", "blom", "plow"]
- "ploy" : ["hold"]
- "pow" : ["mod", "woq", "bom", "pow"]
- "pox" : ["xod", "xoq", "box", "pox"]
- "sumo" : ["owns"]
- "swoop" : ["dooms"]
- "tool" : ["fool"]
- "top" : ["fob"]
- "wold" : ["plom", "blow", "molq", "wold"]
- "wolf" : ["molt"]
- "woof" : ["moot"]
- "wool" : ["loom", "loow", "mool", "wool"]
- "HIMNOSWXZbdhlmnopqsuwxyz" : ["zhxmnsbdouwlypqZXMSONWIH"]
- "AHIMOTUVWXYbdilmopqvwx" : ["xwvpqomlibdYXWVUTOMIHA"]
- "BCDEHIKMOWXbcdflmopqtwx" : ["BCDEHIKWOMXpcqtlwobdfmx"]
- "pmXWbMwdoHIlqOx" : ["xOblIHopmWqMXwd", "xOplIHobwMdWXmq", "bwXMpWmqoHIldOx", "pmXWbMwdoHIlqOx"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- # Now posted: [Pinwheel words](https://codegolf.codidact.com/posts/287299)
- ---
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- The 3 rotation types will be given the challenge-specific names ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- m : m
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- m : w
- o : o
- p : b
- q : d
- t : f
- w : m
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HIDE" : ["HIDE"]
- "CHEM" : ["CHEW"]
- "COM" : ["COW"]
- "DEWI" : ["DEMI"]
- "MAY" : ["YAM"]
- "MEEK" : ["WEEK"]
- "MICK" : ["WICK"]
- "MIT" : ["TIM"]
- "MON" : ["NOW"]
- "MONS" : ["SNOW"]
- "MOOD" : ["WOOD"]
- "NIM" : ["WIN"]
- "OAT" : ["TAO"]
- "OHM" : ["WHO", "MHO", "OHW", "OHM"]
- "OWT" : ["TWO"]
- "SNOW" : ["MONS"]
- "TAO" : ["OAT"]
- "TIM" : ["MIT"]
- "TWO" : ["OWT"]
- "WAY" : ["YAW"]
- "WEEK" : ["MEEK"]
- "WHO" : ["OHM", "OHW", "MHO", "WHO"]
- "WICK" : ["MICK"]
- "WIN" : ["NIM"]
- "WOE" : ["MOE"]
- "WOOD" : ["MOOD"]
- "YAW" : ["WAY"]
- "bib" : ["did"]
- "blob" : ["qolq", "dold", "plop", "blob"]
- "blow" : ["molq", "wold", "plom", "blow"]
- "Bob" : ["Bop"]
- "bom" : ["woq", "mod", "pow", "bom"]
- "bool" : ["looq", "lood", "pool", "bool"]
- "boom" : ["wooq", "mood", "poow", "boom"]
- "Bop" : ["Bob"]
- "box" : ["xoq", "xod", "pox", "box"]
- "Cob" : ["Cop"]
- "cob" : ["cop"]
- "did" : ["bib"]
- "dooms" : ["swoop"]
- "fob" : ["top"]
- "fool" : ["tool"]
- "HEM" : ["HEW"]
- "HEW" : ["HEM"]
- "hold" : ["ploy"]
- "loom" : ["wool", "mool", "loow", "loom"]
- "MIA" : ["AIM"]
- "mod" : ["pow", "bom", "woq", "mod"]
- "mold" : ["plow", "blom", "wolq", "mold"]
- "molt" : ["wolf"]
- "mood" : ["poow", "boom", "wooq", "mood"]
- "moot" : ["woof"]
- "owns" : ["sumo"]
- "plop" : ["dold", "qolq", "blob", "plop"]
- "plow" : ["mold", "wolq", "blom", "plow"]
- "ploy" : ["hold"]
- "pow" : ["mod", "woq", "bom", "pow"]
- "pox" : ["xod", "xoq", "box", "pox"]
- "sumo" : ["owns"]
- "swoop" : ["dooms"]
- "tool" : ["fool"]
- "top" : ["fob"]
- "wold" : ["plom", "blow", "molq", "wold"]
- "wolf" : ["molt"]
- "woof" : ["moot"]
- "wool" : ["loom", "loow", "mool", "wool"]
- "HIMNOSWXZbdhlmnopqsuwxyz" : ["zhxmnsbdouwlypqZXMSONWIH"]
- "AHIMOTUVWXYbdilmopqvwx" : ["xwvpqomlibdYXWVUTOMIHA"]
- "BCDEHIKMOWXbcdflmopqtwx" : ["BCDEHIKWOMXpcqtlwobdfmx"]
- "pmXWbMwdoHIlqOx" : ["xOblIHopmWqMXwd", "xOplIHobwMdWXmq", "bwXMpWmqoHIldOx", "pmXWbMwdoHIlqOx"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
#13: Post edited
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- The 3 rotation types will be given the challenge-specific names ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- m : m
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- m : w
- o : o
- p : b
- q : d
- t : f
- w : m
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
"HI" : ["HI", "IH"]- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
"WAIT" : ["TIAW"]"loft" : ["lotf"]"MOW" : ["WOM", "MOW"]"Moody" : ["hpooW"]"loud" : ["pnol"]"shoWy" : ["hMoys"]- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- The 3 rotation types will be given the challenge-specific names ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- m : m
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- m : w
- o : o
- p : b
- q : d
- t : f
- w : m
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HIDE" : ["HIDE"]
- "CHEM" : ["CHEW"]
- "COM" : ["COW"]
- "DEWI" : ["DEMI"]
- "MAY" : ["YAM"]
- "MEEK" : ["WEEK"]
- "MICK" : ["WICK"]
- "MIT" : ["TIM"]
- "MON" : ["NOW"]
- "MONS" : ["SNOW"]
- "MOOD" : ["WOOD"]
- "NIM" : ["WIN"]
- "OAT" : ["TAO"]
- "OHM" : ["WHO", "MHO", "OHW", "OHM"]
- "OWT" : ["TWO"]
- "SNOW" : ["MONS"]
- "TAO" : ["OAT"]
- "TIM" : ["MIT"]
- "TWO" : ["OWT"]
- "WAY" : ["YAW"]
- "WEEK" : ["MEEK"]
- "WHO" : ["OHM", "OHW", "MHO", "WHO"]
- "WICK" : ["MICK"]
- "WIN" : ["NIM"]
- "WOE" : ["MOE"]
- "WOOD" : ["MOOD"]
- "YAW" : ["WAY"]
- "bib" : ["did"]
- "blob" : ["qolq", "dold", "plop", "blob"]
- "blow" : ["molq", "wold", "plom", "blow"]
- "Bob" : ["Bop"]
- "bom" : ["woq", "mod", "pow", "bom"]
- "bool" : ["looq", "lood", "pool", "bool"]
- "boom" : ["wooq", "mood", "poow", "boom"]
- "Bop" : ["Bob"]
- "box" : ["xoq", "xod", "pox", "box"]
- "Cob" : ["Cop"]
- "cob" : ["cop"]
- "did" : ["bib"]
- "dooms" : ["swoop"]
- "fob" : ["top"]
- "fool" : ["tool"]
- "HEM" : ["HEW"]
- "HEW" : ["HEM"]
- "hold" : ["ploy"]
- "loom" : ["wool", "mool", "loow", "loom"]
- "MIA" : ["AIM"]
- "mod" : ["pow", "bom", "woq", "mod"]
- "mold" : ["plow", "blom", "wolq", "mold"]
- "molt" : ["wolf"]
- "mood" : ["poow", "boom", "wooq", "mood"]
- "moot" : ["woof"]
- "owns" : ["sumo"]
- "plop" : ["dold", "qolq", "blob", "plop"]
- "plow" : ["mold", "wolq", "blom", "plow"]
- "ploy" : ["hold"]
- "pow" : ["mod", "woq", "bom", "pow"]
- "pox" : ["xod", "xoq", "box", "pox"]
- "sumo" : ["owns"]
- "swoop" : ["dooms"]
- "tool" : ["fool"]
- "top" : ["fob"]
- "wold" : ["plom", "blow", "molq", "wold"]
- "wolf" : ["molt"]
- "woof" : ["moot"]
- "wool" : ["loom", "loow", "mool", "wool"]
- "HIMNOSWXZbdhlmnopqsuwxyz" : ["zhxmnsbdouwlypqZXMSONWIH"]
- "AHIMOTUVWXYbdilmopqvwx" : ["xwvpqomlibdYXWVUTOMIHA"]
- "BCDEHIKMOWXbcdflmopqtwx" : ["BCDEHIKWOMXpcqtlwobdfmx"]
- "pmXWbMwdoHIlqOx" : ["xOblIHopmWqMXwd", "xOplIHobwMdWXmq", "bwXMpWmqoHIldOx", "pmXWbMwdoHIlqOx"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
#12: Post edited
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- The 3 rotation types will be given the challenge-specific names ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- The 3 rotation types will be given the challenge-specific names ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- m : m
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- m : w
- o : o
- p : b
- q : d
- t : f
- w : m
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
#11: Post edited
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- The 3 rotation types will be given the challenge-specific names ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
#10: Post edited
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
<details><summary>Terminology</summary>The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.- `pod` becomes `pod` (it is unchanged)- `pow` becomes `mod`A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.- `dob` becomes `dob` (it is unchanged)- `mod` becomes `bom`A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.- `DOB` becomes `DOB` (it is unchanged)- `Wolf` becomes `Molt`Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.</details><details><summary>Letter rotations</summary>The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.Rotations are shown in the format `before : after`.### Clock rotations```textH : HI : IM : WN : NO : OS : SW : MX : XZ : Zb : qd : ph : yl : lm : wn : uo : op : dq : bs : su : nw : mx : xy : hz : z```### Mirror rotations```textA : AH : HI : IM : MO : OT : TU : UV : VW : WX : XY : Yb : dd : bi : il : lo : op : qq : pv : vw : wx : x```### Lake rotations```textB : BC : CD : DE : EH : HI : IK : KM : WO : OW : MX : Xb : pc : cd : qf : tl : lo : op : bq : dt : fx : x```</details><details><summary>Input</summary>- A sequence of letters, referred to as a ***word***- This may be a string or any ordered data structure of characters- The word may contain both upper and lower case letters- The word will contain at least 1 letter (it will not be empty)- The word will be rotatable by at least 1 of the 3 rotation types- It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"- It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable</details><details><summary>Output</summary>- A sequence of letters, referred to as a ***rotated word***- This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)- For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs- The rotated word must be a valid rotation of the input word- If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)- More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output- Each rotation type may be applied a maximum of once- For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice- The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word- It is not just the individual letters that must be modified:- For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed- For a lake rotation, the individual letters will each be modified but their order will remain unchanged</details><details><summary>Test cases</summary>You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.Test cases are in the format `"input word" : ["valid", "rotated", "words"]````text"HI" : ["HI", "IH"]"HIDE" : ["HIDE"]"SNOW" : ["MONS"]"WAIT" : ["TIAW"]"loft" : ["lotf"]"MOW" : ["WOM", "MOW"]"Moody" : ["hpooW"]"loud" : ["pnol"]"shoWy" : ["hMoys"]```</details>> Explanations are optional, but I'm more likely to upvote answers that have one.- ----
Alternative format without the expandable sections:- ----
Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- ----
- ----
- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
#9: Post edited
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- <details><summary>Terminology</summary>
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- <details><summary>Letter rotations</summary>
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- </details>
- <details><summary>Input</summary>
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- <details><summary>Output</summary>
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- </details>
- <details><summary>Test cases</summary>
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- </details>
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- <details><summary>Terminology</summary>
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- <details><summary>Letter rotations</summary>
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- </details>
- <details><summary>Input</summary>
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- <details><summary>Output</summary>
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- </details>
- <details><summary>Test cases</summary>
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- </details>
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- ---
- Alternative format without the expandable sections:
- ---
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- # Terminology
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- # Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- # Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- # Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- # Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
#8: Post edited
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- <details><summary>Terminology</summary>
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- <details><summary>Letter rotations</summary>
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- </details>
## Input- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
## Output- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
## Test cases- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- <details><summary>Terminology</summary>
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- <details><summary>Letter rotations</summary>
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- </details>
- <details><summary>Input</summary>
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- </details>
- <details><summary>Output</summary>
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- </details>
- <details><summary>Test cases</summary>
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- </details>
- > Explanations are optional, but I'm more likely to upvote answers that have one.
#7: Post edited
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
## Terminology*Note that the examples are not necessarily English words, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.*A ***clock rotation*** is a half turn about the z axis (the line of sight into the page).- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
A ***mirror rotation*** is a half turn about the y axis (the vertical).- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
A ***lake rotation*** is a half turn about the x axis (the horizontal).- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
## Letter rotations- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- ## Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- The word will not contain spaces, newlines, or punctuation - only letters- - The word will be rotatable by at least 1 of the 3 rotation types
- Specifically, this means it will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- ## Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- Note that it is not just the individual letters that must be modified:- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- ## Test cases
Note that you must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- <details><summary>Terminology</summary>
- The result of a given rotation type will not necessarily be an English word, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page). This can be seen by rotating a printed page (or a screen) by 180 degrees without changing which side is facing you.
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical). This looks equivalent to the reflection seen by holding a mirror to the left or right of the word.
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal). This looks equivalent to the reflection seen by holding a mirror above or below the word.
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- </details>
- <details><summary>Letter rotations</summary>
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- </details>
- ## Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 rotation types
- - It will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- ## Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - It is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- ## Test cases
- You must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- > Explanations are optional, but I'm more likely to upvote answers that have one.
#6: Post edited
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- ## Terminology
- *Note that the examples are not necessarily English words, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.*
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page).
- - `pod` becomes `pod` (it is unchanged)
- `pob` becomes `qod`- A ***mirror rotation*** is a half turn about the y axis (the vertical).
- - `dob` becomes `dob` (it is unchanged)
- `pod` becomes `boq`- A ***lake rotation*** is a half turn about the x axis (the horizontal).
- - `DOB` becomes `DOB` (it is unchanged)
- `dob` becomes `qop`- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- ## Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- ## Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- The word will be rotatable by at least 1 of the 3 methods- ## Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output- More than 1 rotation type may be applied provided each is valid- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- ## Test cases
- Note that you must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- ## Terminology
- *Note that the examples are not necessarily English words, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.*
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page).
- - `pod` becomes `pod` (it is unchanged)
- - `pow` becomes `mod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical).
- - `dob` becomes `dob` (it is unchanged)
- - `mod` becomes `bom`
- A ***lake rotation*** is a half turn about the x axis (the horizontal).
- - `DOB` becomes `DOB` (it is unchanged)
- - `Wolf` becomes `Molt`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- ## Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- ## Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will not contain spaces, newlines, or punctuation - only letters
- - The word will be rotatable by at least 1 of the 3 rotation types
- - Specifically, this means it will never contain a letter that is not one of the "before" letters listed under "Letter rotations" above. For example, the word will never contain a lower case "a"
- - It will never be a combination of letters that are individually rotatable, but not all rotatable by a single rotation type. For example, the word will never be "HABIT", because "A" is not clock or lake rotatable, and "B" is not mirror rotatable
- ## Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output (but you must output only a single word, not all valid words)
- - More than 1 rotation type may be applied provided each is valid, but no more than 1 is required - you may choose how many different rotations to apply to reach the output
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- - Note that it is not just the individual letters that must be modified:
- - For a clock or mirror rotation, the individual letters will each be modified and their order will be reversed
- - For a lake rotation, the individual letters will each be modified but their order will remain unchanged
- ## Test cases
- Note that you must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
#5: Post edited
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- ## Terminology
- *Note that the examples are not necessarily English words, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.*
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page).
- - `pod` becomes `pod` (it is unchanged)
- - `pob` becomes `qod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical).
- - `dob` becomes `dob` (it is unchanged)
- - `pod` becomes `boq`
- A ***lake rotation*** is a half turn about the x axis (the horizontal).
- - `DOB` becomes `DOB` (it is unchanged)
- - `dob` becomes `qop`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- ## Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- ## Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 methods
- ## Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output
- - More than 1 rotation type may be applied provided each is valid
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- ## Test cases
Note that you must only output a single rotated word for a given input word. Where more than one valid output is listed, you may choose any one of them to output.- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- ## Terminology
- *Note that the examples are not necessarily English words, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.*
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page).
- - `pod` becomes `pod` (it is unchanged)
- - `pob` becomes `qod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical).
- - `dob` becomes `dob` (it is unchanged)
- - `pod` becomes `boq`
- A ***lake rotation*** is a half turn about the x axis (the horizontal).
- - `DOB` becomes `DOB` (it is unchanged)
- - `dob` becomes `qop`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- ## Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- ## Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 methods
- ## Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output
- - More than 1 rotation type may be applied provided each is valid
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- ## Test cases
- Note that you must only output a single rotated word for a given input word. Where more than one valid rotated word is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
#4: Post edited
Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of real letters, output one of its rotated forms.- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- ## Terminology
*Note that the examples are not necessarily real words, but the letters always remain real letters. If a rotation type on a letter does not give a real letter result, that rotation type cannot be applied to a word containing that letter.*- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page).
- - `pod` becomes `pod` (it is unchanged)
- - `pob` becomes `qod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical).
- - `dob` becomes `dob` (it is unchanged)
- - `pod` becomes `boq`
- A ***lake rotation*** is a half turn about the x axis (the horizontal).
- - `DOB` becomes `DOB` (it is unchanged)
- - `dob` becomes `qop`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- ## Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- ## Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 methods
- ## Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output
- - More than 1 rotation type may be applied provided each is valid
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- ## Test cases
- Note that you must only output a single rotated word for a given input word. Where more than one valid output is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of English alphabet letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- ## Terminology
- *Note that the examples are not necessarily English words, but the letters always remain English alphabet letters. If a rotation type on a letter does not give an English alphabet letter result, that rotation type cannot be applied to a word containing that letter.*
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page).
- - `pod` becomes `pod` (it is unchanged)
- - `pob` becomes `qod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical).
- - `dob` becomes `dob` (it is unchanged)
- - `pod` becomes `boq`
- A ***lake rotation*** is a half turn about the x axis (the horizontal).
- - `DOB` becomes `DOB` (it is unchanged)
- - `dob` becomes `qop`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- ## Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- ## Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 methods
- ## Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output
- - More than 1 rotation type may be applied provided each is valid
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- ## Test cases
- Note that you must only output a single rotated word for a given input word. Where more than one valid output is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```
#3: Post edited
Given a word determine whether it is identical after rotation by 180 degrees (a half turn) about any of its 3 axes.
- Given a word that can be rotated by 180 degrees (a half turn) about at least one of its 3 axes and continue to be composed of real letters, output one of its rotated forms.
- For this challenge, the 3 types will be called ***clock***, ***mirror***, and ***lake*** rotations. They have more elaborate names and variations on the [Ambigram](https://en.wikipedia.org/wiki/Ambigram) Wikipedia page but those will not be used here.
- ## Terminology
- *Note that the examples are not necessarily real words, but the letters always remain real letters. If a rotation type on a letter does not give a real letter result, that rotation type cannot be applied to a word containing that letter.*
- A ***clock rotation*** is a half turn about the z axis (the line of sight into the page).
- - `pod` becomes `pod` (it is unchanged)
- - `pob` becomes `qod`
- A ***mirror rotation*** is a half turn about the y axis (the vertical).
- - `dob` becomes `dob` (it is unchanged)
- - `pod` becomes `boq`
- A ***lake rotation*** is a half turn about the x axis (the horizontal).
- - `DOB` becomes `DOB` (it is unchanged)
- - `dob` becomes `qop`
- Since we are looking at a 2 dimensional page, these last 2 look like reflections, hence the chosen names.
- ## Letter rotations
- The decision on which letters can be rotated in which ways is fairly arbitrary and font-dependent. For this challenge only the rotations listed are valid. Any letter not listed under a given rotation type cannot be rotated in that way.
- Rotations are shown in the format `before : after`.
- ### Clock rotations
- ```text
- H : H
- I : I
- M : W
- N : N
- O : O
- S : S
- W : M
- X : X
- Z : Z
- b : q
- d : p
- h : y
- l : l
- m : w
- n : u
- o : o
- p : d
- q : b
- s : s
- u : n
- w : m
- x : x
- y : h
- z : z
- ```
- ### Mirror rotations
- ```text
- A : A
- H : H
- I : I
- M : M
- O : O
- T : T
- U : U
- V : V
- W : W
- X : X
- Y : Y
- b : d
- d : b
- i : i
- l : l
- o : o
- p : q
- q : p
- v : v
- w : w
- x : x
- ```
- ### Lake rotations
- ```text
- B : B
- C : C
- D : D
- E : E
- H : H
- I : I
- K : K
- M : W
- O : O
- W : M
- X : X
- b : p
- c : c
- d : q
- f : t
- l : l
- o : o
- p : b
- q : d
- t : f
- x : x
- ```
- ## Input
- - A sequence of letters, referred to as a ***word***
- - This may be a string or any ordered data structure of characters
- - The word may contain both upper and lower case letters
- - The word will contain at least 1 letter (it will not be empty)
- - The word will be rotatable by at least 1 of the 3 methods
- ## Output
- - A sequence of letters, referred to as a ***rotated word***
- - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
- - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
- - The rotated word must be a valid rotation of the input word
- - If more than one of the rotation types is valid for the input word, any 1 of them gives a valid output
- - More than 1 rotation type may be applied provided each is valid
- - Each rotation type may be applied a maximum of once
- - For example, you may apply a clock rotation followed by a lake rotation, but you must not apply a clock rotation twice
- - The output may be identical to the input provided there is a rotation type or combination of rotation types that gives a rotated word that is identical to the input word
- ## Test cases
- Note that you must only output a single rotated word for a given input word. Where more than one valid output is listed, you may choose any one of them to output.
- Test cases are in the format `"input word" : ["valid", "rotated", "words"]`
- ```text
- "HI" : ["HI", "IH"]
- "HIDE" : ["HIDE"]
- "SNOW" : ["MONS"]
- "WAIT" : ["TIAW"]
- "loft" : ["lotf"]
- "MOW" : ["WOM", "MOW"]
- "Moody" : ["hpooW"]
- "loud" : ["pnol"]
- "shoWy" : ["hMoys"]
- ```