Tirage de 3 chiffres au hasard
Fermé
gen
-
9 nov. 2008 à 22:42
CrazyWorld Messages postés 326 Date d'inscription samedi 8 novembre 2008 Statut Membre Dernière intervention 16 février 2013 - 9 nov. 2008 à 23:31
CrazyWorld Messages postés 326 Date d'inscription samedi 8 novembre 2008 Statut Membre Dernière intervention 16 février 2013 - 9 nov. 2008 à 23:31
A voir également:
- Tirage de 3 chiffres au hasard
- Picasa 3 - Télécharger - Albums photo
- Combien de combinaison possible avec 3 chiffres - Forum loisirs/vie pratique
- Probabilité nombre de combinaison de trois chiffres de 0 à 9 ✓ - Forum Loisirs / Divertissements
- Tous les code possible de 1 à 9 (4 chiffres ) - Forum Programmation
- Combinaisons possibles avec 3 séries de 3 nombres - Forum Réseaux sociaux
2 réponses
CrazyWorld
Messages postés
326
Date d'inscription
samedi 8 novembre 2008
Statut
Membre
Dernière intervention
16 février 2013
41
9 nov. 2008 à 22:57
9 nov. 2008 à 22:57
Hello
essaye d' utiliser un truc du genre
essaye d' utiliser un truc du genre
<script> function chiffreAleatoire (){ var nb1 = Math.floor(Math.random() * 10); var nb2 = Math.floor(Math.random() * 10); var nb3 = Math.floor(Math.random() * 10); alert(nb1); alert(nb2); alert(nb3); } chiffreAleatoire (); </script>
CrazyWorld
Messages postés
326
Date d'inscription
samedi 8 novembre 2008
Statut
Membre
Dernière intervention
16 février 2013
41
9 nov. 2008 à 23:31
9 nov. 2008 à 23:31
Je viens de te modifier ta source en utlisant du php à la place du JavaSvcript
Et ca marche ^^
<? mt_srand((float) microtime()*1000000); $nb1= mt_rand(0, 9); $nb2= mt_rand(0, 9); $nb3= mt_rand(0, 9); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <LINK HREF="Base.CSS" REL="stylesheet" TYPE="text/css"> <title>Tp2 IFT1144, numéro 1 </title> </head> <body> <table border=0 cellspacing=0 cellpadding=10 cols=2 width="92%"> <tr> <td width="1%"> <img border="0" src="UMlogo.gif" width="110" height="50" alt="UdeM"></a></td> </td> <td width="100%"><h1> ift1144, tp2 numéro 1 </h1> </td> </tr> <tr> </tr> </table> <table border=0 cellspacing=0 cellpadding=10 cols=4 width="100%"> <tr> </tr> <tr> <td width="1%"> </td> <td width="99%"><h2> Tirage de la Quotidienne 3 chiffres </h2> </td> </tr> </table> <table border="1" width="50%" align="center"> <tr> <td align="center"><? echo $nb1;?></td> <td align="center"><? echo $nb2;?></td> <td align="center"><? echo $nb3;?></td> </tr> </table> <br> <br><h3>Travail effectué par: Geneviève Hénault</h3> </body> </html>
Et ca marche ^^
9 nov. 2008 à 23:09
9 nov. 2008 à 23:10
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<LINK HREF="Base.CSS" REL="stylesheet" TYPE="text/css">
<title>Tp2 IFT1144, numéro 1
</title>
</head>
<body>
<table border=0 cellspacing=0 cellpadding=10 cols=2 width="92%">
<tr>
<td width="1%">
<img border="0" src="UMlogo.gif" width="110" height="50" alt="UdeM"></a></td>
</td>
<td width="100%"><h1> ift1144, tp2 numéro 1 </h1>
</td>
</tr>
<tr>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=10 cols=4 width="100%">
<tr>
</tr>
<tr>
<td width="1%">
</td>
<td width="99%"><h2> Tirage de la Quotidienne 3 chiffres </h2>
</td>
</tr>
</table>
<script>
function chiffreAleatoire (max){
var nb1 = Math.floor(Math.random() * 10);
var nb2 = Math.floor(Math.random() * 10);
var nb3 = Math.floor(Math.random() * 10);
}
nb1 = chiffreAleatoire(9);
nb2 = chiffreAleatoire(9);
nb3 = chiffreAleatoire(9);
</script>
<body>
<table border="1" width="50%" align="center">
<tr>
<td align="center"> <script>document.write(nb1)</script></td>
<td align="center"> <script>document.write(nb2)</script></td>
<td align="center"> <script>document.write(nb3)</script></td>
</tr>
</table>
<br>
<br><h3>Travail effectué par: Geneviève Hénault</h3>
</body>
</html>