Skip to content
Snippets Groups Projects
Commit 4b6535c7 authored by Silas Dohm's avatar Silas Dohm
Browse files

switched to json format

parent d2b3dae3
Branches
No related tags found
No related merge requests found
function initPuzzle(){
async function initPuzzle(){
columns = 12;
rows = 12;
ctx.canvas.width = size * columns;
......@@ -9,43 +9,18 @@ for (i = 0; i < columns; i++) {
cells[i][j] = new Cell(i, j); //create array of empty cells
}
}
words.push(new Word("einverstanden", "okay", 1, 1, 0));
words.push(new Word("Hochziele", "ideale", 6, 1, 0));
words.push(new Word("Rauschgift", "dope", 1, 2, 0));
words.push(new Word("altgerm. Donnergott", "thor", 8, 2, 0));
words.push(new Word("Hospital", "klinik", 1, 3, 0));
words.push(new Word("Wortreihe", "satz", 8, 3, 0));
words.push(new Word("österr.: Tschüss", "baba", 0, 4, 0));
words.push(new Word("engl.: Nacken", "neck", 5, 4, 0));
words.push(new Word("Bildzeichen", "ikon", 8, 5, 0));
words.push(new Word("Teil eines Videos", "tonspur", 0, 6, 0));
words.push(new Word("Vorsilbe: gemäß", "ana", 9, 6, 0));
words.push(new Word("poln. Stadt", "posen", 3, 7, 0));
words.push(new Word("lat. Vorsilbe: Sonne", "solar", 0, 8, 0));
words.push(new Word("Durchschnitt", "mittel", 6, 8, 0));
words.push(new Word("sich drehen", "rotieren", 3, 9, 0));
words.push(new Word("ugs.: erstklassig", "dufte", 0, 10, 0));
words.push(new Word("Lattenkiste", "stiege", 6, 10, 0));
words.push(new Word("Rauchfang", "esse", 3, 11, 0));
words.push(new Word("Luftreifen", "pneu", 8, 11, 0));
words.push(new Word("Schnaps", "wodka", 1, 0, 1));
words.push(new Word("Laubbaum", "birke", 6, 0, 1));
words.push(new Word("Wassermotorrad", "jetski", 8, 0, 1));
words.push(new Word("Teil des Motors", "kolben", 2, 1, 1));
words.push(new Word("Hauptst. von Samoa", "apia", 3, 1, 1));
words.push(new Word("jap. Währungseinheit", "yen", 4, 1, 1));
words.push(new Word("Ach so!", "aha", 9, 1, 1));
words.push(new Word("Hautpflegemittel", "lotion", 10, 1, 1));
words.push(new Word("metallhaltiges Gestein", "erz", 11, 1, 1));
words.push(new Word("lat.: inwendig", "intus", 5, 3, 1));
words.push(new Word("dornige Pflanzen", "kakteen", 9, 5, 1));
words.push(new Word("Kochsalz", "nacl", 11, 5, 1));
words.push(new Word("Beitrag", "obolus", 1, 6, 1));
words.push(new Word("Teilbereich", "sparte", 3, 6, 1));
words.push(new Word("durchlässig", "poroes", 4, 6, 1));
words.push(new Word("Geräteschuppen", "remise", 6, 6, 1));
words.push(new Word("Metallbolzen", "niet", 7, 7, 1));
words.push(new Word("kleine Reise", "trip", 8, 8, 1));
words.push(new Word("Bedrängnis", "enge", 10, 8, 1));
words.push(new Word("chem. Z. Europium", "eu", 11, 10, 1));
fetch("./today.json")
.then(response => {
return response.json();
})
.then(jsondata => {
jsondata.forEach(element => {
words.push(new Word(element.clue, element.word, element.x, element.y, element.direction));
});
}).then(() =>{
initNeighbours();
activeCell = words[0].chars[0]; //start cell
lastCell = activeCell;
endInput();
});
}
......@@ -16,12 +16,11 @@ let cells = new Array();
let columns, rows;
let finished = false;
ctx.canvas.width = size * 12;
ctx.canvas.height = size * 12;
initPuzzle();
initNeighbours();
activeCell = words[0].chars[0]; //start cell
lastCell = activeCell;
endInput();
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
......
[{"clue":"Laubbaum","word":"ahorn","x":0,"y":1,"direction":0},{"clue":"Notbehelf","word":"ersatz","x":6,"y":1,"direction":0},{"clue":"Marvelfigur, ... Man","word":"iron","x":1,"y":2,"direction":0},{"clue":"Frauenname","word":"ilse","x":8,"y":2,"direction":0},{"clue":"grüner Meerrettich","word":"wasabi","x":1,"y":3,"direction":0},{"clue":"später als","word":"nach","x":8,"y":3,"direction":0},{"clue":"Auto von M. Knight","word":"kitt","x":0,"y":4,"direction":0},{"clue":"bayr.: Dienstag","word":"irta","x":5,"y":4,"direction":0},{"clue":"Abk.: Weltrekord","word":"wr","x":5,"y":5,"direction":0},{"clue":"slaw. für Johannes","word":"iwan","x":8,"y":5,"direction":0},{"clue":"Punkte über Vokal","word":"trema","x":1,"y":6,"direction":0},{"clue":"kurz für Adrian","word":"adi","x":9,"y":6,"direction":0},{"clue":"Einheit für Energie","word":"kwh","x":5,"y":7,"direction":0},{"clue":"dumpfer Schlag","word":"bums","x":0,"y":8,"direction":0},{"clue":"Torso","word":"rumpf","x":6,"y":8,"direction":0},{"clue":"schlecht","word":"mies","x":1,"y":9,"direction":0},{"clue":"Gott d. Schönheit","word":"adonis","x":6,"y":9,"direction":0},{"clue":"astron. Maßeinheit","word":"parsec","x":1,"y":10,"direction":0},{"clue":"skand. Münze","word":"oere","x":8,"y":10,"direction":0},{"clue":"Entdeckung","word":"fund","x":1,"y":11,"direction":0},{"clue":"Systemkern (IT)","word":"kernel","x":6,"y":11,"direction":0},{"clue":"Frauenname","word":"anna","x":4,"y":0,"direction":1},{"clue":"Chaos","word":"gewirr","x":6,"y":0,"direction":1},{"clue":"ugs.: Hilfskraft","word":"hiwi","x":1,"y":1,"direction":1},{"clue":"Redner in der Antike","word":"orator","x":2,"y":1,"direction":1},{"clue":"Eisenfraß","word":"rost","x":3,"y":1,"direction":1},{"clue":"ägypt. Halbinsel","word":"sinai","x":8,"y":1,"direction":1},{"clue":"franz.: nach Art von","word":"ala","x":9,"y":1,"direction":1},{"clue":"Land in Afrika","word":"tschad","x":10,"y":1,"direction":1},{"clue":"Fußglied","word":"zeh","x":11,"y":1,"direction":1},{"clue":"Lager im Freien","word":"biwak","x":5,"y":3,"direction":1},{"clue":"sich vorbereiten","word":"wappnen","x":9,"y":5,"direction":1},{"clue":"Strom in Afrika","word":"nil","x":11,"y":5,"direction":1},{"clue":"hohe Spielkarte","word":"trumpf","x":1,"y":6,"direction":1},{"clue":"ehern","word":"eisern","x":3,"y":6,"direction":1},{"clue":"Schiffstrümmer","word":"wrack","x":6,"y":7,"direction":1},{"clue":"Blickfeldanzeige","word":"hud","x":7,"y":7,"direction":1},{"clue":"Katzenlaut","word":"miau","x":2,"y":8,"direction":1},{"clue":"feuchtes Land","word":"moor","x":8,"y":8,"direction":1},{"clue":"engl.: Feuer","word":"fire","x":10,"y":8,"direction":1},{"clue":"Festplatte","word":"ssd","x":4,"y":9,"direction":1},{"clue":"franz.: Salz","word":"sel","x":11,"y":9,"direction":1}]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment