zouhair GenerationX
Nombre de messages : 44 Localisation : C:\CASA\Alsace_lorraine.exe Date d'inscription : 31/01/2007
| Sujet: buuf petit code Dim 4 Fév - 11:12 | |
| Voila mon petit code espérant qui vous donne d'autre aidé pour faire d’autres choses,j'ai pris la version de mon javascript pour PC, j'ai réduit l'écran, et hop, c'est bon pour mon PDA. Attention, ce n'est qu'une aide pour remplir une grille, ça ne donne pas la solution. Mais cela évite les barbouillages sur les grilles trouvées dans la presse. ---- - Code:
-
<html> <head> <title>Created By zouhair</title> <meta> <script> function Zouhair_Begin() { jeusol=0; return; } function ZHR_Choixjeu(jeu) {jeusol=jeu; tabjeu.elements[jeusol].style.backgroundColor="aqua"; if (jeu!=jeuprec) {tabjeu.elements[jeuprec].style.backgroundColor="yellow"; jeuprec=jeusol}; for (i=0; i<9; i++) {tabsol.elements[i].style.backgroundColor="lime"}; if (jeusol<9) nolig=0; else if (jeusol<18) nolig=1; else if (jeusol<27) nolig=2; else if (jeusol<36) nolig=3; else if (jeusol<45) nolig=4; else if (jeusol<54) nolig=5; else if (jeusol<63) nolig=6; else if (jeusol<72) nolig=7; else nolig=8; nocol=(jeusol-(nolig*9)); if (nolig<3) cary=0; else if (nolig<6) cary=3; else cary=6; if (nocol<3) carx=0; else if (nocol<6) carx=3; else carx=6; for (i=0; i<9; i++) {if (tbsolu[nolig][i] != 0) {pris=tbsolu[nolig][i]; pris--; tabsol.elements[pris].style.backgroundColor="red"}; }; for (i=0; i<9; i++) {if (tbsolu[i][nocol] != 0) {pris=tbsolu[i][nocol]; pris--;tabsol.elements[pris].style.backgroundColor="red"}; }; maxx=(carx + 3);maxy=(cary + 3); for (y=cary; y<maxy; y++) {for (x=carx; x<maxx; x++) {if (tbsolu[y][x] != 0) {pris=tbsolu[y][x]; pris--;tabsol.elements[pris].style.backgroundColor="red"}; }; }; return; } function ZHR_Choixsol(sol) {tabjeu.elements[jeusol].value=sol; tbsolu[nolig][nocol]=sol; for (i=0; i<9; i++) {tabsol.elements[i].style.backgroundColor="lime"}; return; } function rabcase() {tabjeu.elements[jeusol].value=" "; tbsolu[nolig][nocol]=0; return; } function rabligne() {deblig=(nolig*9);finlig=(deblig+9); for (i=0; i<9; i++) tbsolu[nolig][i]=0; for (i=deblig; i<finlig; i++) tabjeu.elements[i].value=" "; return; } function rabcolonne() {debcol=nocol;fincol=(nocol+81); for (i=0; i<9; i++) tbsolu[i][nocol]=0; for (i=debcol; i<fincol; i=i+9) tabjeu.elements[i].value=" "; return; } function rabcarre() {for (y=cary; y<maxy; y++) {for (x=carx; x<maxx; x++) tbsolu[y][x]=0}; deblig=(carx+(cary*9));finlig=(deblig+3); for (i=deblig; i<finlig; i++) tabjeu.elements[i].value=" "; deblig=(deblig+9);finlig=(deblig+3); for (i=deblig; i<finlig; i++) tabjeu.elements[i].value=" "; deblig=(deblig+9);finlig=(deblig+3); for (i=deblig; i<finlig; i++) tabjeu.elements[i].value=" "; return; } function valider() {topano=0; for (i=0; i<9; i++) {cumsolu=0; for (j=0; j<9; j++) {cumsolu=(cumsolu + tbsolu[i][j])}; if (cumsolu != 45) {topano=1; nolig=(i+1); alert("numéro de la ligne en anomalie : " + nolig)}; }; for (i=0; i<9; i++) {cumsolu=0; for (j=0; j<9; j++) {cumsolu=(cumsolu + tbsolu[j][i])}; if (cumsolu != 45) {topano=1; nocol=(i+1); alert("numéro de la colonne en anomalie : " + nocol)}; }; for (k=0; k<9; k=k+3) {cumsolu=0; for (i=0; i<3; i++) {for (j=(k+0); j<(k+3); j++) cumsolu=(cumsolu + tbsolu[i][j]); }; if (cumsolu != 45) {topano=1; nolig=(i-2);nocol=(j-2);alert("carré en anomalie pour ligne " + nolig + " et colonne " + nocol)}; cumsolu=0; for (i=3; i<6; i++) {for (j=(k+0); j<(k+3); j++) cumsolu=(cumsolu + tbsolu[i][j]); }; if (cumsolu != 45) {topano=1; nolig=(i-2);nocol=(j-2);alert("carré en anomalie pour ligne " + nolig + " et colonne " + nocol)}; cumsolu=0; for (i=6; i<9; i++) { for (j=(k+0); j<(k+3); j++) cumsolu=(cumsolu + tbsolu[i][j]); }; if (cumsolu != 45) {topano=1; nolig=(i-2);nocol=(j-2);alert("carré en anomalie pour ligne " + nolig + " et colonne " + nocol)}; }; if (topano==0) alert("Bravo ! Grille OK"); return; } function kesaco() {alert ("Buuf c'est un jeu très récent. La grille contient 9 carrés de 9 cases. Chaque carré doit utiliser tous les chiffres de 1 à 9. De plus, chaque ligne horizontale et chaque colonne verticale doivent, elles aussi, utiliser tous les chiffres de 1 à 9."); alert ("Ce script vous sert à concevoir des grilles. Quand celle-ci est validée vous pouvez alors créer votre partie. Selon le niveau de difficulté souhaité vous pré-remplissez entre 20 et 40 cases sur une grille vierge. Ensuite le joueur adverse devra déduire les autres cases, avec patience et logique."); alert ("Des questions ? n'hésitez pas a me contacter par E-mail: ibnabdeljalil@gmail.com , vous êtes tous les bienvenues :)"); } function modemploi() {alert ("Pour vous positionner sur la grille : cliquez sur une case jaune, elle devient bleue. Pour y mettre un chiffre : sélectionnez-le dans la rangée chiffrée. Celle-ci vous affiche en vert les chiffres possibles, et en rouge les chiffres déjà utilisés dans le carré, la ligne et la colonne."); alert ("Si vous souhaitez recommencer une partie de votre grille vous pouvez remettre à blanc une case, une ligne, une colonne ou un carré. Quand la grille est entièrement remplie validez-la. Si une erreur est détectée, un message vous en donnera l'origine. Bon courage."); } //Z_Variables jeu=0;sol=0;jeusol=0;nolig=0;nocol=0;pris=0;carx=0;cary=0;deblig=0;finlig=0;jeuprec=0;cumsolu=0;topano=0; //Z_Table des solutions tbsolu = new Array();tbsolu[0] = new Array(); tbsolu[1] = new Array();tbsolu[2] = new Array();tbsolu[3] = new Array();tbsolu[4] = new Array(); tbsolu[5] = new Array();tbsolu[6] = new Array();tbsolu[7] = new Array();tbsolu[8] = new Array(); tbsolu[0][0] = 0;tbsolu[0][1] = 0;tbsolu[0][2] = 0;tbsolu[0][3] = 0;tbsolu[0][4] = 0;tbsolu[0][5] = 0;tbsolu[0][6] = 0;tbsolu[0][7] = 0;tbsolu[0][8] = 0; tbsolu[1][0] = 0;tbsolu[1][1] = 0;tbsolu[1][2] = 0;tbsolu[1][3] = 0;tbsolu[1][4] = 0;tbsolu[1][5] = 0;tbsolu[1][6] = 0;tbsolu[1][7] = 0;tbsolu[1][8] = 0; tbsolu[2][0] = 0;tbsolu[2][1] = 0;tbsolu[2][2] = 0;tbsolu[2][3] = 0;tbsolu[2][4] = 0;tbsolu[2][5] = 0;tbsolu[2][6] = 0;tbsolu[2][7] = 0;tbsolu[2][8] = 0; tbsolu[3][0] = 0;tbsolu[3][1] = 0;tbsolu[3][2] = 0;tbsolu[3][3] = 0;tbsolu[3][4] = 0;tbsolu[3][5] = 0;tbsolu[3][6] = 0;tbsolu[3][7] = 0;tbsolu[3][8] = 0; tbsolu[4][0] = 0;tbsolu[4][1] = 0;tbsolu[4][2] = 0;tbsolu[4][3] = 0;tbsolu[4][4] = 0;tbsolu[4][5] = 0;tbsolu[4][6] = 0;tbsolu[4][7] = 0;tbsolu[4][8] = 0; tbsolu[5][0] = 0;tbsolu[5][1] = 0;tbsolu[5][2] = 0;tbsolu[5][3] = 0;tbsolu[5][4] = 0;tbsolu[5][5] = 0;tbsolu[5][6] = 0;tbsolu[5][7] = 0;tbsolu[5][8] = 0; tbsolu[6][0] = 0;tbsolu[6][1] = 0;tbsolu[6][2] = 0;tbsolu[6][3] = 0;tbsolu[6][4] = 0;tbsolu[6][5] = 0;tbsolu[6][6] = 0;tbsolu[6][7] = 0;tbsolu[6][8] = 0; tbsolu[7][0] = 0;tbsolu[7][1] = 0;tbsolu[7][2] = 0;tbsolu[7][3] = 0;tbsolu[7][4] = 0;tbsolu[7][5] = 0;tbsolu[7][6] = 0;tbsolu[7][7] = 0;tbsolu[7][8] = 0; tbsolu[8][0] = 0;tbsolu[8][1] = 0;tbsolu[8][2] = 0;tbsolu[8][3] = 0;tbsolu[8][4] = 0;tbsolu[8][5] = 0;tbsolu[8][6] = 0;tbsolu[8][7] = 0;tbsolu[8][8] = 0; </script> <style> <BoutonSol> </style> </head>
Dernière édition par le Dim 4 Fév - 11:43, édité 2 fois | |
|
zouhair GenerationX
Nombre de messages : 44 Localisation : C:\CASA\Alsace_lorraine.exe Date d'inscription : 31/01/2007
| Sujet: Re: buuf petit code Dim 4 Fév - 11:16 | |
| La suite: - Code:
-
<!--<body> <center><big><big><font color="red">B</font>y GenerationX 2007</big></big></center> <form> <table width="150px" bgcolor="#000000" rules="none" align="center" border="2" cellspacing="0"> <tr> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td></tr> <tr> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td></tr> <tr> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td></tr> <tr><td height="3px"></td></tr> <tr> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td></tr> <tr> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td></tr> <tr> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td></tr> <tr><td height="3px"></td></tr> <tr> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td></tr> <tr> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td></tr> <tr> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td></tr> </table></form> <form>
| |
|
zouhair GenerationX
Nombre de messages : 44 Localisation : C:\CASA\Alsace_lorraine.exe Date d'inscription : 31/01/2007
| Sujet: Re: buuf petit code Dim 4 Fév - 11:19 | |
| La suite: - Code:
-
<table width="150px" bgcolor="black" rules="none" align="center" border="2" cellspacing="0"> <tr> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="3px"></td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td> <td width="15px" align="center"> <input> </td></tr> </table></form> <form> <table width="150px" bgcolor="#000033" rules="none" align="center" border="2" cellspacing="0"> <tr> <td width="150px" align="center" colspan="4"> <div class="logo"> Remise à blancs </div></td> </tr> <tr> <td width="32px" align="center" colspan="1"> <input> </td> <td width="36px" align="center" colspan="1"> <input> </td> <td width="46px" align="center" colspan="1"> <input> </td> <td width="36px" align="center" colspan="1"> <input> </td> </tr> <tr> <td width="150px" align="center" colspan="4"> <div class="logo"> Quand la grille est remplie </div></td> </tr> <tr> <td width="150px" align="center" colspan="4"> <input> </td> </tr> <tr> <td width="150px" align="center" colspan="4"> <div class="logo"> Quelques précisions </div></td> </tr> <tr> <td width="75px" align="center" colspan="2"> <input> </td> <td width="75px" align="center" colspan="2"> <input> </td> </tr> <tr> <td width="150px" align="center" colspan="4"> <div class="logo"> Copyright Zouhair GenerationX 2007 </div></td> </tr> </table></form> </body></html> --> ---- Un lien si tu veux télécharger le fichier | |
|
Contenu sponsorisé
| Sujet: Re: buuf petit code | |
| |
|