Live data from Hacker News

The Miracle Sudoku [video]

youtube.com

41–50 of 150 posts

Re: The Miracle Sudoku [video]

#41

Earlier quoted context omitted.

I recently started increasing playback speed on many videos I watch. It's really hard at first, but I quickly got used to it, to the point where I now use an addon to increase playback speed to 3-6x where appropriate. When there's something complicated, or something I want to enjoy and savior, I jump back and slow down. This is an incredible time saver. I got inspired to do this by observing a blind programmer use a…

which addon are you using for speedup?

Enhancer for YouTube can do that, but you can also do it with simple userscript. The userscript I found somewhere few years ago:

  // ==UserScript==
  // @name         Mediabord
  // @version      01.1
  // @description  tryd to take over the world!
  // @author       j
  // @match        *://*/*
  // @grant metadata
  // ==/UserScript==
  
  document.addEventListener('keydown', function(event) {
      var vidz = document.querySelectorAll('video');
      function is_text_box(element){
          var tagName = element.tagName.toLowerCase();
          return  tagName === "textarea" || tagName === "input";}
      if(is_text_box(event.target))
          return false;
      vidz.forEach(vidz => {
          switch (event.keyCode) {
              case 221: // (])
                  vidz.playbackRate+=0.25;
                  break;
              case 219: // ([)
                  vidz.playbackRate-=0.25;
                  break;
              case 220: // (\)
                  vidz.playbackRate = 1;
                  break;
              case 83:
                  vidz.currentTime+=3;
                  break;
              case 65:
                  vidz.currentTime-= 3;
                  break;
          }
  
      });
  });

Re: The Miracle Sudoku [video]

#42
post #11

Earlier quoted context omitted.

I made a sudoku solver back when I was in school. It's quite simple and almost a textbook case for backtracking. Even brute-force algorithms are instantaneous on the hardest puzzles.

I'm still mesmerized by the 15-line prolog sudoku solver: http://programmablelife.blogspot.com/2012/07/adventures-in-d...

It's just using a library, you can get the same effect in any language with a constraint satisfaction library.

Re: The Miracle Sudoku [video]

#43
post #41

Earlier quoted context omitted.

which addon are you using for speedup?

Enhancer for YouTube can do that, but you can also do it with simple userscript. The userscript I found somewhere few years ago: // ==UserScript== // @name Mediabord // @version 01.1 // @description tryd to take over the world! // @author j // @match *://*/* // @grant metadata // ==/UserScript== document.addEventListener('keydown', function(event) { var vidz = document.querySelectorAll('video'); function is_text_box(…

Wait, what? Youtube has builtin control for that for years, behind the cog wheel at the bottom right of the video.

Re: The Miracle Sudoku [video]

#44
Using my CL based sudoku solver [1], I got the following solution. The solution is valid but different from what is shown in the video. IIRC, a sudoku board can have multiple solutions but anyone out here can explain why so? I am no sudoku expert or enjoying solving sudokus anyways!

[1] https://github.com/dmsurti/sudoku

```

(setf board

      #(0 0 0 0 0 0 0 0 0

        0 0 0 0 0 0 0 0 0

        0 0 0 0 0 0 0 0 0

        0 0 0 0 0 0 0 0 0

        0 0 1 0 0 0 0 0 0

        0 0 0 0 0 0 2 0 0

        0 0 0 0 0 0 0 0 0

        0 0 0 0 0 0 0 0 0

        0 0 0 0 0 0 0 0 0))
```

```

* (sudoku:print-board (sudoku:solve board))

1 2 5 | 6 4 7 | 8 9 3

8 3 4 | 5 9 1 | 6 7 2

9 7 6 | 3 2 8 | 4 5 1

- - - - - - - - - - -

5 8 9 | 2 3 4 | 1 6 7

2 6 1 | 7 8 9 | 3 4 5

3 4 7 | 1 5 6 | 2 8 9

- - - - - - - - - - -

4 9 2 | 8 1 5 | 7 3 6

6 1 8 | 9 7 3 | 5 2 4

7 5 3 | 4 6 2 | 9 1 8

```

edit: formatting

Re: The Miracle Sudoku [video]

#46

Using my CL based sudoku solver [1], I got the following solution. The solution is valid but different from what is shown in the video. IIRC, a sudoku board can have multiple solutions but anyone out here can explain why so? I am no sudoku expert or enjoying solving sudokus anyways! [1] https://github.com/dmsurti/sudoku ``` (setf board #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0…

Your solution doesn't respect the knight's move and king's move constraints, which cause the original puzzle to have exactly one solution.

Re: The Miracle Sudoku [video]

#47

Using my CL based sudoku solver [1], I got the following solution. The solution is valid but different from what is shown in the video. IIRC, a sudoku board can have multiple solutions but anyone out here can explain why so? I am no sudoku expert or enjoying solving sudokus anyways! [1] https://github.com/dmsurti/sudoku ``` (setf board #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0…

You have consecutive numbers appearing next to each other.

One of the constraints is that no consecutive numbers can appear orthogonally.

This isn't a standard sudoku, there are extra rules. There would be a huge number of valid solutions to the board under regular sudoku rules.

EDIT: and you've missed the King's move constraint as well and I presume the Knight's move as well.

Re: The Miracle Sudoku [video]

#48
post #41

Earlier quoted context omitted.

Enhancer for YouTube can do that, but you can also do it with simple userscript. The userscript I found somewhere few years ago: // ==UserScript== // @name Mediabord // @version 01.1 // @description tryd to take over the world! // @author j // @match *://*/* // @grant metadata // ==/UserScript== document.addEventListener('keydown', function(event) { var vidz = document.querySelectorAll('video'); function is_text_box(…

Wait, what? Youtube has builtin control for that for years, behind the cog wheel at the bottom right of the video.

They're using the addon to be able to get 3x and 6x speedups, which are not available by default.

Re: The Miracle Sudoku [video]

#49
post #41

Earlier quoted context omitted.

Enhancer for YouTube can do that, but you can also do it with simple userscript. The userscript I found somewhere few years ago: // ==UserScript== // @name Mediabord // @version 01.1 // @description tryd to take over the world! // @author j // @match *://*/* // @grant metadata // ==/UserScript== document.addEventListener('keydown', function(event) { var vidz = document.querySelectorAll('video'); function is_text_box(…

Wait, what? Youtube has builtin control for that for years, behind the cog wheel at the bottom right of the video.

[deleted]

Re: The Miracle Sudoku [video]

#50
post #9

As a college project in C, we were to write a soduku solver. Smart people solved it by programming in fancy heuristics. Not being smart, I just brute forced it...though I tried to be fancy by representing the data at the bit level. I doubt it made it any faster lol. That said, when the hardest Soduku problems in the world succumbed to a brute force search to my lame program in less than a few something something ms,…

I was discussing this with a friend. I too made a brute force sudoku solver. It was somewhat smart since it was keeping track of what options are available for each cell and updates those options as it puts/removes digits. The friend told me he was working on a sudoku solver and was trying to explain his non-brute force algorithm. I told him I did a solver back in collage and it was basically instant even though it i…

Similar story. A friend and i were arguing about whether you could solve sudokus by brute force in reasonable time. So we whipped out a couple of laptops and tried it. I had a brute force solver (kind of branch-and-bound-ish, ISTR) finished before he had his constraint-based approach running, and it solved any puzzle in the blink of an eye.

To capture some of the fun of human Sudoku-solving, i think you'd want to have some sort of metric for how brute the force is, and then see if you can write a solver which is as unbrutal as possible. I'm not sure what that metric would be, though.

Post reply on HN