Created
December 1, 2018 13:45
-
-
Save JProure07200/74459068663603ecba1b8444b4984c01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 + "."); | |
} | |
} |
voila ma solution:
https://gist.github.com/fix/6e0f845340296ea35810a43bd2acfab5
<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>
Voila voila.
Zut je refait
J'ai rien dit il n'y à rien à ouvrir
peux-tu m'envoyer le source code directement?
`
<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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fx