Tuesday, June 21, 2011

Sudoku Vision 2.9

Hi!

Sudoku Vision 2.9 is available on Android Market : Sudoku Vision

Here are the recent changes of this version :

  • Screens adjusted for large tablets
  • Icons adjusted for large tablets
  • Augmented reality and screens capture adjusted for large tablets

Here is the general description of Sudoku Vision 2.9 :

1. Capture a Sudoku using the camera of your phone

  • Place the Sudoku at any angle from 0° to 360°
  • See each step to find grid and numbers in the photo
  • Ask to evaluate the difficult level of the Sudoku just captured

2. See augmented reality in action

  • Just show a Sudoku to Sudoku Vision and you will see the solution, no photo to take and no button to press
  • Just show a Sudoku to Sudoku Vision and you will capture the digits, no photo to take and no button to press
  • Place the Sudoku at any angle from 0° to 360°
  • Ask to evaluate the difficult level of the Sudoku just captured

3. Generate a Sudoku

  • Ask for a difficulty level from "1. Very very easy" to '7. Very very difficult"
  • Many strategies supported(*)
  • Instantaneous generation
  • Unlimited new Sudokus
  • No Internet connection is required

4. Get help for the solution

  • Ask for hints that teach if you are stuck
  • Ask for a solution, even for the most difficult Sudoku
  • Ask if they are more than one solution
  • Show pencil marks
  • View step by step the explicative road toward the solution(*)

5. Save and open Sudoku

  • The Sudoku itself
  • The photo of the Sudoku

(*) Strategies supported (more coming in the next version) :
  • Naked single
  • Hidden single
  • Pointing/claiming
  • Naked twin
  • Hidden twin
  • Naked triplet
  • Hidden triplet
  • Naked quadruplet
  • Hidden quadruplet
  • X-Wing
  • XY-Wing
  • XYZ-Wing
  • Swordfish
  • Jellyfish
  • Uniqueness type 1 to 6
  • Uniqueness type x
  • Uniqueness hidden rectangle
  • Bug type 1
  • Bug type 2
  • Bug type x


- Large tablets support at full screen
- The application can be moved to external memory (APP2SD)


Here are the strategies by level :

Level Strategy
1Naked single
2Hidden single
3Pointing/claiming
4Naked twin
Hidden twin
5Naked triplet
Hidden triplet
6Naked quadruplet
X-Wing
XY-Wing
XYZ-Wing
Bug type 1
Uniqueness type 1
7Uniqueness type 2
Uniqueness type 3
Uniqueness type 4
Uniqueness type 5
Uniqueness type 6
Uniqueness type x
Uniqueness hidden rectangle
Hidden quadruplet
Swordfish
Jellyfish
Bug type 2
Bug type x

Friday, June 3, 2011

Sudoku Vision 2.8

Hi!

Sudoku Vision 2.8 is available on Android Market : Sudoku Vision

Here are the recent changes of this version :

  • Augmented reality : just show a Sudoku to Sudoku Vision and you will see the solution, no photo to take and no button to press
  • Augmented reality : just show a Sudoku to Sudoku Vision and you will capture the digits, no photo to take and no button to press
  • Augmented reality : place the Sudoku at any angle from 0° to 360°
  • Improved icons

Here is the general description of Sudoku Vision 2.8 :

1. Capture a Sudoku using the camera of your phone

  • Place the Sudoku at any angle from 0° to 360°
  • See each step to find grid and numbers in the photo
  • Ask to evaluate the difficult level of the Sudoku just captured

2. See augmented reality in action

  • Just show a Sudoku to Sudoku Vision and you will see the solution, no photo to take and no button to press
  • Just show a Sudoku to Sudoku Vision and you will capture the digits, no photo to take and no button to press
  • Place the Sudoku at any angle from 0° to 360°
  • Ask to evaluate the difficult level of the Sudoku just captured

3. Generate a Sudoku

  • Ask for a difficulty level from "1. Very very easy" to '7. Very very difficult"
  • Many strategies supported(*)
  • Instantaneous generation
  • Unlimited new Sudokus
  • No Internet connection is required

4. Get help for the solution

  • Ask for hints that teach if you are stuck
  • Ask for a solution, even for the most difficult Sudoku
  • Ask if they are more than one solution
  • Show pencil marks
  • View step by step the explicative road toward the solution(*)

5. Save and open Sudoku

  • The Sudoku itself
  • The photo of the Sudoku

(*) Strategies supported (more coming in the next version) :
  • Naked single
  • Hidden single
  • Pointing/claiming
  • Naked twin
  • Hidden twin
  • Naked triplet
  • Hidden triplet
  • Naked quadruplet
  • Hidden quadruplet
  • X-Wing
  • XY-Wing
  • XYZ-Wing
  • Swordfish
  • Jellyfish
  • Uniqueness type 1 to 6
  • Uniqueness type x
  • Uniqueness hidden rectangle
  • Bug type 1
  • Bug type 2
  • Bug type x


