Skip to main content
Code Review

Return to Question

Commonmark migration
Source Link

#EDIT

EDIT

#EDIT

EDIT

I thought I should challenge myself today andmanaged to create a Sudoku generator (what a challenge, huh? Yeah I'm not that smart). I managed to create something but I'll just go ahead and say that it generates 1 out of 500 tries on average. I'd say that's pretty inefficient and I'd like to ask you for advice on improvements.

I thought I should challenge myself today and create a Sudoku generator (what a challenge, huh? Yeah I'm not that smart). I managed to create something but I'll just go ahead and say that it generates 1 out of 500 tries on average. I'd say that's pretty inefficient and I'd like to ask you for advice on improvements.

I managed to create a Sudoku generator but I'll just go ahead and say that it generates 1 out of 500 tries on average. I'd say that's pretty inefficient and I'd like to ask you for advice on improvements.

Typo fixes.
Source Link
Brythan
  • 7k
  • 3
  • 21
  • 37

I thought I should challenge myself today and create a sudokuSudoku generator (what a challenge, huh? Yeah I'm not that smart). I managed to create something but I'll just go ahead and say that it generates 1 out of 500 tries on average. I'd say that's pretty inefficient and I'd like to ask you for advice on improvements.

Basically what I figured is if I had defined a range of numbers that are possible for each cell, then started selecting random numbers for cells 1 by 1 and removing the respective number from it'sits column, row and "box" ( don't really know how they're called ), then it would magically select appropriate numbers and will be left with only one single possible number for the last cell. Well that wasn't the case, but I thought if I gave it a bunch of more tries it would eventually end up as I planned it and it did, the problem is, as I already said that it is very inefficient.

I thought I should challenge myself today and create a sudoku generator (what a challenge, huh? Yeah I'm not that smart). I managed to create something but I'll just go ahead and say that it generates 1 out of 500 tries on average. I'd say that's pretty inefficient and I'd like to ask you for advice on improvements.

Basically what I figured is if I had defined a range of numbers that are possible for each cell, then started selecting random numbers for cells 1 by 1 and removing the respective number from it's column, row and "box" ( don't really know how they're called ), then it would magically select appropriate numbers and will be left with only one single possible number for the last cell. Well that wasn't the case, but I thought if I gave it a bunch of more tries it would eventually end up as I planned it and it did, the problem is, as I already said that it is very inefficient.

I thought I should challenge myself today and create a Sudoku generator (what a challenge, huh? Yeah I'm not that smart). I managed to create something but I'll just go ahead and say that it generates 1 out of 500 tries on average. I'd say that's pretty inefficient and I'd like to ask you for advice on improvements.

Basically what I figured is if I had defined a range of numbers that are possible for each cell, then started selecting random numbers for cells 1 by 1 and removing the respective number from its column, row and "box" ( don't really know how they're called ), then it would magically select appropriate numbers and will be left with only one single possible number for the last cell. Well that wasn't the case, but I thought if I gave it a bunch of more tries it would eventually end up as I planned it and it did, the problem is, as I already said that it is very inefficient.

added 11 characters in body
Source Link
php_nub_qq
  • 745
  • 1
  • 6
  • 19
Loading
added 349 characters in body
Source Link
php_nub_qq
  • 745
  • 1
  • 6
  • 19
Loading
added 119 characters in body
Source Link
php_nub_qq
  • 745
  • 1
  • 6
  • 19
Loading
deleted 14 characters in body
Source Link
php_nub_qq
  • 745
  • 1
  • 6
  • 19
Loading
edited tags; edited tags
Link
200_success
  • 145.5k
  • 22
  • 190
  • 478
Loading
Source Link
php_nub_qq
  • 745
  • 1
  • 6
  • 19
Loading
lang-php

AltStyle によって変換されたページ (->オリジナル) /