2014-12-08 12:45:33 +01:00
|
|
|
- content_for(:title) { 'Sudoku' }
|
|
|
|
|
|
|
|
h1 Sudoku
|
|
|
|
#board
|
|
|
|
|
|
|
|
script type="text/javascript" src="/sudoku.js"
|
|
|
|
javascript:
|
|
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
|
|
sudoku = new Sudoku(document.getElementById('board'));
|
2014-12-08 18:22:30 +01:00
|
|
|
|
|
|
|
xmlhttp = new XMLHttpRequest();
|
|
|
|
xmlhttp.open("GET", "#{url('/data/sudoku/gnome-sudoku_easy.json')}");
|
|
|
|
|
|
|
|
xmlhttp.addEventListener('load', function(evt) {
|
|
|
|
sudoku.generate(JSON.parse(evt.target.responseText)) })
|
|
|
|
xmlhttp.send();
|
2014-12-08 12:45:33 +01:00
|
|
|
});
|