How to make a Sudoku (Only javascript used)

10 days ago, a good friend of mine asked me to write a sudoku online game for him.
He is always bored at work and wanted to lose some time, so… here it is :)

PLAY

Rules of sudoku

  • Each row should contains all numbers from 1 to 9 (no repetition)
  • Each column should contains all numbers from 1 to 9 (no repetition)
  • Each 3×3 table should contains all numbers from 1 to 9 (no repetition)

Logic used

  • Start by generating each number in a cell at a time by choosing randomly from 1 to 9
  • If the number is ok and do not conflict with the other cells —> Continue to next one
  • Else —> go back one cell and choose another number

Play the game: here
Download the files: here

Enjoy :)