Skip to main content
deleted 3527 characters in body
Source Link
Taco
  • 541
  • 3
  • 8

Validate Sudoku on a Mobius StripValidate Sudoku on a Mobius Strip

@BeastlyGerbil presents, the world's very first MOBIUS SUDOKU:

Picture of the original strip.


Screenshot of the strip in Google Sheets.

Google Sheets version

(The left most square backs onto the right most square, and the middle squares back onto each other. The ends are then attached as indicated.)

RULES:

  • Normal sudoku rules apply for rows and boxes - boxes are split into groups of 3 indicated by the thicker lines.
  • Columns โ€˜wrap aroundโ€™ over the edge of the mobius strip โ€“ 6 cells per column as a result, normal sudoku rules apply on these 6 cells.
  • No number will ever be orthogonally adjacent to itself, including across the thicker borders separating the sets of 3 boxes.
  • There are 18 total boxes, and as a result 18 total middle cells. There are 2 of each number, 1-9, in the middle cells.

๐Ÿ‘‚ Input

Your input will be a collection of integers, representing each side of a completed strip respectively. Here, collection means whatever type of collection works to meet your needs, so long as you accept a value for every square (front and back). You can use comma delimited lists, arrays, arrays of arrays, n-dimensional arrays, lists, etc. For example in C# using a comma delimited list:

4,6,1,8,5,3,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1

Note: You must tell us how to input the data.

๐Ÿ“ข Output

Your output should represent whether or not the provided input is a valid solution using your languages truthy/falsy, with respect to this answer:

if (x) { print "x is truthy"; } else { print "x is falsy"; } 

If it results in a runtime or a compile-time error then x is neither truthy nor falsy.

For example in C#, when provided the above input, the expected output is:

true

โœ”๏ธ Test Cases

Your test inputs will represent both valid and invalid solutions to include the original puzzle's solution:

Test Case 1: 0
Test Case 2: 4,6,1,8,5,3,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1

Test Case 3: A valid input of all zeros.

Your outputs should be (again, in C# for example):

Test Case 1: false
Test Case 2: true
Test Case 3: false

Here's a screenshot of the solved grid for reference: Screenshot of the solved grid.

๐Ÿ… Scoring

This is so smallest solution in bytes wins.

๐Ÿ“ Final Note

This challenge is inspired by this puzzle crafted by @BeastlyGerbil. If you like this challenge, go show some love for the original puzzle too!

Validate Sudoku on a Mobius Strip

@BeastlyGerbil presents, the world's very first MOBIUS SUDOKU:

Picture of the original strip.


Screenshot of the strip in Google Sheets.

Google Sheets version

(The left most square backs onto the right most square, and the middle squares back onto each other. The ends are then attached as indicated.)

RULES:

  • Normal sudoku rules apply for rows and boxes - boxes are split into groups of 3 indicated by the thicker lines.
  • Columns โ€˜wrap aroundโ€™ over the edge of the mobius strip โ€“ 6 cells per column as a result, normal sudoku rules apply on these 6 cells.
  • No number will ever be orthogonally adjacent to itself, including across the thicker borders separating the sets of 3 boxes.
  • There are 18 total boxes, and as a result 18 total middle cells. There are 2 of each number, 1-9, in the middle cells.

๐Ÿ‘‚ Input

Your input will be a collection of integers, representing each side of a completed strip respectively. Here, collection means whatever type of collection works to meet your needs, so long as you accept a value for every square (front and back). You can use comma delimited lists, arrays, arrays of arrays, n-dimensional arrays, lists, etc. For example in C# using a comma delimited list:

4,6,1,8,5,3,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1

Note: You must tell us how to input the data.

๐Ÿ“ข Output

Your output should represent whether or not the provided input is a valid solution using your languages truthy/falsy, with respect to this answer:

if (x) { print "x is truthy"; } else { print "x is falsy"; } 

If it results in a runtime or a compile-time error then x is neither truthy nor falsy.

For example in C#, when provided the above input, the expected output is:

true

โœ”๏ธ Test Cases

Your test inputs will represent both valid and invalid solutions to include the original puzzle's solution:

Test Case 1: 0
Test Case 2: 4,6,1,8,5,3,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1

Test Case 3: A valid input of all zeros.

Your outputs should be (again, in C# for example):

Test Case 1: false
Test Case 2: true
Test Case 3: false

Here's a screenshot of the solved grid for reference: Screenshot of the solved grid.

๐Ÿ… Scoring

This is so smallest solution in bytes wins.

๐Ÿ“ Final Note

This challenge is inspired by this puzzle crafted by @BeastlyGerbil. If you like this challenge, go show some love for the original puzzle too!

added 168 characters in body
Source Link
Taco
  • 541
  • 3
  • 8

SudokuValidate Sudoku on a Mobius Strip

Your output should represent whether or not the provided input is a valid solution using your languages truthy/falsey.falsy, with respect to this answer:

if (x) { print "x is truthy"; } else { print "x is falsy"; } 

If it results in a runtime or a compile-time error then x is neither truthy nor falsy.

For example in C#, when provided the above input, the expected output is:

Note: Be sure to educate us on how to read your truthy/falsey values.

Sudoku on a Mobius Strip

Your output should represent whether or not the provided input is a valid solution using your languages truthy/falsey. For example in C#, when provided the above input, the expected output is:

Note: Be sure to educate us on how to read your truthy/falsey values.

Validate Sudoku on a Mobius Strip

Your output should represent whether or not the provided input is a valid solution using your languages truthy/falsy, with respect to this answer:

if (x) { print "x is truthy"; } else { print "x is falsy"; } 

If it results in a runtime or a compile-time error then x is neither truthy nor falsy.

For example in C#, when provided the above input, the expected output is:

deleted 544 characters in body
Source Link
Taco
  • 541
  • 3
  • 8

Your output should represent whether or not the provided input is a valid solution using your languages truthy/falsey. For this, use a 0 for false and the provided input for true; for example in C#, when provided the above input, the expected output is:

4,6,1,8,5,3,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1true

Note: Be sure to educate us on how to read your truthy/falsey values.

Your outputs should be (again, in C# for example):

Test Case 1: 0false
Test Case 2: 4,6,1,8,5,3,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1

true
Test Case 3: 0false

Your output should represent whether or not the provided input is a valid solution. For this, use a 0 for false and the provided input for true; for example when provided the above input, the expected output is:

4,6,1,8,5,3,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1

Your outputs should be:

Test Case 1: 0
Test Case 2: 4,6,1,8,5,3,7,9,2,4,8,1,3,9,7,6,5,2,6,4,2,8,1,9,5,3,7,2,7,8,4,9,1,6,5,3,6,7,5,1,4,2,9,3,8,3,8,9,7,2,5,6,1,4,9,5,3,6,2,7,4,1,8,2,9,3,5,8,6,7,1,4,5,7,1,4,6,3,9,8,2,1,9,4,2,8,5,6,3,7,1,9,2,5,7,4,6,3,8,5,7,2,9,8,1,4,3,6,5,6,2,7,3,9,8,1,4,7,6,8,3,2,9,4,5,1,6,8,1,5,4,3,2,9,7,3,7,8,1,4,6,5,9,2,3,4,5,1,6,8,9,2,7,4,3,9,6,7,2,5,8,1

Test Case 3: 0

Your output should represent whether or not the provided input is a valid solution using your languages truthy/falsey. For example in C#, when provided the above input, the expected output is:

true

Note: Be sure to educate us on how to read your truthy/falsey values.

Your outputs should be (again, in C# for example):

Test Case 1: false
Test Case 2: true
Test Case 3: false

added 756 characters in body
Source Link
Taco
  • 541
  • 3
  • 8
Loading
deleted 1109 characters in body
Source Link
Taco
  • 541
  • 3
  • 8
Loading
added 498 characters in body
Source Link
Taco
  • 541
  • 3
  • 8
Loading
Source Link
Taco
  • 541
  • 3
  • 8
Loading