Closed TKasekamp closed 5 years ago
Hi @TKasekamp !
Thanks for the feedback! This is the first time I get a feedback on anything I made, so I appreciate it! π
I will look into this issue and try my best to fix it.
Hi @TKasekamp !
I'm currently working on it in my freetime, that's why it's taking so long. If nothing goes wrong, I should be able to fix it by the end of tomorrow.
Hi @TKasekamp !
Just published v1.2.0
of FakeSudokuPuzzleGenerator. It should work properly now.
Can you please check if it works on your machine as well?
I also added another way of getting the puzzles.
The getSudoku
method accepts either "VeryEasy"
, "Easy"
, "Medium"
or "Hard"
as a parameter, and returns a puzzle with the corresponding difficulty. If no proper value is passed, it returns a VeryEasy
puzzle by default.
Thanks @andrasfelfoldi ! You definately changed a lot! I'll test it soon and report back.
Tried it @andrasfelfoldi and now my Typescript project can use it.
But I'm looking at the getSudoku results and there are still a lot of null
in Easy, as much as with Hard. So it doesn't look that easy for me.
Secondly some more TS improvements π Use it if you want
type Difficulty = "VeryEasy" | "Easy" | "Medium" | "Hard"
export declare const getSudoku: (difficulty: Difficulty) => (number | null)[][];
Thanks, I will add your improvements it as soon as I can. π
Regarding the difficulty of the puzzles: I used another website to check the difficulties of the generated puzzles. I think it was this site.
According to some stuff I read online (seems legit right? π ) about sudoku, the main difficulty does not necessarily come from the lack of filled in numbers.
It is possible that a puzzle has only a very few filled cells, but they are laid out in a way that it's easy to determine the values of the blank cells. Similarly, a puzzle can have a lot of cells filled by default, but they may be laid out in a way that you will need to use advanced techniques to be able to fill the remaining blank cells.
To quote the website I have linked:
A sudoku puzzle can be very easy, extremely hard, or somewhere in between, depending on the techniques required to solve it.
So basically, when we check the difficulty of a sudoku puzzle, we should have a look at the techniques required to solve it and evaluate the puzzle based on how advanced these techniques are.
I admit, that there might be a correlation between sudoku puzzle difficulty and the number of blank cells, but this is likely due to the fact that a lack of filled cells may force the player to resort to more advanced techniques. If a puzzle has only a very few filled cells at the start, but I can solve it using only basic and easy methods, the puzzle is not hard, it just takes longer to complete.
Okay, I haven't tried solving the puzzles, so the amount of blank spaces made me question π Thanks for taking the time to answer π
No problem, I'm glad that someone found a use of this repo. π
The blank spaces made me question it as well by the way. I just trust the evaluation of Thonky.com. They know more about sudoku than me for sure. π
But anyway, if it turns out, that the difficulties really do not align, feel free to notify me. π₯
By the way, I included your suggestion in v1.2.1
for the Difficulty type.
Hi @andrasfelfoldi ! This package looks very interesting and I tried it out for my own hobby project that uses Typescript.
The problem with this package is that the files are in ES6 and I think Typescript can't easily handle that. So can you add a webpack step to transpile it to ES5? Or do something to make the package more usable?
These are the errors I got
Second point. You can improve typings with