Skip to content

Instantly share code, notes, and snippets.

@JProure07200
Created December 1, 2018 13:45
Show Gist options
  • Save JProure07200/74459068663603ecba1b8444b4984c01 to your computer and use it in GitHub Desktop.
Save JProure07200/74459068663603ecba1b8444b4984c01 to your computer and use it in GitHub Desktop.
window.alert ("Bienvenue dans ce jeu de devinette !");
function solution = Math.floor(Math.random(1 < 100) * 100) + 1;
window.alert("La solution est " + solution + ".");
function NombreEssai = NombreEssai;
for (NombreEssai = 6; NombreEssai <= 6; NombreEssai++) {
window.alert proposition = Number(prompt("Proposer un chiffre entre 1 et 100"));
if (proposition === solution) {
window.alert("Bravo, la solution est " + solution + "Vous avez trouvé en " + NombreEssai + "essai(s)");
break;
} if (proposition < solution) {
console.log(proposition + "est trop petit");
} if (proposition > solution) {
window.alert(proposition + "est trop grand");
} else {
window.alert("Vous avez perdu...La solution était " + solution + ".");
}
}
@JProure07200
Copy link
Author

code01
code02
code03
à ouvrir dans l'ordre code01, code02 et code03. J'ai laissé les lignes sur les captures d'écran mais normalement il n'y àpas deux fois la même ligne.
JP

@JProure07200
Copy link
Author

J'ai rien dit il n'y à rien à ouvrir

@fix
Copy link

fix commented Dec 12, 2018

peux-tu m'envoyer le source code directement?

@JProure07200
Copy link
Author

JProure07200 commented Dec 12, 2018

`

<title>Sapin de noël</title> <script> var canv1 = document.getElementById('mon_canvas'); var context1 = canv1.getContext('2d'); var monimage = new Image(); monimage.onload = function() { context1.drawImage(monimage, 135, 35, 600, 590); } </script>
<script type="text/javascript"> context1.strokeStyle = "red"; context1.fillStyle = "red"; context1.beginPath(); context1.arc(500, 200, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "purple"; context1.fillStyle = "purple"; context1.beginPath(); context1.arc(520, 270, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "yellow"; context1.fillStyle = "yellow"; context1.beginPath(); context1.arc(460, 300, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "pink"; context1.fillStyle = "pink"; context1.beginPath(); context1.arc(545, 340, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "cyan"; context1.fillStyle = "cyan"; context1.beginPath(); context1.arc(440, 380, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "blue"; context1.fillStyle = "blue"; context1.beginPath(); context1.arc(500, 410, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "red"; context1.fillStyle = "red"; context1.beginPath(); context1.arc(500, 410, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "gold"; context1.fillStyle = "gold"; context1.beginPath(); context1.arc(450, 480, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "burgundy red"; context1.fillStyle = "burgundy red"; context1.beginPath(); context1.arc(570, 490, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "pink"; context1.fillStyle = "pink"; context1.beginPath(); context1.arc(430, 590, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "orange"; context1.fillStyle = "orange"; context1.beginPath(); context1.arc(560, 620, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "cyan"; context1.fillStyle = "cyan"; context1.beginPath(); context1.arc(500, 690, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "red"; context1.fillStyle = "red"; context1.beginPath(); context1.arc(350, 720, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "purple"; context1.fillStyle = "purple"; context1.beginPath(); context1.arc(420, 750, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "yellow"; context1.fillStyle = "yellow"; context1.beginPath(); context1.arc(620, 730, 10, 0, Math.PI*2 ); context1.fill(); context1.strokeStyle = "red"; context1.fillStyle = "red"; context1.beginPath(); context1.arc(500, 550, 10, 0, Math.PI*2 ); context1.fill(); </script> ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment