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
// executable sur repl.it | |
console.log('comment tu t\'appelles ?'); | |
console.read(function(reponseDonnee){ | |
// si : la longueur du texte de la réponse est égale à 0 car. | |
if(reponseDonnee.length === 0){ | |
console.log( "vous n'avez pas répondu" ); | |
} else if(reponseDonnee.length > 10 || reponseDonnee.length < 1) | |
{ | |
console.log( "attention 1 caractères min et 10 car. max"); |
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
/* | |
* executable dans la console js de http://repl.it | |
*/ | |
console.log("Quelle est la couleur du cheval blanc d'Henry IV?"); | |
console.read(function(couleur) | |
{ | |
if(couleur.toLowerCase() === "blanc") | |
{ | |
console.log("Combien sont les 7 nains?"); |
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
/* | |
* à exécuter dans http://repl.it ou remplacer les console.read(...) par des prompts | |
*/ | |
// on tire un chiffre au hasard entre 0 et 9 | |
var hasard = Math.floor(Math.random() * 10); | |
// on demande un chiffre et on recupère la réponse donnée | |
console.log("devinez un chiffre entre 0 et 9"); | |
console.read(function(reponse) |
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
/* | |
* executable dans la console js de http://repl.it | |
*/ | |
console.log("saisiez une operation"); | |
console.read(function(operation){ | |
console.log("choisir un premier nombre") | |
console.read(function(nombre1){ | |
nombre1 = Number(nombre1); | |
console.log("choisir un deuxieme nombre") |
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
/* | |
* executable dans la console js de http://repl.it | |
*/ | |
var mailAttendu = "toto@gmail.com"; | |
var passwordAttendu = "12345"; | |
console.log("Entrer votre identifiant"); | |
console.read(function(mailSaisi){ |
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
// pyramide diese | |
var compteur = 0; | |
var sortie = ''; | |
while( compteur < 10 ){ | |
sortie += '#'; | |
console.log(sortie); | |
compteur++; | |
} | |
// pyramide chiffres |
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
/* | |
* Texte / Chaines de caractères / String | |
* fonctions utiles : indexOf, slice, charAt, toLowerCase | |
* cf. https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/String | |
*/ | |
// longueur | |
var texte = "un texte"; | |
// TODO |
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
var voyelles = "aeiouy"; | |
// la fonction reçoit un caractère en paramètre et doit renvoyer true si le texte contient une voyelle, false sinon | |
function estUneVoyelle( lettre ){ | |
} | |
console.log("estUneVoyelle('f') :", estUneVoyelle('f') ); // false | |
console.log("estUneVoyelle('a') :", estUneVoyelle('a') ); // true | |
console.log("estUneVoyelle() :", estUneVoyelle() ); // false |
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
<!doctype html> | |
<html lang="fr"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<script type="text/javascript"> |
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
<!doctype html> | |
<html lang="fr"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<script> |
OlderNewer