Communities

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

Post History

71%
+3 −0
Sandbox Chequer checker [FINALIZED]

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

#15: Post edited by user avatar trichoplax‭ · 2022-09-23T03:23:49Z (over 1 year ago)
Remove accidentally saved markdown link testing
  • # Now posted: [Chequer checker](https://codegolf.codidact.com/posts/287055)
  • ---
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • [example]
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • [![A chequer board with a region outlined in red that slices some of the squares in half]][example]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - you can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - You can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - You can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • bbaabbaabbaabba
  • abbaabbaabbaabb
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • # Now posted: [Chequer checker](https://codegolf.codidact.com/posts/287055)
  • ---
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - you can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - You can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - You can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • bbaabbaabbaabba
  • abbaabbaabbaabb
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
#14: Post edited by user avatar trichoplax‭ · 2022-09-23T03:22:03Z (over 1 year ago)
Add missing colon
  • # Now posted [Chequer checker](https://codegolf.codidact.com/posts/287055)
  • ---
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • [example]
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • [![A chequer board with a region outlined in red that slices some of the squares in half]][example]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - you can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - You can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - You can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • bbaabbaabbaabba
  • abbaabbaabbaabb
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • # Now posted: [Chequer checker](https://codegolf.codidact.com/posts/287055)
  • ---
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • [example]
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • [![A chequer board with a region outlined in red that slices some of the squares in half]][example]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - you can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - You can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - You can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • bbaabbaabbaabba
  • abbaabbaabbaabb
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
#13: Post edited by user avatar trichoplax‭ · 2022-09-23T03:21:04Z (over 1 year ago)
Mark as finalized
  • Chequer checker
  • Chequer checker [FINALIZED]
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - you can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - You can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - You can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • bbaabbaabbaabba
  • abbaabbaabbaabb
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
  • # Now posted [Chequer checker](https://codegolf.codidact.com/posts/287055)
  • ---
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • [example]
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • [![A chequer board with a region outlined in red that slices some of the squares in half]][example]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - you can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - You can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - You can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • bbaabbaabbaabba
  • abbaabbaabbaabb
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
#12: Post edited by user avatar trichoplax‭ · 2022-09-23T01:54:34Z (over 1 year ago)
Reduce level of formality
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • bbaabbaabbaabba
  • abbaabbaabbaabb
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - you can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - You can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - You can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • bbaabbaabbaabba
  • abbaabbaabbaabb
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
#11: Post edited by user avatar trichoplax‭ · 2022-09-21T17:14:15Z (over 1 year ago)
A few more test cases
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • bbaabbaabbaabba
  • abbaabbaabbaabb
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
#10: Post edited by user avatar trichoplax‭ · 2022-09-20T22:45:36Z (over 1 year ago)
Condense long output point
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region will be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
#9: Post edited by user avatar trichoplax‭ · 2022-09-20T14:47:48Z (over 1 year ago)
Suggest explanations in answers
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
#8: Post edited by user avatar trichoplax‭ · 2022-09-18T17:29:05Z (over 1 year ago)
Add diagram and extra wording for clarity
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares). For example:
  • ```text
  • abba
  • baab
  • baab
  • abba
  • ```
  • This shows a small region of a chequer board with squares of side length 2. Only the central square shows in its full 2 by 2 size. The squares adjacent to it have been sliced in half by the edges of the region.
  • Here is a diagram showing the adjacent squares being sliced in half by the region outlined in red:
  • ![A chequer board with a region outlined in red that slices some of the squares in half]
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares (including partial squares) horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • [A chequer board with a region outlined in red that slices some of the squares in half]: https://codegolf.codidact.com/uploads/X15JuPWLeQUTYcuYdz67pBWD
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
#7: Post edited by user avatar trichoplax‭ · 2022-09-18T16:53:20Z (over 1 year ago)
Improve wording and add a larger truthy test case
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a chequer board all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • zzzzaaaazzzzaaaazzzzaaaazzzzaaaa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
#6: Post edited by user avatar trichoplax‭ · 2022-09-18T15:45:47Z (over 1 year ago)
Narrow down sandbox questions to those that still need feedback
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - I'm considering allowing the input to be a different data type, such as an array or matrix of characters. The example inputs would remain newline separated strings, but answerers would have more flexibility in what type of input to receive.
  • - Should there be an upper limit on the input size, perhaps 256 by 256?
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is there a more convenient format for the test cases? Is separating them into truthy and falsy cases useful?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is anything unclear or ambiguous?
#5: Post edited by user avatar trichoplax‭ · 2022-09-18T15:42:15Z (over 1 year ago)
Address feedback
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - I'm considering allowing the input to be a different data type, such as an array or matrix of characters. The example inputs would remain newline separated strings, but answerers would have more flexibility in what type of input to receive.
  • - Should there be an upper limit on the input size, perhaps 256 by 256?
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is there a more convenient format for the test cases? Is separating them into truthy and falsy cases useful?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - No other characters will be present - just letters and newlines
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • - The answerer can choose to accept a grid of letters in a different format, such as lists/arrays of strings, or 2D arrays of characters
  • - The input will not be more than 255 by 255 letters
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • - Falsy if there are more than 8 squares horizontally or vertically
  • - Falsy if there are more than 2 colours (more than 2 distinct letters)
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • aqqaaq
  • qaaqqa
  • ba
  • ab
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - I'm considering allowing the input to be a different data type, such as an array or matrix of characters. The example inputs would remain newline separated strings, but answerers would have more flexibility in what type of input to receive.
  • - Should there be an upper limit on the input size, perhaps 256 by 256?
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is there a more convenient format for the test cases? Is separating them into truthy and falsy cases useful?
  • - Is anything unclear or ambiguous?
#4: Post edited by user avatar trichoplax‭ · 2022-09-17T22:57:17Z (over 1 year ago)
Specify 8 by 8 chequer board in the output section
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • ## Output
  • - A truthy output if the input is a region of a chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - I'm considering allowing the input to be a different data type, such as an array or matrix of characters. The example inputs would remain newline separated strings, but answerers would have more flexibility in what type of input to receive.
  • - Should there be an upper limit on the input size, perhaps 256 by 256?
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is there a more convenient format for the test cases? Is separating them into truthy and falsy cases useful?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • ## Output
  • - A truthy output if the input is a region of an 8 by 8 chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - I'm considering allowing the input to be a different data type, such as an array or matrix of characters. The example inputs would remain newline separated strings, but answerers would have more flexibility in what type of input to receive.
  • - Should there be an upper limit on the input size, perhaps 256 by 256?
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is there a more convenient format for the test cases? Is separating them into truthy and falsy cases useful?
  • - Is anything unclear or ambiguous?
#3: Post edited by user avatar trichoplax‭ · 2022-09-15T15:36:53Z (over 1 year ago)
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of the grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • ## Output
  • - A truthy output if the input is a region of a chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - I'm considering allowing the input to be a different data type, such as an array or matrix of characters. The example inputs would remain newline separated strings, but answerers would have more flexibility in what type of input to receive.
  • - Should there be an upper limit on the input size, perhaps 256 by 256?
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is there a more convenient format for the test cases? Is separating them into truthy and falsy cases useful?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of a grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • ## Output
  • - A truthy output if the input is a region of a chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - I'm considering allowing the input to be a different data type, such as an array or matrix of characters. The example inputs would remain newline separated strings, but answerers would have more flexibility in what type of input to receive.
  • - Should there be an upper limit on the input size, perhaps 256 by 256?
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is there a more convenient format for the test cases? Is separating them into truthy and falsy cases useful?
  • - Is anything unclear or ambiguous?
