Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: setClueButtonWord is not defined' in or related to this line: 'setClueButtonWord('ButtonClue1');' Line Number: 380
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: clueWord is undefined' in or related to this line: 'var letter = clueWord[clueLevel - 1];' Line Number: 487
Code edit (1 edits merged)
Please save this source code
Code edit (12 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: mainGrid.cells[line] is undefined' in or related to this line: 'if (mainGrid.cells[line][col]) {' Line Number: 453
Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: word is undefined' in or related to this line: 'var wordShuffled = wordShuffled = word.split('').sort(function () {' Line Number: 495
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: pickAndShakeSingleWord is not defined' in or related to this line: 'var word = pickAndShakeSingleWord().word;' Line Number: 495
Code edit (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: maingrid is not defined' in or related to this line: 'if (maingrid) {' Line Number: 547
Code edit (1 edits merged)
Please save this source code
Code edit (18 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: clueButton is null' in or related to this line: 'clueButton = new Button('', {' Line Number: 433
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'y')' in or related to this line: 'var validateButton = new Button('', {' Line Number: 302
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'width')' in or related to this line: 'self.width = options.width || 200;' Line Number: 56
===================================================================
--- original.js
+++ change.js
@@ -238,8 +238,19 @@
/****
* Game Code
****/
+//Fonction pickAndShakeSingleWord : permet de choisir un mot dans la liste des mots et de le mélanger
+function pickAndShakeSingleWord() {
+ var word = wordsMainList[Math.floor(Math.random() * wordsMainList.length)];
+ var wordShuffled = word.split('').sort(function () {
+ return 0.5 - Math.random();
+ }).join('');
+ return {
+ word: word,
+ wordShuffled: wordShuffled
+ };
+} //Fin de la fonction pickAndShakeSingleWord
//var wordsMainListTest = ["AARDVARK", "ALBATROSS", "ALLIGATOR", "ALPACA", "ANT"]; //The real main list is at the end
/****
* GAME DESCRIPTION:
* Game Principle:
@@ -470,29 +481,25 @@
wordGrid.initializeGrid();
wordGrid.x = game.width / 2 + 100;
wordGrid.y = ScoreZone.height + mainGrid.height + 300;
} //Fin de la fonction initWordGrid
-//Fonction pickAndShakeSingleWord : permet de choisir un mot dans la liste des mots et de le mélanger
-function pickAndShakeSingleWord() {
- var randomIndex = Math.floor(Math.random() * wordsMainList.length);
- var word = wordsMainList[randomIndex];
- var wordShuffled = wordShuffled = word.split('').sort(function () {
- return 0.5 - Math.random();
- }).join('');
- return {
- word: word,
- wordShuffled: wordShuffled
- };
-} //Fin de la fonction pickAndShakeSingleWord
//Fonction pickAndShakeWords : permet de choisir plusieurs mots dans la liste des mots et de les mélanger
function pickAndShakeWords(numberOfWords) {
+ var words = [];
var wordsShuffeled = [];
for (var i = 0; i < numberOfWords; i++) {
+ var word = pickAndShakeSingleWord().word;
var shuffledWord = pickAndShakeSingleWord().wordShuffled;
+ words.push(word);
wordsShuffeled.push(shuffledWord);
}
- return wordsShuffeled;
+ return {
+ words: words,
+ wordsShuffeled: wordsShuffeled
+ };
} //Fin de la fonction pickAndShakeWords
+//Fonction pickAndShakeWords : permet de choisir plusieurs mots dans la liste des mots et de les mélanger
+//Fin de la fonction pickAndShakeWords
//Fonction putRandomShuffledWordInGrid : permet de mettre un mot mélangé dans la grille principale
function putRandomShuffledWordInGrid() {
var word = pickAndShakeSingleWord().word;
var isPossibleToAddletter = true; //Indique si le mot peut être ajouté dans la grille principale
@@ -578,12 +585,13 @@
//Chargement initiale de la grille principale si nécessaire (vide):
//mot(s) est choisi au hasard dans la liste principale,
//il est mélangé et les lettres sont directement ajoutées à la grille principale avec la fonction addRandomLetter
if (mainGrid.isEmpty() && !isGameStarted) {
- var wordsToBegin = pickAndShakeWords(1);
+ var wordsToBegin = pickAndShakeWords(1).words;
+ var wordsShuffeledToBegin = pickAndShakeWords(1).wordsShuffeled;
var wordCompiled = "";
- for (var i = 0; i < wordsToBegin.length; i++) {
- wordCompiled += wordsToBegin[i];
+ for (var i = 0; i < wordsShuffeledToBegin.length; i++) {
+ wordCompiled += wordsShuffeledToBegin[i];
}
if (wordCompiled.length > 0) {
for (var i = 0; i < wordCompiled.length; i++) {
mainGrid.addRandomLetter(wordCompiled[i]);
An empty cell.
Drapeau national des USA en fond d'un patchwork des États américains.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Une jeton de scrabble sans lettre.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Un bouton arrondi suggérant une validation mais sans texte écrit dessus.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A round button with a cyan interrogation mark.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A round cyan button with a yellow lamp bulb.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Planetes.
Remove the white square and the red lines.
A patchwork of european countries with the european unio flag in back ground.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A yellow coin wher we can see '+10' written on it.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A red coin wher we can see '-10' written on it... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Patchwork of heads of plenty animals.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
The periodic table of the elements.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Patchwork de mots sur un fond cyan.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Patchwork of scene extracted from video games.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
It is written "COOL QUIZZ".
A cyan circle button with a home silhouette in the center. The button means "go back to start window". Avoid white color.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.