HEX
Server: Apache
System: Linux vps.mmtprep.com 4.18.0-477.21.1.el8_8.x86_64 #1 SMP Thu Aug 10 13:51:50 EDT 2023 x86_64
User: mmtprep (1001)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/3A10-7-upQQeWWN.js.map
{"version":3,"file":"3A10-7-upQQeWWN.js","sources":["../../src/exercices/3e/3A10-7.js"],"sourcesContent":["import { choice, combinaisonListes } from '../../lib/outils/arrayOutils'\nimport { miseEnEvidence } from '../../lib/outils/embellissements'\nimport { labyrinthe } from '../../modules/Labyrinthe.js'\nimport Exercice from '../Exercice.js'\nimport { mathalea2d } from '../../modules/2dGeneralites.js'\nimport { listeQuestionsToContenu, randint } from '../../modules/outils.js'\nexport const dateDePublication = '12/10/2022'\nexport const titre = 'Explore a prime number maze'\n\n/** Explorer un labyrinthe de nombres premiers\n * @author Eric Elter // Sur la base d'autres labyrinthes déjà créés\n */\nexport const uuid = '9552d'\nexport const ref = '3A10-7'\nexport default function ExerciceLabyrinthePremiers3e () {\n  Exercice.call(this)\n  this.titre = titre\n  this.consigne = ''\n  this.nbQuestions = 3\n  this.nbCols = 1\n  this.nbColsCorr = 1\n  this.pasDeVersionLatex = false\n  this.pas_de_version_HMTL = false\n  this.sup = 3\n  this.sup2 = 6\n  this.sup3 = 1\n  this.sup4 = 1\n\n  this.nouvelleVersion = function () {\n    const tailleChiffre = 1.5\n    let nbPremiers = []\n    let nbMax\n    switch (this.sup) {\n      case 3 :\n        nbPremiers = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]\n        nbMax = 199\n        break\n      case 2 :\n        nbPremiers = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\n        nbMax = 99\n        break\n      case 1 :\n        nbPremiers = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\n        nbMax = 29\n        break\n    }\n    this.listeCorrections = []\n    this.listeQuestions = []\n    this.autoCorrection = []\n    let texte, texteCorr\n    let laby = []\n    let monChemin\n\n    for (let q = 0; q < this.nbQuestions;) {\n      const nbL = this.sup3 === 1 ? randint(2, 8) : Math.max(2, this.sup3)\n      const nbC = this.sup4 === 1 ? randint(3, 11 - nbL) : Math.max(3, this.sup4)\n      laby = labyrinthe({ nbLignes: nbL, nbColonnes: nbC })\n      laby.niveau = this.sup2\n      monChemin = laby.choisitChemin(laby.niveau) // On choisit un chemin\n      laby.murs2d = laby.construitMurs(monChemin) // On construit le labyrinthe\n      laby.chemin2d = laby.traceChemin(monChemin, choice(['blue', 'green', 'red'])) // On trace le chemin solution\n\n      texte = 'Find the exit by passing only the boxes containing a prime number.<br>'\n      texteCorr = `Here is the path in color and the output was the number $${miseEnEvidence(nbL - monChemin[monChemin.length - 1][1])}$.<br>`\n      // Number table construction area: If they are on myPath and only if, they must check the instruction\n\n      const bonnesReponses = combinaisonListes(nbPremiers, nbC * nbL)\n      let mauvaisesReponses = Array.from({ length: nbMax - 1 }, (_, i) => i + 2).filter((number) => !nbPremiers.includes(number))\n      // MGu bug because randint cannot necessarily find a value, because only 50 tries\n      // let badResponses = []\n      // for (let i = 0; i <= nbMax - nbPremiers.length - 2; i++) {\n      // badResponses.push(randint(2, nbMax, nbFirst.concat(badResponses)))\n      // }\n      mauvaisesReponses = combinaisonListes(mauvaisesReponses, nbC * nbL)\n      // Once the number table is made, we place the number objects.\n      laby.nombres2d = laby.placeNombres(monChemin, bonnesReponses, mauvaisesReponses, tailleChiffre)\n      const params = { xmin: -4, ymin: 0, xmax: 5 + 3 * nbC, ymax: 2 + 3 * nbL, pixelsParCm: 20, scale: 0.7 }\n      texte += mathalea2d(params, laby.murs2d, laby.nombres2d)\n      texteCorr += mathalea2d(params, laby.murs2d, laby.nombres2d, laby.chemin2d)\n      if (this.questionJamaisPosee(q, bonnesReponses[0], mauvaisesReponses[0])) {\n        this.listeQuestions.push(texte)\n        this.listeCorrections.push(texteCorr)\n        q++\n      }\n    }\n    listeQuestionsToContenu(this)\n  }\n  this.besoinFormulaireNumerique = ['List of prime numbers', 3, '1: Less than 30\\n2: Less than 100\\n3: Less than 200']\n  this.besoinFormulaire2Numerique = ['Speed level', 6, '1: Snail\\n2: Turtle\\n3: Hare\\n4: Antelope\\n5: Cheetah\\n6: Random']\n  this.besoinFormulaire3Numerique = ['Number of lines in the maze (between 2 and 8 or 1 if you leave it to chance)', 8]\n  this.besoinFormulaire4Numerique = ['Number of columns in the maze (between 2 and 8 or 1 if you leave it to chance)', 8]\n} // Fin de l'exercice.\n"],"names":["dateDePublication","titre","uuid","ref","ExerciceLabyrinthePremiers3e","Exercice","nbPremiers","nbMax","texte","texteCorr","laby","monChemin","q","nbL","randint","nbC","labyrinthe","choice","miseEnEvidence","bonnesReponses","combinaisonListes","mauvaisesReponses","_","i","number","params","mathalea2d","listeQuestionsToContenu"],"mappings":"gIAMY,MAACA,EAAoB,aACpBC,EAAQ,8BAKRC,EAAO,QACPC,EAAM,SACJ,SAASC,GAAgC,CACtDC,EAAS,KAAK,IAAI,EAClB,KAAK,MAAQJ,EACb,KAAK,SAAW,GAChB,KAAK,YAAc,EACnB,KAAK,OAAS,EACd,KAAK,WAAa,EAClB,KAAK,kBAAoB,GACzB,KAAK,oBAAsB,GAC3B,KAAK,IAAM,EACX,KAAK,KAAO,EACZ,KAAK,KAAO,EACZ,KAAK,KAAO,EAEZ,KAAK,gBAAkB,UAAY,CAEjC,IAAIK,EAAa,CAAE,EACfC,EACJ,OAAQ,KAAK,IAAG,CACd,IAAK,GACHD,EAAa,CAAC,EAAG,EAAG,EAAG,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GA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