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

Post History

77%
+5 −0
Challenges Create a Sudoku

Write the shortest program that takes no input and outputs a Sudoku solution. For reference, a Sudoku solution is a 9x9 grid of digits where each column, each row and each of the nine 3x3 grids th...

4 answers  ·  posted 3y ago by AndrewTheCodegolfer‭  ·  last activity 3y ago by Shaggy‭

Question code-golf sudoku
#3: Post edited by user avatar AndrewTheCodegolfer‭ · 2021-06-28T22:04:58Z (almost 3 years ago)
  • Write the shortest program that takes no input and outputs a Sudoku solution.
  • For reference, a Sudoku solution is a 9x9 grid of digits where each column, each row and each of the nine 3x3 grids that compose the board have all of the digits from 1 to 9.
  • Your output may look like this:
  • ```
  • 123456789
  • 456789123
  • 789123456
  • 231564897
  • 564897231
  • 897231564
  • 312645978
  • 645978312
  • 978312645
  • ```
  • Or it may look like this:
  • ```
  • 123456789456789123789123456231564897564897231564897231897231564312645978645978312978312645
  • ```
  • It may be an array of 9 digit integers, 3 digit integers, a 9x9 matrix or nine 3x3 matrices as well.
  • You can use [this script](https://tio.run/#05ab1e#code=fMKpdnkzw7R9KTPDtMO4dnlKdnnDqn19wq7DuHZ5w6p9wq52ecOqfSnDqsW-aMKmUQ&input=MTIzNDU2Nzg5CjQ1Njc4OTEyMwo3ODkxMjM0NTYKMjMxNTY0ODk3CjU2NDg5NzIzMQo4OTcyMzE1NjQKMzEyNjQ1OTc4CjY0NTk3ODMxMgo5NzgzMTI2NDU) to check if your board is a valid solution. It will output [1] for a valid solution and anything else for an invalid one.
  • Your program can have multiple outputs but you'll need to prove that they are all valid solutions.
  • Have fun, codidactyls!
  • Write the shortest program that takes no input and outputs a Sudoku solution.
  • For reference, a Sudoku solution is a 9x9 grid of digits where each column, each row and each of the nine 3x3 grids that compose the board have all of the digits from 1 to 9.
  • Your output may look like this:
  • ```
  • 123456789
  • 456789123
  • 789123456
  • 231564897
  • 564897231
  • 897231564
  • 312645978
  • 645978312
  • 978312645
  • ```
  • Or it may look like this:
  • ```
  • 123456789456789123789123456231564897564897231564897231897231564312645978645978312978312645
  • ```
  • It may be an array of 9 digit integers, 3 digit integers, a 9x9 matrix or nine 3x3 matrices as well.
  • **You may use the digits 012345678, not 123456789**, so long as adding 1 to each digit in the output gives a valid Sudoku solution.
  • There used to be a script to check solutions but it doesn't work. If you code one be sure to tell me.
  • Your program can have multiple outputs but you'll need to prove that they are all valid solutions.
  • Have fun, codidactyls!
#2: Post edited by user avatar AndrewTheCodegolfer‭ · 2021-06-28T15:47:39Z (almost 3 years ago)
  • Write the shortest program that takes no input and outputs a Sudoku solution.
  • For reference, a Sudoku solution is a 9x9 grid of digits where each column, each row and each of the nine 3x3 grids that compose the board have all of the digits from 1 to 9.
  • Your output may look like this:
  • ```
  • 123456789
  • 456789123
  • 789123456
  • 231564897
  • 564897231
  • 897231564
  • 312645978
  • 645978312
  • 978312645
  • ```
  • Or it may look like this:
  • ```
  • 123456789456789123789123456231564897564897231564897231897231564312645978645978312978312645
  • ```
  • It may be an array of 9 digit integers, 3 digit integers, a 9x9 matrix or nine 3x3 matrices as well.
  • You can use [this script](https://tio.run/#05ab1e#code=fMKpdnkzw7R9KTPDtMO4dnlKdnnDqn19wq7DuHZ5w6p9wq52ecOqfSnDqsW-aMKmUQ&input=MTIzNDU2Nzg5CjQ1Njc4OTEyMwo3ODkxMjM0NTYKMjMxNTY0ODk3CjU2NDg5NzIzMQo4OTcyMzE1NjQKMzEyNjQ1OTc4CjY0NTk3ODMxMgo5NzgzMTI2NDU) to check if your board is a valid solution. It will output [1] for a valid solution and anything else for an invalid one.
  • Your program can output multiple kinds of solutions but you'll need to prove that they are all valid solutions.
  • Have fun, codidactyls!
  • Write the shortest program that takes no input and outputs a Sudoku solution.
  • For reference, a Sudoku solution is a 9x9 grid of digits where each column, each row and each of the nine 3x3 grids that compose the board have all of the digits from 1 to 9.
  • Your output may look like this:
  • ```
  • 123456789
  • 456789123
  • 789123456
  • 231564897
  • 564897231
  • 897231564
  • 312645978
  • 645978312
  • 978312645
  • ```
  • Or it may look like this:
  • ```
  • 123456789456789123789123456231564897564897231564897231897231564312645978645978312978312645
  • ```
  • It may be an array of 9 digit integers, 3 digit integers, a 9x9 matrix or nine 3x3 matrices as well.
  • You can use [this script](https://tio.run/#05ab1e#code=fMKpdnkzw7R9KTPDtMO4dnlKdnnDqn19wq7DuHZ5w6p9wq52ecOqfSnDqsW-aMKmUQ&input=MTIzNDU2Nzg5CjQ1Njc4OTEyMwo3ODkxMjM0NTYKMjMxNTY0ODk3CjU2NDg5NzIzMQo4OTcyMzE1NjQKMzEyNjQ1OTc4CjY0NTk3ODMxMgo5NzgzMTI2NDU) to check if your board is a valid solution. It will output [1] for a valid solution and anything else for an invalid one.
  • Your program can have multiple outputs but you'll need to prove that they are all valid solutions.
  • Have fun, codidactyls!
#1: Initial revision by user avatar AndrewTheCodegolfer‭ · 2021-06-28T15:46:47Z (almost 3 years ago)
Create a Sudoku
Write the shortest program that takes no input and outputs a Sudoku solution.

For reference, a Sudoku solution is a 9x9 grid of digits where each column, each row and each of the nine 3x3 grids that compose the board have all of the digits from 1 to 9.

Your output may look like this:

```
123456789
456789123
789123456
231564897
564897231
897231564
312645978
645978312
978312645
```

Or it may look like this:
```
123456789456789123789123456231564897564897231564897231897231564312645978645978312978312645
```

It may be an array of 9 digit integers, 3 digit integers, a 9x9 matrix or nine 3x3 matrices as well.

You can use [this script](https://tio.run/#05ab1e#code=fMKpdnkzw7R9KTPDtMO4dnlKdnnDqn19wq7DuHZ5w6p9wq52ecOqfSnDqsW-aMKmUQ&input=MTIzNDU2Nzg5CjQ1Njc4OTEyMwo3ODkxMjM0NTYKMjMxNTY0ODk3CjU2NDg5NzIzMQo4OTcyMzE1NjQKMzEyNjQ1OTc4CjY0NTk3ODMxMgo5NzgzMTI2NDU) to check if your board is a valid solution. It will output [1] for a valid solution and anything else for an invalid one.

Your program can output multiple kinds of solutions but you'll need to prove that they are all valid solutions.

Have fun, codidactyls!