@ -16,6 +16,9 @@ var allDimension = ["4 * 3", "3 * 3", "3 * 2", "2 * 2"];// Défini toutes les di
var selectionMode = 0 ;
var selectionDiemension = 0 ;
var modelangue = false ;
var lesPoints = 0 ; //Points du Joueur1
function majSizeCard ( column ) {
@ -1476,7 +1479,13 @@ function decompte() {
}
if ( cpt == 0 ) {
if ( ! modelangue ) {
window . alert ( "fin du jeu" ) ;
}
else {
window . alert ( "Game Over" ) ;
}
retour ( ) ;
window . location . reload ( ) ;
clearInterval ( itv ) ;
@ -1507,10 +1516,22 @@ function testerLesCartes() {
function testPourJeuInfini ( ) {
try {
if ( carteselect . length == 0 ) {
if ( ! modelangue ) {
window . alert ( "Selection Vide" ) ;
}
else {
window . alert ( "Empty selection" ) ;
}
return ;
} else if ( carteselect . length < 2 ) {
if ( ! modelangue ) {
window . alert ( "Selection Trop Petite" ) ;
}
else {
window . alert ( "Selection Too Small" ) ;
}
return ;
} else {
var copie = [ ] ;
@ -1539,11 +1560,22 @@ function testPourJeuInfini() {
}
}
if ( solution ) {
if ( ! modelangue ) {
document . getElementById ( "affSolution" ) . textContent = 'Aucune solution trouvée...' ;
}
else {
document . getElementById ( "affSolution" ) . textContent = 'No solutions found...' ;
}
}
if ( ! solution ) {
if ( ! modelangue ) {
document . getElementById ( "affSolution" ) . textContent = 'Assemblage de ' + copie . length + ' cartes trouvé !' ;
}
else {
document . getElementById ( "affSolution" ) . textContent = 'Assembly of ' + copie . length + ' cards found !' ;
}
}
}
} catch ( e ) {
window . alert ( e ) ;
@ -1555,10 +1587,22 @@ function testPourJeuInfini() {
function testPourJeuClassique ( ) {
//try {
if ( carteselect . length == 0 ) {
if ( ! modelangue ) {
window . alert ( "Selection Vide test pour jeu classique" ) ;
}
else {
window . alert ( "Selection Empty test for classic game" ) ;
}
return ;
} else if ( carteselect . length < 2 ) {
if ( ! modelangue ) {
window . alert ( "Selection Trop Petite" ) ;
}
else {
window . alert ( "Selection Too Small" ) ;
}
return ;
} else {
var copie = [ ] ;
@ -1582,11 +1626,21 @@ function testPourJeuClassique() {
}
}
if ( solution ) {
if ( ! modelangue ) {
document . getElementById ( "affSolution" ) . textContent = 'Aucune solution trouvée...' ;
}
else {
document . getElementById ( "affSolution" ) . textContent = 'No solutions found...' ;
}
}
if ( ! solution ) {
if ( ! modelangue ) {
document . getElementById ( "affSolution" ) . textContent = 'Assemblage de ' + copie . length + ' cartes trouvé ! Il reste encore ' + TasDuJEU . length + ' cartes !' ;
}
else {
document . getElementById ( "affSolution" ) . textContent = 'Assembly of ' + copie . length + ' cards found ! There are still ' + TasDuJEU . length + ' cards !' ;
}
}
}
/ * } c a t c h ( e ) {
window . alert ( e ) ;
@ -1823,21 +1877,88 @@ function bacASable() {
afficherCartes ( lesCartes ) ;
}
function functionLange ( ) {
if ( lange % 2 == 0 )
{
document . getElementById ( "flag_top" ) . classList . add ( "transparent" ) ;
} else {
document . getElementById ( "flag_top" ) . classList . remove ( "transparent" ) ;
/ * f u n c t i o n f u n c t i o n L a n g e ( ) {
if ( lange % 2 == 0 ) {
//mode anglais
document . getElementById ( 'flag_top' ) . src = "imgs/flags/flag-uk.png" ;
document . getElementById ( 'textjouer' ) . value = "PLAY" ;
}
lange = lange + 1 ;
else {
//mode français
document . getElementById ( 'flag_top' ) . src = "imgs/flags/flag-france.png" ;
document . getElementById ( 'textjouer' ) . value = "JOUER" ;
}
lange += 1 ;
} * /
function functionLange ( ) {
//window.alert(modelangue);
if ( modelangue ) {
modelangue = false ;
//MODE FRANCAIS =======
document . getElementById ( 'flag_top' ) . src = "imgs/flags/flag-france.png" ;
document . getElementById ( 'textjouer' ) . textContent = 'JOUER' ;
//Traduction classement
document . getElementById ( 'classementtxt' ) . textContent = 'Classement - solo' ;
document . getElementById ( 'premier' ) . textContent = '1er' ;
document . getElementById ( 'deuxieme' ) . textContent = '2e' ;
document . getElementById ( 'troisieme' ) . textContent = '3e' ;
//Traduction paramètres
document . getElementById ( 'SettingName' ) . textContent = 'Paramètres' ;
function trad ( ) {
var flag _top = document . getElementById ( "flag_top" ) ;
var flag _bottom = document . getElementById ( "flag_bottom" ) ;
document . getElementById ( 'textmode' ) . textContent = 'Match à points' ;
//Tradcution des règles
document . getElementById ( 'lesRegles' ) . textContent = 'Les Règles' ;
document . getElementById ( 'textRules' ) . textContent = 'Swish : Jeu de 60 cartes composé chacun de billes et de cerceaux, de 4 couleurs différentes possibles. 16 cartes sont posés sur une table et le joueur doit faire superposer des cartes de manière que chaque bille soit dans le cerceau de même couleur d’ une autre carte.' ;
}
else {
modelangue = true ;
//MODE ANGLAIS ========
document . getElementById ( 'flag_top' ) . src = "imgs/flags/flag-uk.png" ;
document . getElementById ( 'textjouer' ) . textContent = 'PLAY' ;
//Traduction classement
document . getElementById ( 'classementtxt' ) . textContent = 'Ranking - solo' ;
document . getElementById ( 'premier' ) . textContent = '1st' ;
document . getElementById ( 'deuxieme' ) . textContent = '2nd' ;
document . getElementById ( 'troisieme' ) . textContent = '3rd' ;
//Traduction paramètres
document . getElementById ( 'SettingName' ) . textContent = 'Settings' ;
document . getElementById ( 'textmode' ) . textContent = 'Point match' ;
//Traduction des règles
document . getElementById ( 'lesRegles' ) . textContent = 'The Rules' ;
document . getElementById ( 'textRules' ) . textContent = 'Swish : Set of 60 cards each composed of balls and hoops, 4 different colors possible. 16 cards are placed on a table and the player has to lay cards on top of each other in such a way that each ball is in the same color hoop as another card.'
}
}
/ * f u n c t i o n t r a d ( ) {
//var flag_top = document.getElementById("flag_top");
//var flag_bottom = document.getElementById("flag_bottom");
mode = mode + 1 ;
if ( mode % 2 == 0 ) {
}
else {
}
} * /