first commit with existing project files

This commit is contained in:
Vincent Guillet
2025-04-02 11:33:15 +02:00
parent f447ea8a0f
commit c8e200b42f
18 changed files with 515 additions and 0 deletions

17
algo_js/nombre_cache.js Normal file
View File

@@ -0,0 +1,17 @@
const prompt = require('prompt-sync')();
// Deviner le nombre caché
let nombreCache = Math.floor(Math.random() * 100);
let propostion = parseInt(prompt("Devinez le nombre caché entre 1 et 100 :"));
while (propostion != nombreCache) {
if (propostion < nombreCache) console.log("C'est plus grand !");
else if (propostion > nombreCache) console.log("C'est plus petit !");
propostion = prompt("Réessayez :");
}
if (propostion == nombreCache) console.log("Bravo ! Vous avez deviné le nombre caché !");