#2: Post edited by user avatar trichoplax‭ · 2022-09-15T15:35:52Z (over 1 year ago)
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Determine whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of the grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • ## Output
  • - A truthy output if the input is a region of a chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - I'm considering allowing the input to be a different data type, such as an array or matrix of characters. The example inputs would remain newline separated strings, but answerers would have more flexibility in what type of input to receive.
  • - Should there be an upper limit on the input size, perhaps 256 by 256?
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is there a more convenient format for the test cases? Is separating them into truthy and falsy cases useful?
  • - Is anything unclear or ambiguous?
  • A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Check whether a provided pattern could be a region of a chequer board.
  • The colours in the pattern will be represented by letters of the alphabet.
  • The squares of the grid all have the same side length. For this challenge, this length can be any positive integer.
  • Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).
  • ## Input
  • - Text in a rectangular grid (newline separated lines of equal length)
  • - Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
  • - The answerer can choose whether the inputs have a trailing newline
  • - The input will contain at least one letter (the input region can be assumed to be non-empty)
  • ## Output
  • - A truthy output if the input is a region of a chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise
  • ## Test cases
  • ### Truthy test cases
  • ```text
  • aa
  • aa
  • b
  • cccccccc
  • aabba
  • aabba
  • bbaab
  • cddddddddd
  • dccccccccc
  • dccccccccc
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • abababab
  • babababa
  • ```
  • ### Falsy test cases
  • ```text
  • abbaaa
  • c
  • c
  • d
  • c
  • aabb
  • abba
  • ccdcc
  • cdddc
  • ddddd
  • cdddc
  • ccdcc
  • aba
  • aba
  • cdcdcdcdc
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • d
  • c
  • abbaabbaabbaabba
  • abc
  • aabb
  • bbcc
  • ```
  • ---
  • # Sandbox questions
  • - Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
  • - I'm considering allowing the input to be a different data type, such as an array or matrix of characters. The example inputs would remain newline separated strings, but answerers would have more flexibility in what type of input to receive.
  • - Should there be an upper limit on the input size, perhaps 256 by 256?
  • - Are there any edge cases that should be included in the truthy or falsy test cases?
  • - Is there a more convenient format for the test cases? Is separating them into truthy and falsy cases useful?
  • - Is anything unclear or ambiguous?
#1: Initial revision by user avatar trichoplax‭ · 2022-09-15T15:35:01Z (over 1 year ago)
Chequer checker
A chequer board (also spelt "checker board" in some places) is an 8 by 8 grid of squares alternating between 2 colours. Determine whether a provided pattern could be a region of a chequer board.

The colours in the pattern will be represented by letters of the alphabet.

The squares of the grid all have the same side length. For this challenge, this length can be any positive integer.

Some of the squares may be cut by the boundary of the input region (the edges of the region shown in the input will not necessarily coincide with the edges of the squares).

## Input
- Text in a rectangular grid (newline separated lines of equal length)
- Each character is a letter of the English alphabet (a to z, or A to Z - the answerer can choose which case to accept)
- The answerer can choose whether the inputs have a trailing newline
- The input will contain at least one letter (the input region can be assumed to be non-empty)

## Output
- A truthy output if the input is a region of a chequer board (axis aligned - not squares at any other angle) and a falsy output otherwise

## Test cases

### Truthy test cases

```text
aa
aa

b

cccccccc

aabba
aabba
bbaab

cddddddddd
dccccccccc
dccccccccc

abababab
babababa
abababab
babababa
abababab
babababa
abababab
babababa
```

### Falsy test cases

```text
abbaaa

c
c
d
c

aabb
abba

ccdcc
cdddc
ddddd
cdddc
ccdcc

aba
aba

cdcdcdcdc

c
d
c
d
c
d
c
d
c

abbaabbaabbaabba

abc

aabb
bbcc
```

---

# Sandbox questions

- Should the empty input be dealt with? (If an empty string is considered a valid input, I would consider the correct output to be truthy.)
- I'm considering allowing the input to be a different data type, such as an array or matrix of characters. The example inputs would remain newline separated strings, but answerers would have more flexibility in what type of input to receive.
- Should there be an upper limit on the input size, perhaps 256 by 256?
- Are there any edge cases that should be included in the truthy or falsy test cases?
- Is there a more convenient format for the test cases? Is separating them into truthy and falsy cases useful?
- Is anything unclear or ambiguous?