- The application can be moved to external memory (APP2SD)
- Tablets support at full screen

Here are the strategies by level :

Level Strategy
1Naked single
2Hidden single
3Pointing/claiming
4Naked twin
Hidden twin
5Naked triplet
Hidden triplet
6Naked quadruplet
X-Wing
XY-Wing
XYZ-Wing
Bug type 1
Uniqueness type 1
7Uniqueness type 2
Uniqueness type 3
Uniqueness type 4
Uniqueness type 5
Uniqueness type 6
Uniqueness type x
Uniqueness hidden rectangle
Hidden quadruplet
Swordfish
Jellyfish
Bug type 2
Bug type x

Friday, May 13, 2011

Sudoku Vision 2.7

Hi!

Sudoku Vision 2.7 is available on Android Market : Sudoku Vision

Here are the recent changes of this version :

  • Strategies added :
    • Uniqueness type 5
    • Uniqueness type 6
    • Uniqueness type x
    • Uniqueness hidden rectangle
    • Bug type 2
    • Bug type x
  • Sudoku generation modified to include strategies added
  • Each strategy is identified in the step by step road toward the solution

Here is the general description of Sudoku Vision 2.7 :

1. Capture a Sudoku using the camera of your phone

  • Place the Sudoku at any angle from 0° to 360°
  • See each step to find grid and numbers in the photo
  • Ask to evaluate the difficult level of the Sudoku just captured

2. Generate a Sudoku

  • Ask for a difficulty level from "1. Very very easy" to '7. Very very difficult"
  • Many strategies supported(*)
  • Instantaneous generation
  • Unlimited new Sudokus
  • No Internet connection is required

3. Get help for the solution

  • Ask for hints that teach if you are stuck
  • Ask for a solution, even for the most difficult Sudoku
  • Ask if they are more than one solution
  • Show pencil marks
  • View step by step the explicative road toward the solution(*)

4. Save and open Sudoku

  • The Sudoku itself
  • The photo of the Sudoku

(*) Strategies supported (more coming in the next version) :
  • Naked single
  • Hidden single
  • Pointing/claiming
  • Naked twin
  • Hidden twin
  • Naked triplet
  • Hidden triplet
  • Naked quadruplet
  • Hidden quadruplet
  • X-Wing
  • XY-Wing
  • XYZ-Wing
  • Swordfish
  • Jellyfish
  • Uniqueness type 1 to 6
  • Uniqueness type x
  • Uniqueness hidden rectangle
  • Bug type 1
  • Bug type 2
  • Bug type x


- The application can be moved to external memory (APP2SD)
- Tablets support at full screen

Here are the strategies by level :

Level Strategy
1Naked single
2Hidden single
3Pointing/claiming
4Naked twin
Hidden twin
5Naked triplet
Hidden triplet
6Naked quadruplet
X-Wing
XY-Wing
XYZ-Wing
Bug type 1
Uniqueness type 1
7Uniqueness type 2
Uniqueness type 3
Uniqueness type 4
Uniqueness type 5
Uniqueness type 6
Uniqueness type x
Uniqueness hidden rectangle
Hidden quadruplet
Swordfish
Jellyfish
Bug type 2
Bug type x

Sunday, April 17, 2011

Sudoku Vision 2.6

Hi!

Sudoku Vision 2.6 is available on Android Market : Sudoku Vision

Here are the recent changes of this version :

  • 2 more difficulty levels: "6. Very difficult and "7. Very very difficult"
  • Strategies added :
    • Naked quadruplet
    • Hidden quadruplet
    • X-Wing
    • XY-Wing
    • XYZ-Wing
    • Bug type 1
    • Uniqueness type 1 to 4
    • Swordfish
    • Jellyfish
  • Highlighted selected number button
  • Minor bug fixes

Here is the general description of Sudoku Vision 2.6 :

1. Capture a Sudoku using the camera of your phone

  • Place the Sudoku at any angle from 0° to 360°
  • See each step to find grid and numbers in the photo
  • Ask to evaluate the difficult level of the Sudoku just captured

2. Generate a Sudoku

  • Ask for a difficulty level from "1. Very very easy" to '7. Very very difficult"
  • Many strategies supported(*)
  • Instantaneous generation
  • Unlimited new Sudokus
  • No Internet connection is required

3. Get help for the solution

  • Ask for hints that teach if you are stuck
  • Ask for a solution, even for the most difficult Sudoku
  • Ask if they are more than one solution
  • Show pencil marks
  • View step by step the explicative road toward the solution(*)

4. Save and open Sudoku

  • The Sudoku itself
  • The photo of the Sudoku

