jlchris
Messages postés3Date d'inscriptionmercredi 7 septembre 2022StatutMembreDernière intervention 8 septembre 2022
-
7 sept. 2022 à 16:50
jlchris
Messages postés3Date d'inscriptionmercredi 7 septembre 2022StatutMembreDernière intervention 8 septembre 2022
-
8 sept. 2022 à 16:59
Bonjour,
J'essaye de construire un code pour definir à partir d'une date de naissance l'ensemble des signe du zodiaque du monde, occidentale, chinois, celtique, africain, créole....
Malheureusement, je me retrouve bloqué et mon code ne veux pas fonctionner.
Je dois faire une erreur, mais où ? Je suis débutant.
Je vous remercie si quelqu'un peut m'aider.
Cordialement
voici mon code :
<html>
<head>
<title>Quel est votre signe </title>
<script type="text/javascript">
function signs() {
var start = 1901, birthyear = document.zodiac.year.value, date=document.zodiac.date.value, month=document.zodiac.month.selectedIndex;
with (document.zodiac.sign){
if (month == 1 && date >=20 || month == 2 && date <=18) {value = "Verseau";}
if (month == 1 && date > 31) {value = "Hein ?";}
if (month == 2 && date >=19 || month == 3 && date <=20) {value = "Poissons";}
if (month == 2 && date > 29) {value = "Vous dites ?";}
if (month == 3 && date >=21 || month == 4 && date <=19) {value = "Bélier";}
if (month == 3 && date > 31) {value = "Comme vous voulez.";}
if (month == 4 && date >=20 || month == 5 && date <=20) {value = "Taureau";}
if (month == 4 && date > 30) {value = "Je suis vraiment désolé !";}
if (month == 5 && date >=21 || month == 6 && date <=21) {value = "Gémeaux";}
if (month == 5 && date > 31) {value = "Euh... non.";}
if (month == 6 && date >=22 || month == 7 && date <=22) {value = "Cancer";}
if (month == 6 && date > 30) {value = "Désolé.";}
if (month == 7 && date >=23 || month == 8 && date <=22) {value = "Lion";}
if (month == 7 && date > 31) {value = "Pardon ?";}
if (month == 8 && date >=23 || month == 9 && date <=22) {value = "Vièrge";}
if (month == 8 && date > 31) {value = "C'est ça.";}
if (month == 9 && date >=23 || month == 10 && date <=22) {value = "Balance";}
if (month == 9 && date > 30) {value = "Essaie encore.";}
if (month == 10 && date >=23 || month == 11 && date <=21) {value = "Scorpion";}
if (month == 10 && date > 31) {value = "N'y pense même pas !";}
if (month == 11 && date >=22 || month == 12 && date <=21) {value = "Sagittaire";}
if (month == 11 && date > 30) {value = "Date invalide";}
if (month == 12 && date >=22 || month == 1 && date <=19) {value = "Capricorne";}
if (month == 12 && date > 31) {value = "Aucune chance !";}}
x = (start - birthyear) % 12
with (document.zodiac.csign){
if (x == 1 || x == -11) {value = "Rat";}
if (x == 0) {value = "Ox";}
if (x == 11 || x == -1) {value = "Tigre";}
if (x == 10 || x == -2) {value = "Lapin";}
if (x == 9 || x == -3) {value = "Dragon";}
if (x == 8 || x == -4) {value = "Serpent";}
if (x == 7 || x == -5) {value = "Cheval";}
if (x == 6 || x == -6) {value = "Mouton";}
if (x == 5 || x == -7) {value = "Singe";}
if (x == 4 || x == -8) {value = "Coq";}
if (x == 3 || x == -9) {value = "Chien";}
if (x == 2 || x == -10) {value = "Cochon";}
with (document.zodiac.dsign){
if (month == 1 && date >=2|| month == 1 && date <=11) {value = "Sapin";}
if (month == 1 && date >=12|| month == 1 && date <=24) {value = "Orme";}
if (month == 1 && date >=25|| month == 2 && date <=3) {value = "Cyprès";}
if (month == 1 && date > 31) {value = "Hein ?";}
if (month == 2 && date >=4|| month == 2 && date <=8) {value = "Peuplier";}
if (month == 2 && date >=9|| month == 2 && date <=18) {value = "Cédre";}
if (month == 2 && date >=19|| month == 2 && date <=28) {value = "Pin";}
if (month == 2 && date > 29) {value = "Vous dites ?";}
if (month == 3 && date >=1|| month == 3 && date <=10) {value = "Saule pleureur";}
if (month == 3 && date >=11|| month == 3 && date <=20) {value = "Tilleul";}
if (month == 3 && date >=21|| month == 3 && date <=21) {value = "Chêne";}
if (month == 3 && date >=22|| month == 3 && date <=31) {value = "Noisetier";}
if (month == 3 && date > 31) {value = "Comme vous voulez.";}
if (month == 4 && date >=1|| month == 4 && date <=10) {value = "Cormier";}
if (month == 4 && date >=11|| month == 4 && date <=20) {value = "Erable";}
if (month == 4 && date >=21|| month == 4 && date <=30) {value = "Noyer";}
if (month == 4 && date > 30) {value = "Je suis vraiment désolé !";}
if (month == 5 && date >=1|| month == 5 && date <=14) {value = "Peuplier";}
if (month == 5 && date >=15|| month == 5 && date <=24) {value = "Châtaignier";}
if (month == 5 && date >=25|| month == 6 && date <=3) {value = "Frêne";}
if (month == 5 && date > 31) {value = "Euh... non.";}
if (month == 6 && date >=4|| month == 6 && date <=13) {value = "Charme de la Caroline";}
if (month == 6 && date >=14|| month == 6 && date <=23) {value = "Figuier";}
if (month == 6 && date >=24|| month == 6 && date <=24) {value = "Bouleau";}
if (month == 6 && date >=25|| month == 7 && date <=4) {value = "Pommier";}
if (month == 6 && date > 30) {value = "Désolé.";}
if (month == 7 && date >=5|| month ==7 && date <=1) {value = "Sapin";}
if (month == 7 && date >=15|| month == 7 && date <=25) {value = "Orme";}
if (month == 7 && date >=26|| month == 8 && date <=4) {value = "Cyprès";}
if (month == 7 && date > 31) {value = "Pardon ?";}
if (month == 8 && date >=5|| month == 8 && date <=13) {value = "Peuplier";}
if (month == 8 && date >=14|| month == 8 && date <=23) {value = "Cèdre";}
if (month == 8 && date >=24|| month == 9 && date <=2) {value = "Pin";}
if (month == 8 && date > 31) {value = "C'est ça.";}
if (month == 9 && date >=3|| month == 9 && date <=12) {value = "Saule pleureur";}
if (month == 9 && date >=13|| month == 9 && date <=22) {value = "Tilleul";}
if (month == 9 && date >=23|| month == 9 && date <=23) {value = "Olivier";}
if (month == 9 && date >=24|| month == 10 && date <=3) {value = "Noisetier";}
if (month == 9 && date > 30) {value = "Essaie encore.";}
if (month == 10 && date >=4|| month == 10 && date <=13) {value = "Cormier";}
if (month == 10 && date >=14|| month == 10 && date <=23) {value = "Erable";}
if (month == 10 && date >=24|| month == 11 && date <=11) {value = "Noyer";}
if (month == 10 && date > 31) {value = "N'y pense même pas !";}
if (month == 11 && date >=12|| month == 11 && date <=21) {value = "Châtaignier";}
if (month == 11 && date >=22|| month == 12 && date <=1) {value = "Frêne";}
if (month == 11 && date > 30) {value = "Date invalide";}
if (month == 12 && date >=2|| month == 12 && date <=11) {value = "Charme de la Caroline";}
if (month == 12 && date >=12|| month == 12 && date <=21) {value = "Figuier";}
if (month == 12 && date >=22|| month == 12 && date <=22) {value = "Hêtre";}
if (month == 12 && date >=23|| month == 1 && date <=1) {value = "Pommier";}
if (month == 12 && date > 31) {value = "Aucune chance !";}}