|
|
|
@ -391,7 +391,7 @@ var Game = {
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
success: function (data) {
|
|
|
|
|
self.cardsHS4 = data;
|
|
|
|
|
//self.existingHyperSet4();
|
|
|
|
|
self.existingHyperSet4();
|
|
|
|
|
self.displayCardsHS4.call(self);
|
|
|
|
|
self.setCardListenersHS4();
|
|
|
|
|
}
|
|
|
|
@ -823,7 +823,7 @@ var Game = {
|
|
|
|
|
self.$boardHS3.append(cardNode);
|
|
|
|
|
|
|
|
|
|
// display 4 cards per row
|
|
|
|
|
if ((index+1) % 6 === 0) {
|
|
|
|
|
if ((index+1) % 8 === 0) {
|
|
|
|
|
self.$boardHS3.append($('<div>'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2700,15 +2700,6 @@ var Game = {
|
|
|
|
|
},*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
testGeneration16Cartes: function(arr){
|
|
|
|
|
var unique = [];
|
|
|
|
|
$.each(arr, function(i, el){
|
|
|
|
|
if($.inArray(el, unique) === -1) unique.push(el);
|
|
|
|
|
});
|
|
|
|
|
return unique.length;
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
generer16Cartes: function(colors, shapes, fills, numbers, allCards){
|
|
|
|
|
var i = 0;
|
|
|
|
|
var possibleCards = [];
|
|
|
|
@ -3287,7 +3278,6 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var a = 0; a < allCards.length; a++) {
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors1[0] === colorsall[a] && fills1[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
card1.push({
|
|
|
|
@ -3297,7 +3287,6 @@ var Game = {
|
|
|
|
|
border: borders1[0],
|
|
|
|
|
number: numbers1[0]
|
|
|
|
|
});
|
|
|
|
|
console.log(card1);
|
|
|
|
|
possibleCards[i] = card1;
|
|
|
|
|
i = i + 1;
|
|
|
|
|
}
|
|
|
|
@ -3342,7 +3331,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors1[0] === colorsall[a] && fills1[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (borders2[0] !== undefined) {
|
|
|
|
|
card4.push({
|
|
|
|
|
card5.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3355,7 +3344,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors1[0] === colorsall[a] && fills1[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (numbers2[0] !== undefined) {
|
|
|
|
|
card5.push({
|
|
|
|
|
card6.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3370,7 +3359,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors1[0] === colorsall[a] && fills1[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (borders2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card6.push({
|
|
|
|
|
card7.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3383,7 +3372,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors1[0] === colorsall[a] && fills2[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (fills2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card7.push({
|
|
|
|
|
card8.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3396,7 +3385,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors1[0] === colorsall[a] && fills1[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (shapes2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card7.push({
|
|
|
|
|
card9.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3409,7 +3398,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors2[0] === colorsall[a] && fills1[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card7.push({
|
|
|
|
|
card10.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3424,7 +3413,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors1[0] === colorsall[a] && fills2[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (fills2[0] !== undefined && borders2[0] !== undefined) {
|
|
|
|
|
card7.push({
|
|
|
|
|
card11.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3437,7 +3426,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors1[0] === colorsall[a] && fills1[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (shapes2[0] !== undefined && borders2[0] !== undefined) {
|
|
|
|
|
card7.push({
|
|
|
|
|
card12.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3450,7 +3439,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors2[0] === colorsall[a] && fills1[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && borders2[0] !== undefined) {
|
|
|
|
|
card7.push({
|
|
|
|
|
card13.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3465,7 +3454,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors1[0] === colorsall[a] && fills2[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (shapes2[0] !== undefined && fills2[0] !== undefined) {
|
|
|
|
|
card7.push({
|
|
|
|
|
card14.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3478,7 +3467,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors2[0] === colorsall[a] && fills2[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (fills2[0] !== undefined && colors2[0] !== undefined) {
|
|
|
|
|
card7.push({
|
|
|
|
|
card15.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3492,7 +3481,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors2[0] === colorsall[a] && fills1[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && shapes2[0] !== undefined) {
|
|
|
|
|
card7.push({
|
|
|
|
|
card16.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3507,7 +3496,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors2[0] === colorsall[a] && fills2[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && shapes2[0] !== undefined && fills2[0] !== undefined) {
|
|
|
|
|
card13.push({
|
|
|
|
|
card17.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3520,7 +3509,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors2[0] === colorsall[a] && fills1[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && shapes2[0] !== undefined && borders2[0] !== undefined) {
|
|
|
|
|
card14.push({
|
|
|
|
|
card18.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3534,7 +3523,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors2[0] === colorsall[a] && fills1[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && shapes2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card14.push({
|
|
|
|
|
card19.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3547,7 +3536,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors2[0] === colorsall[a] && fills2[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && fills2[0] !== undefined && borders2[0] !== undefined) {
|
|
|
|
|
card15.push({
|
|
|
|
|
card20.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3560,7 +3549,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors2[0] === colorsall[a] && fills2[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && fills2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card15.push({
|
|
|
|
|
card21.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3574,7 +3563,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors2[0] === colorsall[a] && fills1[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && borders2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card15.push({
|
|
|
|
|
card22.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3588,7 +3577,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors1[0] === colorsall[a] && fills2[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (shapes2[0] !== undefined && fills2[0] !== undefined && borders2[0] !== undefined) {
|
|
|
|
|
card15.push({
|
|
|
|
|
card23.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3603,7 +3592,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors1[0] === colorsall[a] && fills2[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (shapes2[0] !== undefined && fills2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card15.push({
|
|
|
|
|
card24.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3616,7 +3605,7 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors1[0] === colorsall[a] && fills1[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (shapes2[0] !== undefined && borders2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card15.push({
|
|
|
|
|
card25.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3630,7 +3619,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors1[0] === colorsall[a] && fills2[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (fills2[0] !== undefined && borders2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card15.push({
|
|
|
|
|
card26.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3645,7 +3634,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors2[0] === colorsall[a] && fills2[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && shapes2[0] !== undefined && fills2[0] !== undefined && borders2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card12.push({
|
|
|
|
|
card27.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3660,7 +3649,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors1[0] === colorsall[a] && fills2[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (shapes2[0] !== undefined && fills2[0] !== undefined && borders2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card12.push({
|
|
|
|
|
card28.push({
|
|
|
|
|
color: colors1[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3674,7 +3663,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes1[0] === shapesall[a] && colors2[0] === colorsall[a] && fills2[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && borders2[0] !== undefined && fills2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card12.push({
|
|
|
|
|
card29.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes1[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3688,7 +3677,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors2[0] === colorsall[a] && fills1[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && shapes2[0] !== undefined && borders2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card12.push({
|
|
|
|
|
card30.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills1[0],
|
|
|
|
@ -3702,7 +3691,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors2[0] === colorsall[a] && fills2[0] === fillsall[a] && borders1[0] === bordersall[a] && numbers2[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && shapes2[0] !== undefined && fills2[0] !== undefined && numbers2[0] !== undefined) {
|
|
|
|
|
card12.push({
|
|
|
|
|
card31.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3716,7 +3705,7 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
if (shapes2[0] === shapesall[a] && colors2[0] === colorsall[a] && fills2[0] === fillsall[a] && borders2[0] === bordersall[a] && numbers1[0] === numbersall[a]) {
|
|
|
|
|
if (colors2[0] !== undefined && shapes2[0] !== undefined && fills2[0] !== undefined && borders2[0] !== undefined) {
|
|
|
|
|
card12.push({
|
|
|
|
|
card32.push({
|
|
|
|
|
color: colors2[0],
|
|
|
|
|
shape: shapes2[0],
|
|
|
|
|
fill: fills2[0],
|
|
|
|
@ -3728,7 +3717,6 @@ var Game = {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return possibleCards;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -3808,35 +3796,49 @@ var Game = {
|
|
|
|
|
tCardsABC[1] = carte2;
|
|
|
|
|
tCardsABC[2] = pCards[z][0];
|
|
|
|
|
|
|
|
|
|
console.log('HS 4x4 : ');
|
|
|
|
|
console.log('carte1 :', tCardsABC[0]);
|
|
|
|
|
console.log('carte2 :', tCardsABC[1]);
|
|
|
|
|
console.log('carte3 :', tCardsABC[2]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cardVirtualABC[z] = this.generateVirtualCard44(tCardsABC);
|
|
|
|
|
|
|
|
|
|
console.log('carteVirtuelle :', cardVirtualABC[z]);
|
|
|
|
|
|
|
|
|
|
tCardsDGE[0] = carte4;
|
|
|
|
|
tCardsDGE[1] = cardVirtualABC[z][0];
|
|
|
|
|
tCardsDGE[2] = [];
|
|
|
|
|
if (carte4.color !== tCardsABC[2].color && carte4.shape !== tCardsABC[2].shape && carte4.fill !== tCardsABC[2].fill && carte4.number !== tCardsABC[2].number) {
|
|
|
|
|
|
|
|
|
|
colors2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.color;
|
|
|
|
|
});
|
|
|
|
|
shapes2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.shape;
|
|
|
|
|
});
|
|
|
|
|
fills2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.fill;
|
|
|
|
|
});
|
|
|
|
|
numbers2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.number;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
pCards2 = self.generer16Cartes(colors2, shapes2, fills2, numbers2, this.cardsHS2);
|
|
|
|
|
tCardsDGE[0] = carte4;
|
|
|
|
|
tCardsDGE[1] = cardVirtualABC[z][0];
|
|
|
|
|
tCardsDGE[2] = [];
|
|
|
|
|
|
|
|
|
|
for (var w = 0; w < pCards2.length; w++) {
|
|
|
|
|
tCardsDGE[2] = pCards2[w][0];
|
|
|
|
|
carte6[w] = this.generateVirtualCard44(tCardsDGE);
|
|
|
|
|
console.log('carte4 :', tCardsDGE[0]);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
colors2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.color;
|
|
|
|
|
});
|
|
|
|
|
shapes2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.shape;
|
|
|
|
|
});
|
|
|
|
|
fills2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.fill;
|
|
|
|
|
});
|
|
|
|
|
numbers2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.number;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
pCards2 = self.generer16Cartes(colors2, shapes2, fills2, numbers2, this.cardsHS2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var w = 0; w < pCards2.length; w++) {
|
|
|
|
|
tCardsDGE[2] = pCards2[w][0];
|
|
|
|
|
carte6[w] = this.generateVirtualCard44(tCardsDGE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3845,6 +3847,8 @@ var Game = {
|
|
|
|
|
for (a = k + 1; a < self.cardsHS2.length; a++) {
|
|
|
|
|
if (carte6[x][0].color !== undefined && carte6[x][0].shape !== undefined && carte6[x][0].fill !== undefined && carte6[x][0].number !== undefined) {
|
|
|
|
|
if (carte6[x][0].shape === shapesall[a] && carte6[x][0].color === colorsall[a] && carte6[x][0].fill === fillsall[a] && carte6[x][0].number === numbersall[a]) {
|
|
|
|
|
console.log('carte5 :', tCardsDGE[2]);
|
|
|
|
|
console.log('carte6 :', carte6[x][0]);
|
|
|
|
|
//console.log('ab');
|
|
|
|
|
//console.log(carte6[x][0].shape, carte6[x][0].color, carte6[x][0].fill, carte6[x][0].number);
|
|
|
|
|
//console.log(carte1);
|
|
|
|
@ -3930,7 +3934,6 @@ var Game = {
|
|
|
|
|
|
|
|
|
|
pCards = self.generer16Cartes5(colors1, shapes1, fills1, borders1, numbers1, this.cardsHS3);
|
|
|
|
|
|
|
|
|
|
console.log(pCards);
|
|
|
|
|
|
|
|
|
|
if (pCards.length > 0) {
|
|
|
|
|
|
|
|
|
@ -3939,40 +3942,51 @@ var Game = {
|
|
|
|
|
tCardsABC[1] = carte2;
|
|
|
|
|
tCardsABC[2] = pCards[z][0];
|
|
|
|
|
|
|
|
|
|
console.log('HS 4x4 : ');
|
|
|
|
|
console.log('carte1 :', tCardsABC[0]);
|
|
|
|
|
console.log('carte2 :', tCardsABC[1]);
|
|
|
|
|
console.log('carte3 :', tCardsABC[2]);
|
|
|
|
|
|
|
|
|
|
cardVirtualABC[z] = this.generateVirtualCard45(tCardsABC);
|
|
|
|
|
|
|
|
|
|
console.log('carteVirtuelle :', cardVirtualABC[z]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (carte4.color !== tCardsABC[2].color && carte4.shape !== tCardsABC[2].shape && carte4.fill !== tCardsABC[2].fill && carte4.number !== tCardsABC[2].number) {
|
|
|
|
|
|
|
|
|
|
tCardsDGE[0] = carte4;
|
|
|
|
|
tCardsDGE[1] = cardVirtualABC[z][0];
|
|
|
|
|
tCardsDGE[2] = [];
|
|
|
|
|
tCardsDGE[0] = carte4;
|
|
|
|
|
tCardsDGE[1] = cardVirtualABC[z][0];
|
|
|
|
|
tCardsDGE[2] = [];
|
|
|
|
|
console.log('carte4 :', tCardsDGE[0]);
|
|
|
|
|
|
|
|
|
|
colors2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.color;
|
|
|
|
|
});
|
|
|
|
|
shapes2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.shape;
|
|
|
|
|
});
|
|
|
|
|
fills2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.fill;
|
|
|
|
|
});
|
|
|
|
|
borders2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.border;
|
|
|
|
|
});
|
|
|
|
|
numbers2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.number;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
pCards2 = self.generer16Cartes5(colors2, shapes2, fills2, borders2, numbers2, this.cardsHS3);
|
|
|
|
|
colors2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.color;
|
|
|
|
|
});
|
|
|
|
|
shapes2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.shape;
|
|
|
|
|
});
|
|
|
|
|
fills2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.fill;
|
|
|
|
|
});
|
|
|
|
|
borders2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.border;
|
|
|
|
|
});
|
|
|
|
|
numbers2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.number;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
for (var w = 0; w < pCards2.length; w++) {
|
|
|
|
|
tCardsDGE[2] = pCards2[w][0];
|
|
|
|
|
carte6[w] = this.generateVirtualCard45(tCardsDGE);
|
|
|
|
|
pCards2 = self.generer16Cartes5(colors2, shapes2, fills2, borders2, numbers2, this.cardsHS3);
|
|
|
|
|
|
|
|
|
|
for (var w = 0; w < pCards2.length; w++) {
|
|
|
|
|
tCardsDGE[2] = pCards2[w][0];
|
|
|
|
|
carte6[w] = this.generateVirtualCard45(tCardsDGE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3980,6 +3994,8 @@ var Game = {
|
|
|
|
|
for (a = k + 1; a < self.cardsHS3.length; a++) {
|
|
|
|
|
if (carte6[x][0].color !== undefined && carte6[x][0].shape !== undefined && carte6[x][0].fill !== undefined && carte6[x][0].border !== undefined && carte6[x][0].number !== undefined) {
|
|
|
|
|
if (carte6[x][0].shape === shapesall[a] && carte6[x][0].color === colorsall[a] && carte6[x][0].fill === fillsall[a] && carte6[x][0].border === bordersall[a] && carte6[x][0].number === numbersall[a]) {
|
|
|
|
|
console.log('carte5 :', tCardsDGE[2]);
|
|
|
|
|
console.log('carte6 :', carte6[x][0]);
|
|
|
|
|
//console.log('ab');
|
|
|
|
|
//console.log(carte6[x][0].shape, carte6[x][0].color, carte6[x][0].fill, carte6[x][0].number);
|
|
|
|
|
//console.log(carte1);
|
|
|
|
@ -4003,6 +4019,152 @@ var Game = {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
existingHyperSet4: function() {
|
|
|
|
|
var colors1 = [];
|
|
|
|
|
var shapes1 =[];
|
|
|
|
|
var fills1= [];
|
|
|
|
|
var borders1 =[];
|
|
|
|
|
var numbers1= [];
|
|
|
|
|
var colors2 = [];
|
|
|
|
|
var shapes2 =[];
|
|
|
|
|
var fills2= [];
|
|
|
|
|
var borders2 =[];
|
|
|
|
|
var numbers2= [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
var cartes = self.cardsHS4;
|
|
|
|
|
var cartes1 = cartes;
|
|
|
|
|
var cartes2 = cartes;
|
|
|
|
|
|
|
|
|
|
var carte1, carte5, carte8 =[];
|
|
|
|
|
var carte2;
|
|
|
|
|
|
|
|
|
|
var cardVirtualABC = [];
|
|
|
|
|
|
|
|
|
|
var tCardsABC = [];
|
|
|
|
|
|
|
|
|
|
var tCardsDGE = [];
|
|
|
|
|
var pCards = [];
|
|
|
|
|
var pCards2 = [];
|
|
|
|
|
|
|
|
|
|
var i, j, a, k ,z;
|
|
|
|
|
|
|
|
|
|
var colorsall= $.map(this.cardsHS4, function(el) { return el.color;});
|
|
|
|
|
var shapesall = $.map(this.cardsHS4, function(el) { return el.shape; });
|
|
|
|
|
var fillsall= $.map(this.cardsHS4,function(el) { return el.fill; });
|
|
|
|
|
var bordersall= $.map(this.cardsHS4,function(el) { return el.border; });
|
|
|
|
|
var numbersall = $.map(this.cardsHS4, function(el) { return el.number;});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(i=0; i < cartes.length-2; i++) {
|
|
|
|
|
for (j = i + 1; j < cartes1.length - 1; j++) {
|
|
|
|
|
for (k = j + 1; k < cartes2.length; k++) {
|
|
|
|
|
|
|
|
|
|
carte1 = cartes[i];
|
|
|
|
|
carte2 = cartes1[j];
|
|
|
|
|
carte5 = cartes2[k];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
colors1.splice(0, 1, carte1.color);
|
|
|
|
|
colors1.splice(1, 1, carte2.color);
|
|
|
|
|
|
|
|
|
|
shapes1.splice(0, 1, carte1.shape);
|
|
|
|
|
shapes1.splice(1, 1, carte2.shape);
|
|
|
|
|
|
|
|
|
|
fills1.splice(0, 1, carte1.fill);
|
|
|
|
|
fills1.splice(1, 1, carte2.fill);
|
|
|
|
|
|
|
|
|
|
borders1.splice(0, 1, carte1.border);
|
|
|
|
|
borders1.splice(1, 1, carte2.border);
|
|
|
|
|
|
|
|
|
|
numbers1.splice(0, 1, carte1.number);
|
|
|
|
|
numbers1.splice(1, 1, carte2.number);
|
|
|
|
|
|
|
|
|
|
pCards = self.generer16Cartes5(colors1, shapes1, fills1, borders1, numbers1, this.cardsHS4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pCards.length > 0) {
|
|
|
|
|
|
|
|
|
|
for (z = 0; z < pCards.length; z++) {
|
|
|
|
|
tCardsABC[0] = carte1;
|
|
|
|
|
tCardsABC[1] = carte2;
|
|
|
|
|
tCardsABC[2] = pCards[z][0];
|
|
|
|
|
|
|
|
|
|
tCardsABC[3] = this.generateVirtualCard45(tCardsABC);
|
|
|
|
|
cardVirtualABC[z] = this.generateVirtualCard55(tCardsABC);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (carte5.color !== tCardsABC[2].color && carte5.shape !== tCardsABC[2].shape && carte5.fill !== tCardsABC[2].fill && carte5.number !== tCardsABC[2].number &&
|
|
|
|
|
carte5.color !== tCardsABC[3].color && carte5.shape !== tCardsABC[3].shape && carte5.fill !== tCardsABC[3].fill && carte5.number !== tCardsABC[3].number ) {
|
|
|
|
|
|
|
|
|
|
tCardsDGE[0] = carte5;
|
|
|
|
|
tCardsDGE[1] = cardVirtualABC[z][0];
|
|
|
|
|
tCardsDGE[2] = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
colors2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.color;
|
|
|
|
|
});
|
|
|
|
|
shapes2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.shape;
|
|
|
|
|
});
|
|
|
|
|
fills2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.fill;
|
|
|
|
|
});
|
|
|
|
|
borders2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.border;
|
|
|
|
|
});
|
|
|
|
|
numbers2 = $.map(tCardsDGE, function (el) {
|
|
|
|
|
return el.number;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
pCards2 = self.generer16Cartes5(colors2, shapes2, fills2, borders2, numbers2, this.cardsHS4);
|
|
|
|
|
|
|
|
|
|
for (var w = 0; w < pCards2.length; w++) {
|
|
|
|
|
tCardsDGE[2] = pCards2[w][0];
|
|
|
|
|
tCardsDGE[3] = this.generateVirtualCard45(tCardsDGE);
|
|
|
|
|
carte8[w] = this.generateVirtualCard55(tCardsDGE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(var x=0; x< carte8.length; x++) {
|
|
|
|
|
for (a = k + 1; a < self.cardsHS4.length; a++) {
|
|
|
|
|
|
|
|
|
|
if (carte8[x][0].color !== undefined && carte8[x][0].shape !== undefined && carte8[x][0].fill !== undefined && carte8[x][0].border !== undefined && carte8[x][0].number !== undefined) {
|
|
|
|
|
if (carte8[x][0].shape === shapesall[a] && carte8[x][0].color === colorsall[a] && carte8[x][0].fill === fillsall[a] && carte8[x][0].border === bordersall[a] && carte8[x][0].number === numbersall[a]) {
|
|
|
|
|
//console.log('ab');
|
|
|
|
|
//console.log(carte6[x][0].shape, carte6[x][0].color, carte6[x][0].fill, carte6[x][0].number);
|
|
|
|
|
//console.log(carte1);
|
|
|
|
|
//console.log(carte2);
|
|
|
|
|
self.setHS4 = self.setHS4 + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
carte8 = [];
|
|
|
|
|
pCards = [];
|
|
|
|
|
pCards2 = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$nbSetsHS4.html(self.setHS4);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -7248,7 +7410,7 @@ var Game = {
|
|
|
|
|
if (!data.gameComplete) {
|
|
|
|
|
self.set4 = 0;
|
|
|
|
|
//self.updateCards4(data);
|
|
|
|
|
//self.existingSet4();
|
|
|
|
|
self.existingSet4();
|
|
|
|
|
self.increaseScore4();
|
|
|
|
|
} else {
|
|
|
|
|
self.gameWon();
|
|
|
|
@ -7404,7 +7566,7 @@ var Game = {
|
|
|
|
|
if (!data.gameComplete) {
|
|
|
|
|
self.setHS3 = 0;
|
|
|
|
|
//self.updateCards(data);
|
|
|
|
|
//self.existingSet0();
|
|
|
|
|
self.existingHyperSet3();
|
|
|
|
|
self.increaseScoreHS3();
|
|
|
|
|
} else {
|
|
|
|
|
self.gameWon();
|
|
|
|
|