(*) Strategies supported (more coming in the next version) :
  • Naked single
  • Hidden single
  • Pointing/claiming
  • Naked twin
  • Hidden twin
  • Naked triplet
  • Hidden triplet
  • Naked quadruplet
  • Hidden quadruplet
  • X-Wing
  • XY-Wing
  • XYZ-Wing
  • Bug type 1
  • Uniqueness type 1 to 4
  • Swordfish
  • Jellyfish


- The application can be moved to external memory (APP2SD)
- Tablets support at full screen

Here are the strategies by level :

Level Strategy
1Naked single
2Hidden single
3Pointing/claiming
4Naked twin
Hidden twin
5Naked triplet
Hidden triplet
6Naked quadruplet
X-Wing
XY-Wing
XYZ-Wing
Bug type 1
Uniqueness type 1
7Uniqueness type 2
Uniqueness type 3
Uniqueness type 4
Hidden quadruplet
Swordfish
Jellyfish

Wednesday, March 23, 2011

Sudoku Vision 2.5

Hi!

Sudoku Vision 2.5 is available on Android Market.

Here are the recent changes of this version :

  • Generate a Sudoku with a difficulty level from "1. Very easy" to '5. Very difficult"
  • View step by step the explicative road toward the solution
  • Ask to evaluate the difficult level of a Sudoku
  • Show pencil marks
  • Accept Sudoku with a minimum of 17 digits

Here is the general description of Sudoku Vision 2.5 :

1. Capture a Sudoku using the camera of your phone

  • Place the Sudoku at any angle from 0° to 360°
  • See each step to find grid and numbers in the photo
  • Ask to evaluate the difficult level of the Sudoku just captured

2. Generate a Sudoku

  • Ask for a difficulty level from "1. Very easy" to '5. Very difficult"
  • Instantaneous generation
  • Unlimited new Sudokus
  • No Internet connection is required

3. Get help for the solution

  • Ask for hints that teach if you are stuck
  • Ask for a solution
  • Ask if they are more than one solution
  • Show pencil marks
  • View step by step the explicative road toward the solution

4. Save and open Sudoku

  • The Sudoku itself
  • The photo of the Sudoku

- The application can be moved to external memory (APP2SD)
- Tablets support at full screen

Tuesday, January 4, 2011

Step 9 : Play and solve the Sudoku

It is really amazing how it is simple to write a program to find one solution or all the solutions of a Sudoku. Here is the pseudo-code to do it :

Function Find_all_solutions (The_Sudoku)

    look for the first empty square in The_sudoku
    if there is no empty square
          you found a solution
          you can now show, store or print The_Sudoku
    else
          for i = 1 to 9
                if you can place i in the empty square of The_Sudoku
                      place i in the empty square
                      call Find_all_solutions(The_Sudoku)
                      place 0 in the empty square

End of Find_all_solutions

You just have to translate this pseudo-code in Java and it works!

But, this code is not the most performant one. We can improve it a lot, particularly with Dancing Links, or DLX, which is a technique suggested by  the famous Donald Knuth. Here are some very interesting resources concerning this technique :
Dancing links
Knuth's Algorithm X
Exact Cover Matrix

Of course, we implemented this excellent technique in our application.

So, now, you just have to play with your Sudoku. But sometimes, the Sudoku is quite hard. Of course, our application can give one solution. And our application can even  say if they are many solutions. But, asking for the solution does not help to know how to solve a Sudoku. So, why not ask just for a hint? If you do, our application will give you the next number it would play. At this point, you can have one of these reactions :

  1. Yes, or course; why did not I find this number myself?
  2. Why is this number suggested by the application? You check the Sudoku a little bit more and you get it! Now, you learn rapidly to solve a Sudoku
  3. I do not know why the application suggests this number but, at least, I can continue

Here is the screen shown when you press the Hint button. Just try it! You will understand it very fast :





What technique do we use to suggest a number when asked to give a hint, for the lines for example? Very simple . . . as usual! We use the function Find_all_solutions  not for all the Sudoku but rather for just the first line; after, for all the solutions found in the first line, we verify if a number is always in the same square; if yes, we suggest this number. If not, we verify the line 2 up to the line 9. If we do not find any number always in the same square, we  say we do not have any clue for the lines.

You want a hint for the columns? Just press the Columns button. And so on.

Enjoy and amusez-vous bien!



Note : You can store the current Sudoku. It is stored in the external storage in the directory named com.rogerlebo.sudokuvision. Of course, you can  also retrieve a Sudoku you stored previously.

Step 8 : Give the numbers

We return the numbers of the Sudoku captured with this very simple Java code :

Uri data = Uri.parse(sudoku_capture);
Intent result = new Intent(null, data);
setResult(RESULT_OK, result);
finish();
Display :

In this step, all the photos give the same result. Below, you can see the final result with 3 different Android phones.

Here are some observations concerning the images :

  • the application can be in English or in French depending on which language you set for your phone
  • the taller is the height of the phone screen, the more you see new or taller buttons; the same functions of the buttons missing in the first image can be obtained with the menu button