+
HyperSet
Modes de jeu

@@ -118,7 +123,7 @@
Sets found: 0
Number of Sets:
-
+
Set 4x5
@@ -174,7 +179,7 @@
HyperSets found: 0
Number of HyperSets:
-
+
HyperSet 3x5
diff --git a/HyperSet/vues/js/set.js b/HyperSet/vues/js/set.js
index 9a7203f..9eb63e1 100644
--- a/HyperSet/vues/js/set.js
+++ b/HyperSet/vues/js/set.js
@@ -125,7 +125,6 @@ var Game = {
success: function (data) {
self.cards = data;
self.existingSet();
- self.existingSetT();
self.displayCards.call(self);
self.setCardListeners();
//self.setPageListeners();
@@ -139,8 +138,8 @@ var Game = {
dataType: 'json',
success: function (data) {
self.cards1 = data;
- self.displayCards1.call(self);
self.existingSet1();
+ self.displayCards1.call(self);
self.setCardListeners1();
//self.setPageListeners1();
@@ -154,7 +153,7 @@ var Game = {
success: function (data) {
self.cards2 = data;
self.displayCards2.call(self);
- //self.existingSet2();
+ self.existingSet2();
self.setCardListeners2();
//self.setPageListeners2();
}
@@ -657,7 +656,7 @@ var Game = {
// PARLER SUR CET ALGO SUR LE RAPPORT
- existingSet: function() {
+ /*existingSet: function() {
var colors = [];
var shapes =[];
var fills= [];
@@ -711,11 +710,10 @@ var Game = {
}
}
}
- console.log('ah' + self.set);
this.$nbSets.html(self.set);
- },
+ },*/
- existingSetT: function() {
+ existingSet: function() {
var colors1 = [];
var shapes1 =[];
var fills1= [];
@@ -728,13 +726,9 @@ var Game = {
var carte1;
var carte2;
- var colors2 = [];
- var shapes2 =[];
- var fills2= [];
- var numbers2= [];
+
var i, j, a;
- var test = 0;
var colorsall= $.map(this.cards, function(el) { return el.color;});
var shapesall = $.map(this.cards, function(el) { return el.shape; });
var fillsall= $.map(this.cards,function(el) { return el.fill; });
@@ -744,152 +738,142 @@ var Game = {
for(i=0; i= 0) {
- self.deselectCard0(card);
- } else {
- self.selectCard0(card);
- }
+ if (colors1[0] === 'green' && colors1[1] === 'purple' && colors1[2] === 'red') {
+ colors1.splice(3, 1, 'lightblue');
+ }
+ if (colors1[0] === 'green' && colors1[1] === 'red' && colors1[2] === 'purple') {
+ colors1.splice(3, 1, 'lightblue');
+ }
- if (self.selected0.length === 3) {
- self.silentSubmission0();
- }
- });
- },
- setCardListeners: function() {
- var self = this;
+ if (colors1[0] === 'green' && colors1[1] === 'purple' && colors1[2] === 'lightblue') {
+ colors1.splice(3, 1, 'red');
- // what happens when a card is clicked:
- this.$board.on('click', '.card', function(e) {
- e.stopImmediatePropagation();
- var card = e.currentTarget;
+ }
- // if card is new, add it, otherwise remove it
- var ids = $.map(self.selected, function(el) { return $(el).data("id");});
- if (ids.indexOf($(card).data('id')) >= 0) {
- self.deselectCard(card);
- } else {
- self.selectCard(card);
- }
+ if (colors1[0] === 'green' && colors1[1] === 'lightblue' && colors1[2] === 'purple') {
+ colors1.splice(3, 1, 'red');
+ }
- if (self.selected.length === 3) {
- self.silentSubmission();
- }
- });
- },
+ if (colors1[0] === 'purple' && colors1[1] === 'lightblue' && colors1[2] === 'green') {
+ colors1.splice(3, 1, 'red');
+ }
+ if (colors1[0] === 'purple' && colors1[1] === 'green' && colors1[2] === 'lightblue') {
+ colors1.splice(3, 1, 'red');
+ }
- setCardListeners1: function() {
- var self = this;
+ if (colors1[0] === 'lightblue' && colors1[1] === 'purple' && colors1[2] === 'green') {
+ colors1.splice(3, 1, 'red');
+ }
+ if (colors1[0] === 'lightblue' && colors1[1] === 'green' && colors1[2] === 'purple') {
+ colors1.splice(3, 1, 'red');
+ }
- // what happens when a card is clicked:
- this.$board1.on('click', '.card', function(e) {
- e.stopImmediatePropagation();
- var card = e.currentTarget;
- // if card is new, add it, otherwise remove it
- var ids = $.map(self.selected1, function(el) { return $(el).data("id");});
- if (ids.indexOf($(card).data('id')) >= 0) {
- self.deselectCard1(card);
- } else {
- self.selectCard1(card);
- }
+ if (colors1[0] === 'red' && colors1[1] === 'green' && colors1[2] === 'lightblue') {
+ colors1.splice(3, 1, 'purple');
+ }
- if (self.selected1.length === 3) {
- self.silentSubmission1();
- }
- });
- },
- setCardListeners2: function() {
- var self = this;
+ if (colors1[0] === 'red' && colors1[1] === 'lightblue' && colors1[2] === 'green') {
+ colors1.splice(3, 1, 'purple');
+ }
- // what happens when a card is clicked:
- this.$board2.on('click', '.card', function(e) {
- e.stopImmediatePropagation();
- var card = e.currentTarget;
+ if (colors1[0] === 'lightblue' && colors1[1] === 'green' && colors1[2] === 'red') {
+ colors1.splice(3, 1, 'purple');
+ }
+ if (colors1[0] === 'lightblue' && colors1[1] === 'red' && colors1[2] === 'green') {
+ colors1.splice(3, 1, 'purple');
+ }
- // if card is new, add it, otherwise remove it
- var ids = $.map(self.selected2, function(el) { return $(el).data("id");});
- if (ids.indexOf($(card).data('id')) >= 0) {
- self.deselectCard2(card);
- } else {
- self.selectCard2(card);
- }
+ if (colors1[0] === 'green' && colors1[1] === 'lightblue' && colors1[2] === 'red') {
+ colors1.splice(3, 1, 'purple');
+ }
+ if (colors1[0] === 'green' && colors1[1] === 'red' && colors1[2] === 'lightblue') {
+ colors1.splice(3, 1, 'purple');
+ }
- if (self.selected2.length === 4) {
- self.silentSubmission2();
- }
- });
- },
- setCardListeners3: function() {
- var self = this;
- // what happens when a card is clicked:
- this.$board3.on('click', '.card', function(e) {
- e.stopImmediatePropagation();
- var card = e.currentTarget;
+ if (colors1[0] === 'red' && colors1[1] === 'purple' && colors1[2] === 'lightblue') {
+ colors1.splice(3, 1, 'green');
+ }
- // if card is new, add it, otherwise remove it
- var ids = $.map(self.selected3, function(el) { return $(el).data("id");});
- if (ids.indexOf($(card).data('id')) >= 0) {
- self.deselectCard3(card);
- } else {
- self.selectCard3(card);
- }
+ if (colors1[0] === 'red' && colors1[1] === 'lightblue' && colors1[2] === 'purple') {
+ colors1.splice(3, 1, 'green');
+ }
- if (self.selected3.length === 4) {
- self.silentSubmission3();
- }
- });
- },
- setCardListeners4: function() {
- var self = this;
+ if (colors1[0] === 'lightblue' && colors1[1] === 'purple' && colors1[2] === 'red') {
+ colors1.splice(3, 1, 'green');
+ }
+ if (colors1[0] === 'lightblue' && colors1[1] === 'red' && colors1[2] === 'purple') {
+ colors1.splice(3, 1, 'green');
+ }
- // what happens when a card is clicked:
- this.$board4.on('click', '.card', function(e) {
- e.stopImmediatePropagation();
- var card = e.currentTarget;
+ if (colors1[0] === 'purple' && colors1[1] === 'lightblue' && colors1[2] === 'red') {
+ colors1.splice(3, 1, 'green');
+ }
+ if (colors1[0] === 'purple' && colors1[1] === 'red' && colors1[2] === 'lightblue') {
+ colors1.splice(3, 1, 'green');
+ }
- // if card is new, add it, otherwise remove it
- var ids = $.map(self.selected4, function(el) { return $(el).data("id");});
- if (ids.indexOf($(card).data('id')) >= 0) {
- self.deselectCard4(card);
- } else {
- self.selectCard4(card);
- }
+ }
- if (self.selected4.length === 5) {
- self.silentSubmission4();
- }
- });
- },
- setCardListenersHS: function() {
- var self = this;
+ if (shapes1[0] === shapes1 [1] && shapes1[0] === shapes1 [2]) {
+ shapes1.splice(3, 1, shapes1[0]);
+ } else {
+ if (shapes1[0] === 'oval' && shapes1[1] === 'diamond' && shapes1[2] === 'wave') {
+ shapes1.splice(3, 1, 'rectangle');
+ }
- // what happens when a card is clicked:
- this.$boardHS.on('click', '.card', function(e) {
- e.stopImmediatePropagation();
- var card = e.currentTarget;
+ if (shapes1[0] === 'oval' && shapes1[1] === 'wave' && shapes1[2] === 'diamond') {
+ shapes1.splice(3, 1, 'rectangle');
+ }
- // if card is new, add it, otherwise remove it
- var ids = $.map(self.selectedHS, function(el) { return $(el).data("id");});
- if (ids.indexOf($(card).data('id')) >= 0) {
- self.deselectCardHS(card);
- } else {
- self.selectCardHS(card);
- }
+ if (shapes1[0] === 'wave' && shapes1[1] === 'diamond' && shapes1[2] === 'oval') {
+ shapes1.splice(3, 1, 'rectangle');
+ }
+ if (shapes1[0] === 'wave' && shapes1[1] === 'oval' && shapes1[2] === 'diamond') {
+ shapes1.splice(3, 1, 'rectangle');
+ }
- if (self.selectedHS.length === 4) {
- self.silentSubmissionHS();
- }
- });
- },
+ if (shapes1[0] === 'diamond' && shapes1[1] === 'oval' && shapes1[2] === 'wave') {
+ shapes1.splice(3, 1, 'rectangle');
+ }
+ if (shapes1[0] === 'diamond' && shapes1[1] === 'wave' && shapes1[2] === 'oval') {
+ shapes1.splice(3,1,'rectangle');
+ }
- setCardListenersHS0: function() {
- var self = this;
- // what happens when a card is clicked:
- this.$boardHS0.on('click', '.card', function(e) {
- e.stopImmediatePropagation();
- var card = e.currentTarget;
+ if (shapes1[0] === 'oval' && shapes1[1] === 'diamond' && shapes1[2] === 'rectangle') {
+ shapes1.splice(3, 1, 'wave');
+ }
- // if card is new, add it, otherwise remove it
- var ids = $.map(self.selectedHS0, function(el) { return $(el).data("id");});
- if (ids.indexOf($(card).data('id')) >= 0) {
- self.deselectCardHS0(card);
- } else {
- self.selectCardHS0(card);
- }
+ if (shapes1[0] === 'oval' && shapes1[1] === 'rectangle' && shapes1[2] === 'diamond') {
+ shapes1.splice(3, 1, 'wave');
+ }
- if (self.selectedHS0.length === 4) {
- self.silentSubmissionHS0();
- }
- });
- },
+ if (shapes1[0] === 'rectangle' && shapes1[1] === 'oval' && shapes1[2] === 'diamond') {
+ shapes1.splice(3, 1, 'wave');
+ }
+ if (shapes1[0] === 'rectangle' && shapes1[1] === 'diamond' && shapes1[2] === 'oval') {
+ shapes1.splice(3, 1, 'wave');
+ }
- setCardListenersHS1: function() {
- var self = this;
+ if (shapes1[0] === 'diamond' && shapes1[1] === 'oval' && shapes1[2] === 'rectangle') {
+ shapes1.splice(3, 1, 'wave');
+ }
+ if (shapes1[0] === 'diamond' && shapes1[1] === 'rectangle' && shapes1[2] === 'oval') {
+ shapes1.splice(3, 1, 'wave');
+ }
- // what happens when a card is clicked:
- this.$boardHS1.on('click', '.card', function(e) {
- e.stopImmediatePropagation();
- var card = e.currentTarget;
- // if card is new, add it, otherwise remove it
- var ids = $.map(self.selectedHS1, function(el) { return $(el).data("id");});
- if (ids.indexOf($(card).data('id')) >= 0) {
- self.deselectCardHS1(card);
- } else {
- self.selectCardHS1(card);
- }
+ if (shapes1[0] === 'oval' && shapes1[1] === 'wave' && shapes1[2] === 'rectangle') {
+ shapes1.splice(3, 1, 'diamond');
+ }
- if (self.selectedHS1.length === 4) {
- self.silentSubmissionHS1();
- }
- });
- },
- setCardListenersHS2: function() {
- var self = this;
+ if (shapes1[0] === 'oval' && shapes1[1] === 'rectangle' && shapes1[2] === 'wave') {
+ shapes1.splice(3, 1, 'diamond');
+ }
- // what happens when a card is clicked:
- this.$boardHS2.on('click', '.card', function(e) {
- e.stopImmediatePropagation();
- var card = e.currentTarget;
-
- // if card is new, add it, otherwise remove it
- var ids = $.map(self.selectedHS2, function(el) { return $(el).data("id");});
- if (ids.indexOf($(card).data('id')) >= 0) {
- self.deselectCardHS2(card);
- } else {
- self.selectCardHS2(card);
- }
-
- if (self.selectedHS2.length === 6) {
- self.silentSubmissionHS2();
- }
- });
- },
+ if (shapes1[0] === 'rectangle' && shapes1[1] === 'wave' && shapes1[2] === 'oval') {
+ shapes1.splice(3, 1, 'diamond');
+ }
+ if (shapes1[0] === 'rectangle' && shapes1[1] === 'oval' && shapes1[2] === 'wave') {
+ shapes1.splice(3,1,'diamond');
+ }
+ if (shapes1[0] === 'wave' && shapes1[1] === 'oval' && shapes1[2] === 'rectangle') {
+ shapes1.splice(3, 1, 'diamond');
+ }
+ if (shapes1[0] === 'wave' && shapes1[1] === 'rectangle' && shapes1[2] === 'oval') {
+ shapes1.splice(3, 1, 'diamond');
+ }
+ if (shapes1[0] === 'diamond' && shapes1[1] === 'wave' && shapes1[2] === 'rectangle') {
+ shapes1.splice(3, 1, 'oval');
+ }
+ if (shapes1[0] === 'diamond' && shapes1[1] === 'rectangle' && shapes1[2] === 'wave') {
+ shapes1.splice(3, 1, 'oval');
+ }
+ if (shapes1[0] === 'rectangle' && shapes1[1] === 'wave' && shapes1[2] === 'diamond') {
+ shapes1.splice(3, 1, 'oval');
+ }
+ if (shapes1[0] === 'rectangle' && shapes1[1] === 'diamond' && shapes1[2] === 'wave') {
+ shapes1.splice(3, 1, 'oval');
+ }
+ if (shapes1[0] === 'wave' && shapes1[1] === 'diamond' && shapes1[2] === 'rectangle') {
+ shapes1.splice(3, 1, 'oval');
+ }
+ if (shapes1[0] === 'wave' && shapes1[1] === 'rectangle' && shapes1[2] === 'diamond') {
+ shapes1.splice(3, 1, 'oval');
+ }
+ }
+ if (fills1[0] === fills1 [1] && fills1[0] === fills1 [2]) {
+ fills1.splice(3, 1, fills1[0]);
+ } else {
+ if (fills1[0] === 'solid' && fills1[1] === 'stripped' && fills1[2] === 'open') {
+ fills1.splice(3, 1, 'quadrillage');
+ }
+ if (fills1[0] === 'solid' && fills1[1] === 'open' && fills1[2] === 'stripped') {
+ fills1.splice(3, 1, 'quadrillage');
+ }
+ if (fills1[0] === 'stripped' && fills1[1] === 'open' && fills1[2] === 'solid') {
+ fills1.splice(3, 1, 'quadrillage');
+ }
+ if (fills1[0] === 'stripped' && fills1[1] === 'solid' && fills1[2] === 'open') {
+ fills1.splice(3, 1, 'quadrillage');
+ }
+ if (fills1[0] === 'open' && fills1[1] === 'stripped' && fills1[2] === 'solid') {
+ fills1.splice(3, 1, 'quadrillage');
+ }
+ if (fills1[0] === 'open' && fills1[1] === 'solid' && fills1[2] === 'stripped') {
+ fills1.splice(3, 1, 'quadrillage');
+ }
+ if (fills1[0] === 'solid' && fills1[1] === 'stripped' && fills1[2] === 'quadrillage') {
+ fills1.splice(3, 1, 'open');
+ }
+ if (fills1[0] === 'solid' && fills1[1] === 'quadrillage' && fills1[2] === 'stripped') {
+ fills1.splice(3, 1, 'open');
+ }
+ if (fills1[0] === 'quadrillage' && fills1[1] === 'solid' && fills1[2] === 'stripped') {
+ fills1.splice(3, 1, 'open');
+ }
+ if (fills1[0] === 'quadrillage' && fills1[1] === 'stripped' && fills1[2] === 'solid') {
+ fills1.splice(3, 1, 'open');
+ }
+ if (fills1[0] === 'stripped' && fills1[1] === 'quadrillage' && fills1[2] === 'solid') {
+ fills1.splice(3, 1, 'open');
+ }
+ if (fills1[0] === 'stripped' && fills1[1] === 'solid' && fills1[2] === 'quadrillage') {
+ fills1.splice(3, 1, 'open');
+ }
- setPageListeners0: function() {
- var self = this;
- // if the user clicks on the page outside the game board, clear selected
- $(document).on('click', function() {
- self.clearSelections0.call(self);
- });
- },
+ if (fills1[0] === 'solid' && fills1[1] === 'open' && fills1[2] === 'quadrillage') {
+ fills1.splice(3, 1, 'stripped');
+ }
- setPageListeners: function() {
- var self = this;
+ if (fills1[0] === 'solid' && fills1[1] === 'quadrillage' && fills1[2] === 'open') {
+ fills1.splice(3, 1, 'stripped');
+ }
- // if the user clicks on the page outside the game board, clear selected
- $(document).on('click', function() {
- self.clearSelections.call(self);
- });
- },
+ if (fills1[0] === 'quadrillage' && fills1[1] === 'solid' && fills1[2] === 'open') {
+ fills1.splice(3, 1, 'stripped');
+ }
+ if (fills1[0] === 'quadrillage' && fills1[1] === 'open' && fills1[2] === 'solid') {
+ fills1.splice(3, 1, 'stripped');
+ }
- setPageListeners1: function() {
- var self = this;
+ if (fills1[0] === 'open' && fills1[1] === 'quadrillage' && fills1[2] === 'solid') {
+ fills1.splice(3, 1, 'stripped');
+ }
+ if (fills1[0] === 'open' && fills1[1] === 'solid' && fills1[2] === 'quadrillage') {
+ fills1.splice(3, 1, 'stripped');
+ }
- // if the user clicks on the page outside the game board, clear selected
- $(document).on('click', function() {
- self.clearSelections1.call(self);
- });
- },
- setPageListeners2: function() {
- var self = this;
+ if (fills1[0] === 'stripped' && fills1[1] === 'open' && fills1[2] === 'quadrillage') {
+ fills1.splice(3, 1, 'solid');
+ }
- // if the user clicks on the page outside the game board, clear selected
- $(document).on('click', function() {
- self.clearSelections2.call(self);
- });
- },
+ if (fills1[0] === 'stripped' && fills1[1] === 'quadrillage' && fills1[2] === 'open') {
+ fills1.splice(3, 1, 'solid');
+ }
- setPageListeners3: function() {
- var self = this;
+ if (fills1[0] === 'quadrillage' && fills1[1] === 'stripped' && fills1[2] === 'open') {
+ fills1.splice(3, 1, 'solid');
+ }
+ if (fills1[0] === 'quadrillage' && fills1[1] === 'open' && fills1[2] === 'stripped') {
+ fills1.splice(3, 1, 'solid');
+ }
- // if the user clicks on the page outside the game board, clear selected
- $(document).on('click', function() {
- self.clearSelections3.call(self);
- });
- },
+ if (fills1[0] === 'open' && fills1[1] === 'quadrillage' && fills1[2] === 'stripped') {
+ fills1.splice(3, 1, 'solid');
+ }
+ if (fills1[0] === 'open' && fills1[1] === 'stripped' && fills1[2] === 'quadrillage') {
+ fills1.splice(3, 1, 'solid');
+ }
- setPageListeners4: function() {
- var self = this;
- // if the user clicks on the page outside the game board, clear selected
- $(document).on('click', function() {
- self.clearSelections4.call(self);
- });
- },
+ }
+ if (numbers1[0] === numbers1[1] && numbers1[0] === numbers1[2]) {
+ numbers1.splice(3, 1, numbers1[0]);
+ } else {
+ if (numbers1[0] === 1 && numbers1[1] === 2 && numbers1[2] === 3) {
+ numbers1.splice(3, 1, 4);
+ }
+ if (numbers1[0] === 1 && numbers1[1] === 3 && numbers1[2] === 2) {
+ numbers1.splice(3, 1, 4);
+ }
+ if (numbers1[0] === 2 && numbers1[1] === 1 && numbers1[2] === 3) {
+ numbers1.splice(3, 1, 4);
+ }
+ if (numbers1[0] === 2 && numbers1[1] === 3 && numbers1[2] === 1) {
+ numbers1.splice(3, 1, 4);
+ }
- setPageListenersHS: function() {
- var self = this;
+ if (numbers1[0] === 3 && numbers1[1] === 1 && numbers1[2] === 2) {
+ numbers1.splice(3, 1, 4);
+ }
+ if (numbers1[0] === 3 && numbers1[1] === 2 && numbers1[2] === 1) {
+ numbers1.splice(3, 1, 4);
+ }
- // if the user clicks on the page outside the game board, clear selected
- $(document).on('click', function() {
- self.clearSelectionsHS.call(self);
- });
- },
- setPageListenersHS0: function() {
- var self = this;
+ if (numbers1[0] === 1 && numbers1[1] === 2 && numbers1[2] === 4) {
+ numbers1.splice(3, 1, 3);
+ }
- // if the user clicks on the page outside the game board, clear selected
- $(document).on('click', function() {
- self.clearSelectionsHS0.call(self);
- });
- },
- setPageListenersHS1: function() {
- var self = this;
+ if (numbers1[0] === 1 && numbers1[1] === 4 && numbers1[2] === 2) {
+ numbers1.splice(3, 1, 3);
+ }
- // if the user clicks on the page outside the game board, clear selected
- $(document).on('click', function() {
- self.clearSelectionsHS1.call(self);
- });
- },
- setPageListenersHS2: function() {
- var self = this;
+ if (numbers1[0] === 2 && numbers1[1] === 1 && numbers1[2] === 4) {
+ numbers1.splice(3, 1, 3);
+ }
+ if (numbers1[0] === 2 && numbers1[1] === 4 && numbers1[2] === 1) {
+ numbers1.splice(3, 1, 3);
+ }
- // if the user clicks on the page outside the game board, clear selected
- $(document).on('click', function() {
- self.clearSelectionsHS2.call(self);
- });
- },
+ if (numbers1[0] === 4 && numbers1[1] === 1 && numbers1[2] === 2) {
+ numbers1.splice(3, 1, 3);
+ }
+ if (numbers1[0] === 4 && numbers1[1] === 2 && numbers1[2] === 1) {
+ numbers1.splice(3, 1, 3);
+ }
+ if (numbers1[0] === 1 && numbers1[1] === 3 && numbers1[2] === 4) {
+ numbers1.splice(3, 1, 2);
+ }
+ if (numbers1[0] === 1 && numbers1[1] === 4 && numbers1[2] === 3) {
+ numbers1.splice(3, 1, 2);
+ }
+ if (numbers1[0] === 3 && numbers1[1] === 1 && numbers1[2] === 4) {
+ numbers1.splice(3, 1, 2);
+ }
+ if (numbers1[0] === 3 && numbers1[1] === 4 && numbers1[2] === 1) {
+ numbers1.splice(3, 1, 2);
+ }
+ if (numbers1[0] === 4 && numbers1[1] === 1 && numbers1[2] === 3) {
+ numbers1.splice(3, 1, 2);
+ }
+ if (numbers1[0] === 4 && numbers1[1] === 3 && numbers1[2] === 1) {
+ numbers1.splice(3, 1, 2);
+ }
+ if (numbers1[0] === 2 && numbers1[1] === 3 && numbers1[2] === 4) {
+ numbers1.splice(3, 1, 1);
+ }
+ if (numbers1[0] === 2 && numbers1[1] === 4 && numbers1[2] === 3) {
+ numbers1.splice(3, 1, 1);
+ }
+ if (numbers1[0] === 3 && numbers1[1] === 2 && numbers1[2] === 4) {
+ numbers1.splice(3, 1, 1);
+ }
+ if (numbers1[0] === 3 && numbers1[1] === 4 && numbers1[2] === 2) {
+ numbers1.splice(3, 1, 1);
+ }
+ if (numbers1[0] === 4 && numbers1[1] === 2 && numbers1[2] === 3) {
+ numbers1.splice(3, 1, 1);
+ }
+ if (numbers1[0] === 4 && numbers1[1] === 3 && numbers1[2] === 2) {
+ numbers1.splice(3, 1, 1);
+ }
+ }
+ for (a = k + 1; a < self.cards2.length; a++) {
+ if (shapes1[3] === shapesall[a] && colors1[3] === colorsall[a] && fills1[3] === fillsall[a] && numbers1[3] === numbersall[a]) {
+ if (this.isSet4(shapes1) && this.isSet4(colors1) && this.isSet4(fills1) && this.isSet4(numbers1)) {
+ self.set2 = self.set2 + 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ this.$nbSets2.html(self.set2);
+ },
- selectCard0: function(card) {
- if (this.selected0.length < 3) {
- $(card).addClass('selected');
- this.selected0.push(card);
- }
- },
- selectCard: function(card) {
- if (this.selected.length < 3) {
- $(card).addClass('selected');
- this.selected.push(card);
- }
- },
- selectCard1: function(card) {
- if (this.selected1.length < 3) {
- console.log(this.selected1);
- $(card).addClass('selected');
- this.selected1.push(card);
- }
- },
- selectCard2: function(card) {
- if (this.selected2.length < 4) {
- $(card).addClass('selected');
- this.selected2.push(card);
- }
- },
- selectCard3: function(card) {
- if (this.selected3.length < 4) {
- $(card).addClass('selected');
- this.selected3.push(card);
- }
- },
- selectCard4: function(card) {
+ setCardListeners0: function() {
+ var self = this;
+ // what happens when a card is clicked:
+ this.$board0.on('click', '.card', function(e) {
+ e.stopImmediatePropagation();
+ var card = e.currentTarget;
- if (this.selected4.length < 5) {
- $(card).addClass('selected');
- this.selected4.push(card);
- }
+ // if card is new, add it, otherwise remove it
+ var ids = $.map(self.selected0, function(el) { return $(el).data("id");});
+ if (ids.indexOf($(card).data('id')) >= 0) {
+ self.deselectCard0(card);
+ } else {
+ self.selectCard0(card);
+ }
+ if (self.selected0.length === 3) {
+ self.silentSubmission0();
+ }
+ });
},
- selectCardHS: function(card) {
+ setCardListeners: function() {
+ var self = this;
- if (this.selectedHS.length < 4) {
- $(card).addClass('selected');
- this.selectedHS.push(card);
- }
+ // what happens when a card is clicked:
+ this.$board.on('click', '.card', function(e) {
+ e.stopImmediatePropagation();
+ var card = e.currentTarget;
+
+ // if card is new, add it, otherwise remove it
+ var ids = $.map(self.selected, function(el) { return $(el).data("id");});
+ if (ids.indexOf($(card).data('id')) >= 0) {
+ self.deselectCard(card);
+ } else {
+ self.selectCard(card);
+ }
+ if (self.selected.length === 3) {
+ self.silentSubmission();
+ }
+ });
},
- selectCardHS0: function(card) {
+ setCardListeners1: function() {
+ var self = this;
- if (this.selectedHS0.length < 4) {
- $(card).addClass('selected');
- this.selectedHS0.push(card);
+ // what happens when a card is clicked:
+ this.$board1.on('click', '.card', function(e) {
+ e.stopImmediatePropagation();
+ var card = e.currentTarget;
- }
+ // if card is new, add it, otherwise remove it
+ var ids = $.map(self.selected1, function(el) { return $(el).data("id");});
+ if (ids.indexOf($(card).data('id')) >= 0) {
+ self.deselectCard1(card);
+ } else {
+ self.selectCard1(card);
+ }
+ if (self.selected1.length === 3) {
+ self.silentSubmission1();
+ }
+ });
},
+ setCardListeners2: function() {
+ var self = this;
+ // what happens when a card is clicked:
+ this.$board2.on('click', '.card', function(e) {
+ e.stopImmediatePropagation();
+ var card = e.currentTarget;
- selectCardHS1: function(card) {
-
- if (this.selectedHS1.length < 4) {
- $(card).addClass('selected');
- this.selectedHS1.push(card);
-
- }
-
- },
- selectCardHS2: function(card) {
-
- if (this.selectedHS2.length < 6) {
- $(card).addClass('selected');
- this.selectedHS2.push(card);
-
- }
-
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- deselectCard0: function(card) {
- var self = this;
- var index = self.selected0.indexOf(card);
- if (index > -1) {
- self.selected0.splice(index, 1);
- }
- $(card).removeClass('selected');
- },
- deselectCard: function(card) {
- var self = this;
- var index = self.selected.indexOf(card);
- if (index > -1) {
- self.selected.splice(index, 1);
- }
- $(card).removeClass('selected');
- },
- deselectCard1: function(card) {
- var self = this;
- var index = self.selected1.indexOf(card);
- if (index > -1) {
- self.selected1.splice(index, 1);
- }
- $(card).removeClass('selected');
- },
- deselectCard2: function(card) {
- var self = this;
- var index = self.selected2.indexOf(card);
- if (index > -1) {
- self.selected2.splice(index, 1);
- }
- $(card).removeClass('selected');
- },
- deselectCard3: function(card) {
- var self = this;
- var index = self.selected3.indexOf(card);
- if (index > -1) {
- self.selected3.splice(index, 1);
- }
- $(card).removeClass('selected');
- },
- deselectCard4: function(card) {
- var self = this;
- var index = self.selected4.indexOf(card);
- if (index > -1) {
- self.selected4.splice(index, 1);
- }
- $(card).removeClass('selected');
- },
- deselectCardHS: function(card) {
- var self = this;
- var index = self.selectedHS.indexOf(card);
- if (index > -1) {
- self.selectedHS.splice(index, 1);
- }
- $(card).removeClass('selected');
- },
-
- deselectCardHS0: function(card) {
- var self = this;
- var index = self.selectedHS0.indexOf(card);
- if (index > -1) {
- self.selectedHS0.splice(index, 1);
- }
- $(card).removeClass('selected');
- },
-
- deselectCardHS1: function(card) {
- var self = this;
- var index = self.selectedHS1.indexOf(card);
- if (index > -1) {
- self.selectedHS1.splice(index, 1);
- }
- $(card).removeClass('selected');
- },
- deselectCardHS2: function(card) {
- var self = this;
- var index = self.selectedHS2.indexOf(card);
- if (index > -1) {
- self.selectedHS2.splice(index, 1);
- }
- $(card).removeClass('selected');
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- clearSelections0: function() {
- $.each(this.selected0, function(index, card) {
- $(card).removeClass('selected');
- });
- this.selected0 = [];
- },
- clearSelections: function() {
- $.each(this.selected, function(index, card) {
- $(card).removeClass('selected');
- });
- this.selected = [];
- },
- clearSelections1: function() {
- $.each(this.selected1, function(index, card) {
- $(card).removeClass('selected');
- });
- this.selected1 = [];
- },
- clearSelections2: function() {
- $.each(this.selected2, function(index, card) {
- $(card).removeClass('selected');
- });
- this.selected2 = [];
- },
- clearSelections3: function() {
- $.each(this.selected3, function(index, card) {
- $(card).removeClass('selected');
- });
- this.selected3 = [];
- },
- clearSelections4: function() {
- $.each(this.selected4, function(index, card) {
- $(card).removeClass('selected');
- });
- this.selected4 = [];
- },
-
-
- clearSelectionsHS: function() {
- $.each(this.selectedHS, function(index, card) {
- $(card).removeClass('selected');
- });
- this.selectedHS = [];
- },
-
- clearSelectionsHS0: function() {
- $.each(this.selectedHS0, function(index, card) {
- $(card).removeClass('selected');
- });
- this.selectedHS0 = [];
- },
- clearSelectionsHS1: function() {
- $.each(this.selectedHS1, function(index, card) {
- $(card).removeClass('selected');
- });
- this.selectedHS1 = [];
- },
- clearSelectionsHS2: function() {
- $.each(this.selectedHS2, function(index, card) {
- $(card).removeClass('selected');
- });
- this.selectedHS2 = [];
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- validateHyperSet0: function() {
- var carteAB = [];
- var carteCD = [];
- var carteAC = [];
- var carteBD = [];
- var carteAD = [];
- var carteBC = [];
-
- carteAB.splice(0,1,this.selectedHS0[0]);
- carteAB.splice(1,1,this.selectedHS0[1]);
- carteCD.splice(0,1,this.selectedHS0[2]);
- carteCD.splice(1,1,this.selectedHS0[3]);
-
-
-
- carteAC.splice(0,1,this.selectedHS0[0]);
- carteAC.splice(1,1,this.selectedHS0[2]);
- carteBD.splice(0,1,this.selectedHS0[1]);
- carteBD.splice(1,1,this.selectedHS0[3]);
-
- carteAD.splice(0,1,this.selectedHS0[0]);
- carteAD.splice(1,1,this.selectedHS0[3]);
- carteBC.splice(0,1,this.selectedHS0[1]);
- carteBC.splice(1,1,this.selectedHS0[2]);
-
-
- // modalité de toutes les 4 cartes
- var colors1= $.map(this.selectedHS0, function(el) { return $(el).data("color");});
- var shapes1 = $.map(this.selectedHS0, function(el) { return $(el).data("shape");});
- var numbers1 = $.map(this.selectedHS0, function(el) { return $(el).data("number");});
-
- // modalité des combinaison de carte (ab ac ad ...) pour verifier si forme un set
-
- var colors2= $.map(carteAB, function(el) { return $(el).data("color");});
- var shapes2 = $.map(carteAB, function(el) { return $(el).data("shape");});
- var numbers2 = $.map(carteAB, function(el) { return $(el).data("number");});
-
- var colors3= $.map(carteCD, function(el) { return $(el).data("color");});
- var shapes3 = $.map(carteCD, function(el) { return $(el).data("shape");});
- var numbers3 = $.map(carteCD, function(el) { return $(el).data("number");});
-
-
- var colors4= $.map(carteAC, function(el) { return $(el).data("color");});
- var shapes4 = $.map(carteAC, function(el) { return $(el).data("shape");});
- var numbers4 = $.map(carteAC, function(el) { return $(el).data("number");});
-
- var colors5= $.map(carteBD, function(el) { return $(el).data("color");});
- var shapes5 = $.map(carteBD, function(el) { return $(el).data("shape");});
- var numbers5 = $.map(carteBD, function(el) { return $(el).data("number");});
-
-
- var colors6= $.map(carteAD, function(el) { return $(el).data("color");});
- var shapes6 = $.map(carteAD, function(el) { return $(el).data("shape");});
- var numbers6 = $.map(carteAD, function(el) { return $(el).data("number");});
-
- var colors7= $.map(carteBC, function(el) { return $(el).data("color");});
- var shapes7 = $.map(carteBC, function(el) { return $(el).data("shape");});
- var numbers7 = $.map(carteBC, function(el) { return $(el).data("number");});
-
-
-
- if(colors1[0] === colors1 [1]){
- colors2.push(colors1[0]);
- colors3.push(colors1[0]);
- }
- else{
- if(colors1[0] === 'red' && colors1[1] === 'green'){
- colors3.push('purple');
- colors2.push('purple');
- }
-
- if(colors1[0] === 'red' && colors1[1] === 'purple'){
- colors3.push('green');
- colors2.push('green');
- }
-
- if(colors1[0] === 'green' && colors1[1] === 'purple'){
- colors3.push('red');
- colors2.push('red');
- }
- if(colors1[0] === 'green' && colors1[1] === 'red'){
- colors3.push('purple');
- colors2.push('purple');
- }
-
- if(colors1[0] === 'purple' && colors1[1] === 'red'){
- colors3.push('green');
- colors2.push('green');
- }
- if(colors1[0] === 'purple' && colors1[1] === 'green'){
- colors3.push('red');
- colors2.push('red');
- }
-
- }
- if(shapes1[0] === shapes1 [1]){
- shapes3.push(shapes1[0]);
- shapes2.push(shapes1[0]);
- }
- else{
- if(shapes1[0] === 'oval' && shapes1[1] === 'diamond'){
- shapes3.push('wave');
- shapes2.push('wave');
- }
-
- if(shapes1[0] === 'oval' && shapes1[1] === 'wave'){
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
-
- if(shapes1[0] === 'diamond' && shapes1[1] === 'oval'){
- shapes3.push('wave');
- shapes2.push('wave');
-
- }
- if(shapes1[0] === 'diamond' && shapes1[1] === 'wave'){
- shapes3.push('oval');
- shapes2.push('oval');
- }
-
- if(shapes1[0] === 'wave' && shapes1[1] === 'diamond'){
- shapes3.push('oval');
- shapes2.push('oval');
- }
- if(shapes1[0] === 'wave' && shapes1[1] === 'oval'){
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
- }
-
- if(numbers1[0] === numbers1[1]){
- numbers3.push(numbers1[0]);
- numbers2.push(numbers1[0]);
- }
- else{
- if(numbers1[0] === 1 && numbers1[1] === 2){
- numbers3.push(3);
- numbers2.push(3);
- }
-
- if(numbers1[0] === 1 && numbers1[1] === 3){
- numbers3.push(2);
- numbers2.push(2);
- }
-
- if(numbers1[0] === 2 && numbers1[1] === 1){
- numbers3.push(3);
- numbers2.push(3);
- }
- if(numbers1[0] === 2 && numbers1[1] === 3){
- numbers3.push(1);
- numbers2.push(1);
- }
-
- if(numbers1[0] === 3 && numbers1[1] === 1){
- numbers3.push(2);
- numbers2.push(2);
- }
- if(numbers1[0] === 3 && numbers1[1] === 2){
- numbers3.push(1);
- numbers2.push(1);
- }
-
- }
- if(colors1[0] === colors1 [2]){
- colors4.push(colors1[0]);
- colors5.push(colors1[0]);
- }
- else{
- if(colors1[0] === 'red' && colors1[2] === 'green'){
- colors4.push('purple');
- colors5.push('purple');
- }
-
- if(colors1[0] === 'red' && colors1[2] === 'purple'){
- colors4.push('green');
- colors5.push('green');
- }
-
- if(colors1[0] === 'green' && colors1[2] === 'purple'){
- colors5.push('red');
- colors4.push('red');
- }
- if(colors1[0] === 'green' && colors1[2] === 'red'){
- colors4.push('purple');
- colors5.push('purple');
- }
-
- if(colors1[0] === 'purple' && colors1[2] === 'red'){
- colors4.push('green');
- colors5.push('green');
- }
- if(colors1[0]=== 'purple' && colors1[2] === 'green'){
- colors4.push('red');
- colors5.push('red');
- }
- }
- if(shapes1[0] === shapes1 [2]){
- shapes4.push(shapes1[0]);
- shapes5.push(shapes1[0]);
- }
- else{
- if(shapes1[0] === 'oval' && shapes1[2] === 'diamond'){
- shapes4.push('wave');
- shapes5.push('wave');
- }
-
- if(shapes1[0] === 'oval' && shapes1[2] === 'wave'){
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
-
- if(shapes1[0] === 'diamond' && shapes1[2] === 'oval'){
- shapes4.push('wave');
- shapes5.push('wave');
- }
- if(shapes1[0] === 'diamond' && shapes1[2] === 'wave'){
- shapes4.push('oval');
- shapes5.push('oval');
- }
-
- if(shapes1[0] === 'wave' && shapes1[2] === 'diamond'){
- shapes4.push('oval');
- shapes5.push('oval');
- }
- if(shapes1[0] === 'wave' && shapes1[2] === 'oval'){
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
-
- }
- if(numbers1[0] === numbers1[1]){
- numbers4.push(numbers1[0]);
- numbers5.push(numbers1[0]);
- }
- else{
- if(numbers1[0] === 1 && numbers1[2] === 2){
- numbers4.push(3);
- numbers5.push(3);
- }
-
- if(numbers1[0] === 1 && numbers1[2] === 3){
- numbers4.push(2);
- numbers5.push(2);
- }
-
- if(numbers1[0] === 2 && numbers1[2] === 1){
- numbers4.push(3);
- numbers5.push(3);
- }
- if(numbers1[0] === 2 && numbers1[2] === 3){
- numbers4.push(1);
- numbers5.push(1);
- }
-
- if(numbers1[0] === 3 && numbers1[2] === 1){
- numbers4.push(2);
- numbers5.push(2);
- }
- if(numbers1[0] === 3 && numbers1[2] === 2){
- numbers4.push(1);
- numbers5.push(1);
- }
- }
- if(colors1[0] === colors1 [3]){
- colors6.push(colors1[0]);
- colors7.push(colors1[0]);
- }
- else{
- if(colors1[0] === 'red' && colors1[3] === 'green'){
- colors6.push('purple');
- colors7.push('purple');
- }
-
- if(colors1[0] === 'red' && colors1[3] === 'purple'){
- colors6.push('green');
- colors7.push('green');
- }
-
- if(colors1[0] === 'green' && colors1[3] === 'purple'){
- colors6.push('red');
- colors7.push('red');
- }
- if(colors1[0] === 'green' && colors1[3] === 'red'){
- colors6.push('purple');
- colors7.push('purple');
- }
-
- if(colors1[0] === 'purple' && colors1[3] === 'red'){
- colors6.push('green');
- colors7.push('green');
- }
- if(colors1[0]=== 'purple' && colors1[3] === 'green'){
- colors6.push('red');
- colors7.push('red');
- }
- }
- if(shapes1[0] === shapes1 [3]){
- shapes6.push(shapes1[0]);
- shapes7.push(shapes1[0]);
- }
- else{
- if(shapes1[0] === 'oval' && shapes1[3] === 'diamond'){
- shapes6.push('wave');
- shapes7.push('wave');
- }
-
- if(shapes1[0] === 'oval' && shapes1[3] === 'wave'){
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
-
- if(shapes1[0] === 'diamond' && shapes1[3] === 'oval'){
- shapes6.push('wave');
- shapes7.push('wave');
- }
- if(shapes1[0] === 'diamond' && shapes1[3] === 'wave'){
- shapes6.push('oval');
- shapes7.push('oval');
- }
-
- if(shapes1[0] === 'wave' && shapes1[3] === 'diamond'){
- shapes6.push('oval');
- shapes7.push('oval');
- }
- if(shapes1[0] === 'wave' && shapes1[3] === 'oval'){
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
-
- }
- if(numbers1[0] === numbers1[3]){
- numbers6.push(numbers1[0]);
- numbers7.push(numbers1[0]);
- }
- else{
- if(numbers1[0] === 1 && numbers1[3] === 2){
- numbers6.push(3);
- numbers7.push(3);
- }
-
- if(numbers1[0] === 1 && numbers1[3] === 3){
- numbers6.push(2);
- numbers7.push(2);
- }
-
- if(numbers1[0] === 2 && numbers1[3] === 1){
- numbers6.push(3);
- numbers7.push(3);
- }
- if(numbers1[0] === 2 && numbers1[3] === 3){
- numbers6.push(1);
- numbers7.push(1);
- }
-
- if(numbers1[0] === 3 && numbers1[3] === 1){
- numbers6.push(2);
- numbers7.push(2);
- }
- if(numbers1[0] === 3 && numbers1[3] === 2){
- numbers6.push(1);
- numbers7.push(1);
- }
- }
- if(this.isSet(colors2) && this.isSet(shapes2) && this.isSet(numbers2)) {
- console.log(colors3, shapes3, numbers3);
- return this.isSet(colors3) && this.isSet(shapes3) && this.isSet(numbers3);
- }
- if(this.isSet(colors4) && this.isSet(shapes4) && this.isSet(numbers4)){
- console.log(colors5,shapes5,numbers5);
- return this.isSet(colors5) && this.isSet(shapes5) && this.isSet(numbers5)
- }
- if(this.isSet(colors6) && this.isSet(shapes6) && this.isSet(numbers6)) {
- return this.isSet(colors7) && this.isSet(shapes7) && this.isSet(numbers7);
- }
-
- },
-
- validateHyperSet: function() {
- var carteAB = [];
- var carteCD = [];
- var carteAC = [];
- var carteBD = [];
- var carteAD = [];
- var carteBC = [];
-
- carteAB.splice(0,1,this.selectedHS[0]);
- carteAB.splice(1,1,this.selectedHS[1]);
- carteCD.splice(0,1,this.selectedHS[2]);
- carteCD.splice(1,1,this.selectedHS[3]);
-
- carteAC.splice(0,1,this.selectedHS[0]);
- carteAC.splice(1,1,this.selectedHS[2]);
- carteBD.splice(0,1,this.selectedHS[1]);
- carteBD.splice(1,1,this.selectedHS[3]);
-
- carteAD.splice(0,1,this.selectedHS[0]);
- carteAD.splice(1,1,this.selectedHS[3]);
- carteBC.splice(0,1,this.selectedHS[1]);
- carteBC.splice(1,1,this.selectedHS[2]);
-
-
- // modalité de toutes les 4 cartes
- var colors1= $.map(this.selectedHS, function(el) { return $(el).data("color");});
- var shapes1 = $.map(this.selectedHS, function(el) { return $(el).data("shape");});
- var fills1= $.map(this.selectedHS,function(el) { return $(el).data("fill");});
- var numbers1 = $.map(this.selectedHS, function(el) { return $(el).data("number");});
-
- // modalité des combinaison de carte (ab ac ad ...) pour verifier si forme un set
-
- var colors2= $.map(carteAB, function(el) { return $(el).data("color");});
- var shapes2 = $.map(carteAB, function(el) { return $(el).data("shape");});
- var fills2= $.map(carteAB, function(el) { return $(el).data("fill");});
- var numbers2 = $.map(carteAB, function(el) { return $(el).data("number");});
-
- var colors3= $.map(carteCD, function(el) { return $(el).data("color");});
- var shapes3 = $.map(carteCD, function(el) { return $(el).data("shape");});
- var fills3= $.map(carteCD, function(el) { return $(el).data("fill");});
- var numbers3 = $.map(carteCD, function(el) { return $(el).data("number");});
-
-
-
- var colors4= $.map(carteAC, function(el) { return $(el).data("color");});
- var shapes4 = $.map(carteAC, function(el) { return $(el).data("shape");});
- var fills4= $.map(carteAC, function(el) { return $(el).data("fill");});
- var numbers4 = $.map(carteAC, function(el) { return $(el).data("number");});
-
- var colors5= $.map(carteBD, function(el) { return $(el).data("color");});
- var shapes5 = $.map(carteBD, function(el) { return $(el).data("shape");});
- var fills5= $.map(carteBD, function(el) { return $(el).data("fill");});
- var numbers5 = $.map(carteBD, function(el) { return $(el).data("number");});
-
-
- var colors6= $.map(carteAD, function(el) { return $(el).data("color");});
- var shapes6 = $.map(carteAD, function(el) { return $(el).data("shape");});
- var fills6= $.map(carteAD, function(el) { return $(el).data("fill");});
- var numbers6 = $.map(carteAD, function(el) { return $(el).data("number");});
-
- var colors7= $.map(carteBC, function(el) { return $(el).data("color");});
- var shapes7 = $.map(carteBC, function(el) { return $(el).data("shape");});
- var fills7= $.map(carteBC, function(el) { return $(el).data("fill");});
- var numbers7 = $.map(carteBC, function(el) { return $(el).data("number");});
-
-
- if(colors1[0] === colors1 [1]){
- colors2.push(colors1[0]);
- colors3.push(colors1[0]);
- }
- else{
- if(colors1[0] === 'red' && colors1[1] === 'green'){
- colors3.push('purple');
- colors2.push('purple');
- }
-
- if(colors1[0] === 'red' && colors1[1] === 'purple'){
- colors3.push('green');
- colors2.push('green');
- }
-
- if(colors1[0] === 'green' && colors1[1] === 'purple'){
- colors3.push('red');
- colors2.push('red');
- }
- if(colors1[0] === 'green' && colors1[1] === 'red'){
- colors3.push('purple');
- colors2.push('purple');
- }
-
- if(colors1[0] === 'purple' && colors1[1] === 'red'){
- colors3.push('green');
- colors2.push('green');
- }
- if(colors1[0] === 'purple' && colors1[1] === 'green'){
- colors3.push('red');
- colors2.push('red');
- }
-
- }
- if(shapes1[0] === shapes1 [1]){
- shapes3.push(shapes1[0]);
- shapes2.push(shapes1[0]);
- }
- else{
- if(shapes1[0] === 'oval' && shapes1[1] === 'diamond'){
- shapes3.push('wave');
- shapes2.push('wave');
- }
-
- if(shapes1[0] === 'oval' && shapes1[1] === 'wave'){
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
-
- if(shapes1[0] === 'diamond' && shapes1[1] === 'oval'){
- shapes3.push('wave');
- shapes2.push('wave');
-
- }
- if(shapes1[0] === 'diamond' && shapes1[1] === 'wave'){
- shapes3.push('oval');
- shapes2.push('oval');
- }
-
- if(shapes1[0] === 'wave' && shapes1[1] === 'diamond'){
- shapes3.push('oval');
- shapes2.push('oval');
- }
- if(shapes1[0] === 'wave' && shapes1[1] === 'oval'){
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
- }
- if(fills1[0] === fills1 [1]){
- fills3.push(fills1[0]);
- fills2.push(fills1[0]);
- }
- else{
- if(fills1[0] === 'solid' && fills1[1] === 'stripped'){
- fills3.push('open');
- fills2.push('open');
- }
-
- if(fills1[0] === 'solid' && fills1[1] === 'open'){
- fills3.push('stripped');
- fills2.push('stripped');
- }
-
- if(fills1[0] === 'stripped' && fills1[1] === 'open'){
- fills3.push('solid');
- fills2.push('solid');
- }
- if(fills1[0] === 'open' && fills1[1] === 'stripped'){
- fills3.push('solid');
- fills2.push('solid');
- }
-
- if(fills1[0] === 'stripped' && fills1[1] === 'solid'){
- fills3.push('open');
- fills2.push('open');
- }
- if(fills1[0] === 'open' && fills1[1] === 'solid'){
- fills3.push('stripped');
- fills2.push('stripped');
- }
- }
- if(numbers1[0] === numbers1[1]){
- numbers3.push(numbers1[0]);
- numbers2.push(numbers1[0]);
- }
- else{
- if(numbers1[0] === 1 && numbers1[1] === 2){
- numbers3.push(3);
- numbers2.push(3);
- }
-
- if(numbers1[0] === 1 && numbers1[1] === 3){
- numbers3.push(2);
- numbers2.push(2);
- }
-
- if(numbers1[0] === 2 && numbers1[1] === 1){
- numbers3.push(3);
- numbers2.push(3);
- }
- if(numbers1[0] === 2 && numbers1[1] === 3){
- numbers3.push(1);
- numbers2.push(1);
- }
-
- if(numbers1[0] === 3 && numbers1[1] === 1){
- numbers3.push(2);
- numbers2.push(2);
- }
- if(numbers1[0] === 3 && numbers1[1] === 2){
- numbers3.push(1);
- numbers2.push(1);
- }
-
- }
- if(colors1[0] === colors1 [2]){
- colors4.push(colors1[0]);
- colors5.push(colors1[0]);
- }
- else{
- if(colors1[0] === 'red' && colors1[2] === 'green'){
- colors4.push('purple');
- colors5.push('purple');
- }
-
- if(colors1[0] === 'red' && colors1[2] === 'purple'){
- colors4.push('green');
- colors5.push('green');
- }
-
- if(colors1[0] === 'green' && colors1[2] === 'purple'){
- colors5.push('red');
- colors4.push('red');
- }
- if(colors1[0] === 'green' && colors1[2] === 'red'){
- colors4.push('purple');
- colors5.push('purple');
- }
-
- if(colors1[0] === 'purple' && colors1[2] === 'red'){
- colors4.push('green');
- colors5.push('green');
- }
- if(colors1[0]=== 'purple' && colors1[2] === 'green'){
- colors4.push('red');
- colors5.push('red');
- }
- }
- if(shapes1[0] === shapes1 [2]){
- shapes4.push(shapes1[0]);
- shapes5.push(shapes1[0]);
- }
- else{
- if(shapes1[0] === 'oval' && shapes1[2] === 'diamond'){
- shapes4.push('wave');
- shapes5.push('wave');
- }
-
- if(shapes1[0] === 'oval' && shapes1[2] === 'wave'){
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
-
- if(shapes1[0] === 'diamond' && shapes1[2] === 'oval'){
- shapes4.push('wave');
- shapes5.push('wave');
- }
- if(shapes1[0] === 'diamond' && shapes1[2] === 'wave'){
- shapes4.push('oval');
- shapes5.push('oval');
- }
-
- if(shapes1[0] === 'wave' && shapes1[2] === 'diamond'){
- shapes4.push('oval');
- shapes5.push('oval');
- }
- if(shapes1[0] === 'wave' && shapes1[2] === 'oval'){
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
-
- }
- if(fills1[0] === fills1 [2]){
- fills5.push(fills1[0]);
- fills4.push(fills1[0]);
- }
- else{
- if(fills1[0] === 'solid' && fills1[2] === 'stripped'){
- fills4.push('open');
- fills5.push('open');
- }
-
- if(fills1[0] === 'solid' && fills1[2] === 'open'){
- fills4.push('stripped');
- fills5.push('stripped');
- }
-
- if(fills1[0] === 'stripped' && fills1[2] === 'open'){
- fills4.push('solid');
- fills5.push('solid');
- }
- if(fills1[0] === 'open' && fills1[2] === 'stripped'){
- fills4.push('solid');
- fills5.push('solid');
- }
-
- if(fills1[0] === 'stripped' && fills1[2] === 'solid'){
- fills4.push('open');
- fills5.push('open');
- }
- if(fills1[0] === 'open' && fills1[2] === 'solid'){
- fills4.push('stripped');
- fills5.push('stripped');
- }
- }
- if(numbers1[0] === numbers1[2]){
- numbers4.push(numbers1[0]);
- numbers5.push(numbers1[0]);
- }
- else{
- if(numbers1[0] === 1 && numbers1[2] === 2){
- numbers4.push(3);
- numbers5.push(3);
- }
-
- if(numbers1[0] === 1 && numbers1[2] === 3){
- numbers4.push(2);
- numbers5.push(2);
- }
-
- if(numbers1[0] === 2 && numbers1[2] === 1){
- numbers4.push(3);
- numbers5.push(3);
- }
- if(numbers1[0] === 2 && numbers1[2] === 3){
- numbers4.push(1);
- numbers5.push(1);
- }
-
- if(numbers1[0] === 3 && numbers1[2] === 1){
- numbers4.push(2);
- numbers5.push(2);
- }
- if(numbers1[0] === 3 && numbers1[2] === 2){
- numbers4.push(1);
- numbers5.push(1);
- }
- }
- if(colors1[0] === colors1 [3]){
- colors6.push(colors1[0]);
- colors7.push(colors1[0]);
- }
- else{
- if(colors1[0] === 'red' && colors1[3] === 'green'){
- colors6.push('purple');
- colors7.push('purple');
- }
-
- if(colors1[0] === 'red' && colors1[3] === 'purple'){
- colors6.push('green');
- colors7.push('green');
- }
-
- if(colors1[0] === 'green' && colors1[3] === 'purple'){
- colors6.push('red');
- colors7.push('red');
- }
- if(colors1[0] === 'green' && colors1[3] === 'red'){
- colors6.push('purple');
- colors7.push('purple');
- }
-
- if(colors1[0] === 'purple' && colors1[3] === 'red'){
- colors6.push('green');
- colors7.push('green');
- }
- if(colors1[0]=== 'purple' && colors1[3] === 'green'){
- colors6.push('red');
- colors7.push('red');
- }
- }
- if(shapes1[0] === shapes1 [3]){
- shapes6.push(shapes1[0]);
- shapes7.push(shapes1[0]);
- }
- else{
- if(shapes1[0] === 'oval' && shapes1[3] === 'diamond'){
- shapes6.push('wave');
- shapes7.push('wave');
- }
-
- if(shapes1[0] === 'oval' && shapes1[3] === 'wave'){
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
-
- if(shapes1[0] === 'diamond' && shapes1[3] === 'oval'){
- shapes6.push('wave');
- shapes7.push('wave');
- }
- if(shapes1[0] === 'diamond' && shapes1[3] === 'wave'){
- shapes6.push('oval');
- shapes7.push('oval');
- }
-
- if(shapes1[0] === 'wave' && shapes1[3] === 'diamond'){
- shapes6.push('oval');
- shapes7.push('oval');
- }
- if(shapes1[0] === 'wave' && shapes1[3] === 'oval'){
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
-
- }
- if(fills1[0] === fills1 [3]){
- fills6.push(fills1[0]);
- fills7.push(fills1[0]);
- }
- else{
- if(fills1[0] === 'solid' && fills1[3] === 'stripped'){
- fills6.push('open');
- fills7.push('open');
- }
-
- if(fills1[0] === 'solid' && fills1[3] === 'open'){
- fills6.push('stripped');
- fills7.push('stripped');
- }
-
- if(fills1[0] === 'stripped' && fills1[3] === 'open'){
- fills6.push('solid');
- fills7.push('solid');
- }
- if(fills1[0] === 'open' && fills1[3] === 'stripped'){
- fills6.push('solid');
- fills7.push('solid');
- }
-
- if(fills1[0] === 'stripped' && fills1[3] === 'solid'){
- fills6.push('open');
- fills7.push('open');
- }
- if(fills1[0] === 'open' && fills1[3] === 'solid'){
- fills6.push('stripped');
- fills7.push('stripped');
- }
-
- }
- if(numbers1[0] === numbers1[3]){
- numbers6.push(numbers1[0]);
- numbers7.push(numbers1[0]);
- }
- else{
- if(numbers1[0] === 1 && numbers1[3] === 2){
- numbers6.push(3);
- numbers7.push(3);
- }
-
- if(numbers1[0] === 1 && numbers1[3] === 3){
- numbers6.push(2);
- numbers7.push(2);
- }
-
- if(numbers1[0] === 2 && numbers1[3] === 1){
- numbers6.push(3);
- numbers7.push(3);
- }
- if(numbers1[0] === 2 && numbers1[3] === 3){
- numbers6.push(1);
- numbers7.push(1);
- }
-
- if(numbers1[0] === 3 && numbers1[3] === 1){
- numbers6.push(2);
- numbers7.push(2);
- }
- if(numbers1[0] === 3 && numbers1[3] === 2){
- numbers6.push(1);
- numbers7.push(1);
- }
- }
- if(this.isSet(colors2) && this.isSet(shapes2) && this.isSet(fills2) && this.isSet(numbers2)) {
- return this.isSet(colors3) && this.isSet(shapes3) && this.isSet(fills3) && this.isSet(numbers3)
- }
- if(this.isSet(colors4) && this.isSet(shapes4) && this.isSet(fills4) && this.isSet(numbers4)){
- return this.isSet(colors5)&& this.isSet(shapes5)&& this.isSet(fills5)&& this.isSet(numbers5)
- }
- if(this.isSet(colors6) && this.isSet(shapes6) && this.isSet(fills6) && this.isSet(numbers6)) {
- return this.isSet(colors7) && this.isSet(shapes7) && this.isSet(fills7) && this.isSet(numbers7)
- }
-
- },
-
- validateHyperSet1: function() {
- var carteAB = [];
- var carteCD = [];
- var carteAC = [];
- var carteBD = [];
- var carteAD = [];
- var carteBC = [];
-
- carteAB.splice(0,1,this.selectedHS1[0]);
- carteAB.splice(1,1,this.selectedHS1[1]);
- carteCD.splice(0,1,this.selectedHS1[2]);
- carteCD.splice(1,1,this.selectedHS1[3]);
-
- carteAC.splice(0,1,this.selectedHS1[0]);
- carteAC.splice(1,1,this.selectedHS1[2]);
- carteBD.splice(0,1,this.selectedHS1[1]);
- carteBD.splice(1,1,this.selectedHS1[3]);
-
- carteAD.splice(0,1,this.selectedHS1[0]);
- carteAD.splice(1,1,this.selectedHS1[3]);
- carteBC.splice(0,1,this.selectedHS1[1]);
- carteBC.splice(1,1,this.selectedHS1[2]);
-
-
- // modalité de toutes les 4 cartes
- var colors1= $.map(this.selectedHS1, function(el) { return $(el).data("color");});
- var shapes1 = $.map(this.selectedHS1, function(el) { return $(el).data("shape");});
- var fills1= $.map(this.selectedHS1,function(el) { return $(el).data("fill");});
- var borders1= $.map(this.selectedHS1,function(el) { return $(el).data("border");});
- var numbers1 = $.map(this.selectedHS1, function(el) { return $(el).data("number");});
-
- // modalité des combinaison de carte (ab ac ad ...) pour verifier si forme un set
-
- var colors2= $.map(carteAB, function(el) { return $(el).data("color");});
- var shapes2 = $.map(carteAB, function(el) { return $(el).data("shape");});
- var fills2= $.map(carteAB, function(el) { return $(el).data("fill");});
- var borders2= $.map(carteAB,function(el) { return $(el).data("border");});
- var numbers2 = $.map(carteAB, function(el) { return $(el).data("number");});
-
- var colors3= $.map(carteCD, function(el) { return $(el).data("color");});
- var shapes3 = $.map(carteCD, function(el) { return $(el).data("shape");});
- var fills3= $.map(carteCD, function(el) { return $(el).data("fill");});
- var borders3= $.map(carteCD,function(el) { return $(el).data("border");});
- var numbers3 = $.map(carteCD, function(el) { return $(el).data("number");});
-
-
-
- var colors4= $.map(carteAC, function(el) { return $(el).data("color");});
- var shapes4 = $.map(carteAC, function(el) { return $(el).data("shape");});
- var fills4= $.map(carteAC, function(el) { return $(el).data("fill");});
- var borders4= $.map(carteAC,function(el) { return $(el).data("border");});
- var numbers4 = $.map(carteAC, function(el) { return $(el).data("number");});
-
- var colors5= $.map(carteBD, function(el) { return $(el).data("color");});
- var shapes5 = $.map(carteBD, function(el) { return $(el).data("shape");});
- var fills5= $.map(carteBD, function(el) { return $(el).data("fill");});
- var borders5= $.map(carteBD,function(el) { return $(el).data("border");});
- var numbers5 = $.map(carteBD, function(el) { return $(el).data("number");});
-
-
- var colors6= $.map(carteAD, function(el) { return $(el).data("color");});
- var shapes6 = $.map(carteAD, function(el) { return $(el).data("shape");});
- var fills6= $.map(carteAD, function(el) { return $(el).data("fill");});
- var borders6= $.map(carteAD,function(el) { return $(el).data("border");});
- var numbers6 = $.map(carteAD, function(el) { return $(el).data("number");});
-
- var colors7= $.map(carteBC, function(el) { return $(el).data("color");});
- var shapes7 = $.map(carteBC, function(el) { return $(el).data("shape");});
- var fills7= $.map(carteBC, function(el) { return $(el).data("fill");});
- var borders7= $.map(carteBC,function(el) { return $(el).data("border");});
- var numbers7 = $.map(carteBC, function(el) { return $(el).data("number");});
-
-
- if(colors1[0] === colors1 [1]){
- colors2.push(colors1[0]);
- colors3.push(colors1[0]);
- }
- else{
- if(colors1[0] === 'red' && colors1[1] === 'green'){
- colors3.push('purple');
- colors2.push('purple');
- }
-
- if(colors1[0] === 'red' && colors1[1] === 'purple'){
- colors3.push('green');
- colors2.push('green');
- }
-
- if(colors1[0] === 'green' && colors1[1] === 'purple'){
- colors3.push('red');
- colors2.push('red');
- }
- if(colors1[0] === 'green' && colors1[1] === 'red'){
- colors3.push('purple');
- colors2.push('purple');
- }
-
- if(colors1[0] === 'purple' && colors1[1] === 'red'){
- colors3.push('green');
- colors2.push('green');
- }
- if(colors1[0] === 'purple' && colors1[1] === 'green'){
- colors3.push('red');
- colors2.push('red');
- }
-
- }
- if(shapes1[0] === shapes1 [1]){
- shapes3.push(shapes1[0]);
- shapes2.push(shapes1[0]);
- }
- else{
- if(shapes1[0] === 'oval' && shapes1[1] === 'diamond'){
- shapes3.push('wave');
- shapes2.push('wave');
- }
-
- if(shapes1[0] === 'oval' && shapes1[1] === 'wave'){
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
-
- if(shapes1[0] === 'diamond' && shapes1[1] === 'oval'){
- shapes3.push('wave');
- shapes2.push('wave');
-
- }
- if(shapes1[0] === 'diamond' && shapes1[1] === 'wave'){
- shapes3.push('oval');
- shapes2.push('oval');
- }
-
- if(shapes1[0] === 'wave' && shapes1[1] === 'diamond'){
- shapes3.push('oval');
- shapes2.push('oval');
- }
- if(shapes1[0] === 'wave' && shapes1[1] === 'oval'){
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
- }
- if(fills1[0] === fills1 [1]){
- fills3.push(fills1[0]);
- fills2.push(fills1[0]);
- }
- else{
- if(fills1[0] === 'solid' && fills1[1] === 'stripped'){
- fills3.push('open');
- fills2.push('open');
- }
-
- if(fills1[0] === 'solid' && fills1[1] === 'open'){
- fills3.push('stripped');
- fills2.push('stripped');
- }
-
- if(fills1[0] === 'stripped' && fills1[1] === 'open'){
- fills3.push('solid');
- fills2.push('solid');
- }
- if(fills1[0] === 'open' && fills1[1] === 'stripped'){
- fills3.push('solid');
- fills2.push('solid');
- }
-
- if(fills1[0] === 'stripped' && fills1[1] === 'solid'){
- fills3.push('open');
- fills2.push('open');
- }
- if(fills1[0] === 'open' && fills1[1] === 'solid'){
- fills3.push('stripped');
- fills2.push('stripped');
- }
- }
-
- if(borders1[0] === borders1 [1]){
- borders3.push(borders1[0]);
- borders2.push(borders1[0]);
- }
- else{
- if(borders1[0] === 'plein' && borders1[1] === 'point'){
- borders3.push('rond');
- borders2.push('rond');
- }
-
- if(borders1[0] === 'point' && borders1[1] === 'plein'){
- borders3.push('rond');
- borders2.push('rond');
- }
-
- if(borders1[0] === 'rond' && borders1[1] === 'plein'){
- borders3.push('point');
- borders2.push('point');
- }
- if(borders1[0] === 'plein' && borders1[1] === 'rond'){
- borders3.push('point');
- borders2.push('point');
- }
-
- if(borders1[0] === 'rond' && borders1[1] === 'point'){
- borders3.push('plein');
- borders2.push('plein');
- }
- if(borders1[0] === 'point' && borders1[1] === 'rond'){
- borders3.push('plein');
- borders2.push('plein');
- }
- }
-
- if(numbers1[0] === numbers1[1]){
- numbers3.push(numbers1[0]);
- numbers2.push(numbers1[0]);
- }
- else{
- if(numbers1[0] === 1 && numbers1[1] === 2){
- numbers3.push(3);
- numbers2.push(3);
- }
-
- if(numbers1[0] === 1 && numbers1[1] === 3){
- numbers3.push(2);
- numbers2.push(2);
- }
-
- if(numbers1[0] === 2 && numbers1[1] === 1){
- numbers3.push(3);
- numbers2.push(3);
- }
- if(numbers1[0] === 2 && numbers1[1] === 3){
- numbers3.push(1);
- numbers2.push(1);
- }
-
- if(numbers1[0] === 3 && numbers1[1] === 1){
- numbers3.push(2);
- numbers2.push(2);
- }
- if(numbers1[0] === 3 && numbers1[1] === 2){
- numbers3.push(1);
- numbers2.push(1);
- }
-
- }
- if(colors1[0] === colors1 [2]){
- colors4.push(colors1[0]);
- colors5.push(colors1[0]);
- }
- else{
- if(colors1[0] === 'red' && colors1[2] === 'green'){
- colors4.push('purple');
- colors5.push('purple');
- }
-
- if(colors1[0] === 'red' && colors1[2] === 'purple'){
- colors4.push('green');
- colors5.push('green');
- }
-
- if(colors1[0] === 'green' && colors1[2] === 'purple'){
- colors5.push('red');
- colors4.push('red');
- }
- if(colors1[0] === 'green' && colors1[2] === 'red'){
- colors4.push('purple');
- colors5.push('purple');
- }
-
- if(colors1[0] === 'purple' && colors1[2] === 'red'){
- colors4.push('green');
- colors5.push('green');
- }
- if(colors1[0]=== 'purple' && colors1[2] === 'green'){
- colors4.push('red');
- colors5.push('red');
- }
- }
- if(shapes1[0] === shapes1 [2]){
- shapes4.push(shapes1[0]);
- shapes5.push(shapes1[0]);
- }
- else{
- if(shapes1[0] === 'oval' && shapes1[2] === 'diamond'){
- shapes4.push('wave');
- shapes5.push('wave');
- }
-
- if(shapes1[0] === 'oval' && shapes1[2] === 'wave'){
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
-
- if(shapes1[0] === 'diamond' && shapes1[2] === 'oval'){
- shapes4.push('wave');
- shapes5.push('wave');
- }
- if(shapes1[0] === 'diamond' && shapes1[2] === 'wave'){
- shapes4.push('oval');
- shapes5.push('oval');
- }
-
- if(shapes1[0] === 'wave' && shapes1[2] === 'diamond'){
- shapes4.push('oval');
- shapes5.push('oval');
- }
- if(shapes1[0] === 'wave' && shapes1[2] === 'oval'){
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
-
- }
- if(fills1[0] === fills1 [2]){
- fills5.push(fills1[0]);
- fills4.push(fills1[0]);
- }
- else{
- if(fills1[0] === 'solid' && fills1[2] === 'stripped'){
- fills4.push('open');
- fills5.push('open');
- }
-
- if(fills1[0] === 'solid' && fills1[2] === 'open'){
- fills4.push('stripped');
- fills5.push('stripped');
- }
-
- if(fills1[0] === 'stripped' && fills1[2] === 'open'){
- fills4.push('solid');
- fills5.push('solid');
- }
- if(fills1[0] === 'open' && fills1[2] === 'stripped'){
- fills4.push('solid');
- fills5.push('solid');
- }
-
- if(fills1[0] === 'stripped' && fills1[2] === 'solid'){
- fills4.push('open');
- fills5.push('open');
- }
- if(fills1[0] === 'open' && fills1[2] === 'solid'){
- fills4.push('stripped');
- fills5.push('stripped');
- }
- }
- if(borders1[0] === borders1 [2]){
- borders4.push(borders1[0]);
- borders5.push(borders1[0]);
- }
- else{
- if(borders1[0] === 'plein' && borders1[2] === 'point'){
- borders4.push('rond');
- borders5.push('rond');
- }
-
- if(borders1[0] === 'point' && borders1[2] === 'plein'){
- borders4.push('rond');
- borders5.push('rond');
- }
-
- if(borders1[0] === 'rond' && borders1[2] === 'plein'){
- borders4.push('point');
- borders5.push('point');
- }
- if(borders1[0] === 'plein' && borders1[2] === 'rond'){
- borders4.push('point');
- borders5.push('point');
- }
-
- if(borders1[0] === 'rond' && borders1[2] === 'point'){
- borders4.push('plein');
- borders5.push('plein');
- }
- if(borders1[0] === 'point' && borders1[2] === 'rond'){
- borders4.push('plein');
- borders5.push('plein');
- }
- }
- if(numbers1[0] === numbers1[2]){
- numbers4.push(numbers1[0]);
- numbers5.push(numbers1[0]);
- }
- else{
- if(numbers1[0] === 1 && numbers1[2] === 2){
- numbers4.push(3);
- numbers5.push(3);
- }
-
- if(numbers1[0] === 1 && numbers1[2] === 3){
- numbers4.push(2);
- numbers5.push(2);
- }
-
- if(numbers1[0] === 2 && numbers1[2] === 1){
- numbers4.push(3);
- numbers5.push(3);
- }
- if(numbers1[0] === 2 && numbers1[2] === 3){
- numbers4.push(1);
- numbers5.push(1);
- }
-
- if(numbers1[0] === 3 && numbers1[2] === 1){
- numbers4.push(2);
- numbers5.push(2);
- }
- if(numbers1[0] === 3 && numbers1[2] === 2){
- numbers4.push(1);
- numbers5.push(1);
- }
- }
- if(colors1[0] === colors1 [3]){
- colors6.push(colors1[0]);
- colors7.push(colors1[0]);
- }
- else{
- if(colors1[0] === 'red' && colors1[3] === 'green'){
- colors6.push('purple');
- colors7.push('purple');
- }
-
- if(colors1[0] === 'red' && colors1[3] === 'purple'){
- colors6.push('green');
- colors7.push('green');
- }
-
- if(colors1[0] === 'green' && colors1[3] === 'purple'){
- colors6.push('red');
- colors7.push('red');
- }
- if(colors1[0] === 'green' && colors1[3] === 'red'){
- colors6.push('purple');
- colors7.push('purple');
- }
-
- if(colors1[0] === 'purple' && colors1[3] === 'red'){
- colors6.push('green');
- colors7.push('green');
- }
- if(colors1[0]=== 'purple' && colors1[3] === 'green'){
- colors6.push('red');
- colors7.push('red');
- }
- }
- if(shapes1[0] === shapes1 [3]){
- shapes6.push(shapes1[0]);
- shapes7.push(shapes1[0]);
- }
- else{
- if(shapes1[0] === 'oval' && shapes1[3] === 'diamond'){
- shapes6.push('wave');
- shapes7.push('wave');
- }
-
- if(shapes1[0] === 'oval' && shapes1[3] === 'wave'){
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
-
- if(shapes1[0] === 'diamond' && shapes1[3] === 'oval'){
- shapes6.push('wave');
- shapes7.push('wave');
- }
- if(shapes1[0] === 'diamond' && shapes1[3] === 'wave'){
- shapes6.push('oval');
- shapes7.push('oval');
- }
-
- if(shapes1[0] === 'wave' && shapes1[3] === 'diamond'){
- shapes6.push('oval');
- shapes7.push('oval');
- }
- if(shapes1[0] === 'wave' && shapes1[3] === 'oval'){
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
-
- }
- if(fills1[0] === fills1 [3]){
- fills6.push(fills1[0]);
- fills7.push(fills1[0]);
- }
- else{
- if(fills1[0] === 'solid' && fills1[3] === 'stripped'){
- fills6.push('open');
- fills7.push('open');
- }
-
- if(fills1[0] === 'solid' && fills1[3] === 'open'){
- fills6.push('stripped');
- fills7.push('stripped');
- }
-
- if(fills1[0] === 'stripped' && fills1[3] === 'open'){
- fills6.push('solid');
- fills7.push('solid');
- }
- if(fills1[0] === 'open' && fills1[3] === 'stripped'){
- fills6.push('solid');
- fills7.push('solid');
- }
-
- if(fills1[0] === 'stripped' && fills1[3] === 'solid'){
- fills6.push('open');
- fills7.push('open');
- }
- if(fills1[0] === 'open' && fills1[3] === 'solid'){
- fills6.push('stripped');
- fills7.push('stripped');
- }
- }
- if(borders1[0] === borders1 [3]){
- borders6.push(borders1[0]);
- borders7.push(borders1[0]);
- }
- else{
- if(borders1[0] === 'plein' && borders1[3] === 'point'){
- borders6.push('rond');
- borders7.push('rond');
- }
-
- if(borders1[0] === 'point' && borders1[3] === 'plein'){
- borders6.push('rond');
- borders7.push('rond');
- }
-
- if(borders1[0] === 'rond' && borders1[3] === 'plein'){
- borders6.push('point');
- borders7.push('point');
- }
- if(borders1[0] === 'plein' && borders1[3] === 'rond'){
- borders6.push('point');
- borders7.push('point');
- }
-
- if(borders1[0] === 'rond' && borders1[3] === 'point'){
- borders6.push('plein');
- borders7.push('plein');
- }
- if(borders1[0] === 'point' && borders1[3] === 'rond'){
- borders6.push('plein');
- borders7.push('plein');
- }
- }
-
- if(numbers1[0] === numbers1[3]){
- numbers6.push(numbers1[0]);
- numbers7.push(numbers1[0]);
- }
- else{
- if(numbers1[0] === 1 && numbers1[3] === 2){
- numbers6.push(3);
- numbers7.push(3);
- }
-
- if(numbers1[0] === 1 && numbers1[3] === 3){
- numbers6.push(2);
- numbers7.push(2);
- }
-
- if(numbers1[0] === 2 && numbers1[3] === 1){
- numbers6.push(3);
- numbers7.push(3);
- }
- if(numbers1[0] === 2 && numbers1[3] === 3){
- numbers6.push(1);
- numbers7.push(1);
- }
-
- if(numbers1[0] === 3 && numbers1[3] === 1){
- numbers6.push(2);
- numbers7.push(2);
- }
- if(numbers1[0] === 3 && numbers1[3] === 2){
- numbers6.push(1);
- numbers7.push(1);
- }
- }
- if(this.isSet(colors2) && this.isSet(shapes2) && this.isSet(fills2) && this.isSet(borders2) && this.isSet(numbers2)) {
- return this.isSet(colors3) && this.isSet(shapes3) && this.isSet(fills3) && this.isSet(borders3) && this.isSet(numbers3)
- }
- if(this.isSet(colors4) && this.isSet(shapes4) && this.isSet(fills4) && this.isSet(borders4) && this.isSet(numbers4)){
- return this.isSet(colors5)&& this.isSet(shapes5)&& this.isSet(fills5) && this.isSet(borders5) && this.isSet(numbers5)
- }
- if(this.isSet(colors6) && this.isSet(shapes6) && this.isSet(fills6) && this.isSet(borders6) && this.isSet(numbers6)) {
- return this.isSet(colors7) && this.isSet(shapes7) && this.isSet(fills7) && this.isSet(borders7) && this.isSet(numbers7)
- }
-
- },
-
-
- validateHyperSet2: function() {
-
-
- var carteABC = [];
- var carteDEF = [];
-
- var carteABD = [];
- var carteCEF = [];
-
- var carteABE = [];
- var carteCDF = [];
-
- var carteABF = [];
- var carteCDE = [];
-
- var carteACD = [];
- var carteBEF = [];
-
- var carteACE = [];
- var carteBDF = [];
-
- var carteACF = [];
- var carteBDE = [];
-
- var carteADE = [];
- var carteBCF = [];
-
- var carteADF = [];
- var carteBCE = [];
-
- var carteAEF = [];
- var carteBCD = [];
-
-
-
-
-
-
-
- carteABC.splice(0, 1, this.selectedHS2[0]);
- carteABC.splice(1, 1, this.selectedHS2[1]);
- carteABC.splice(2, 1, this.selectedHS2[2]);
- carteDEF.splice(0, 1, this.selectedHS2[3]);
- carteDEF.splice(1, 1, this.selectedHS2[4]);
- carteDEF.splice(2, 1, this.selectedHS2[5]);
-
- carteABD.splice(0, 1, this.selectedHS2[0]);
- carteABD.splice(1, 1, this.selectedHS2[1]);
- carteABD.splice(2, 1, this.selectedHS2[3]);
- carteCEF.splice(0, 1, this.selectedHS2[2]);
- carteCEF.splice(1, 1, this.selectedHS2[4]);
- carteCEF.splice(2, 1, this.selectedHS2[5]);
-
- carteABE.splice(0, 1, this.selectedHS2[0]);
- carteABE.splice(1, 1, this.selectedHS2[1]);
- carteABE.splice(2, 1, this.selectedHS2[4]);
- carteCDF.splice(0, 1, this.selectedHS2[2]);
- carteCDF.splice(1, 1, this.selectedHS2[3]);
- carteCDF.splice(2, 1, this.selectedHS2[5]);
-
- carteABF.splice(0, 1, this.selectedHS2[0]);
- carteABF.splice(1, 1, this.selectedHS2[1]);
- carteABF.splice(2, 1, this.selectedHS2[5]);
- carteCDE.splice(0, 1, this.selectedHS2[2]);
- carteCDE.splice(1, 1, this.selectedHS2[3]);
- carteCDE.splice(2, 1, this.selectedHS2[4]);
-
- carteACD.splice(0, 1, this.selectedHS2[0]);
- carteACD.splice(1, 1, this.selectedHS2[2]);
- carteACD.splice(2, 1, this.selectedHS2[3]);
- carteBEF.splice(0, 1, this.selectedHS2[1]);
- carteBEF.splice(1, 1, this.selectedHS2[4]);
- carteBEF.splice(2, 1, this.selectedHS2[5]);
-
- carteACE.splice(0, 1, this.selectedHS2[0]);
- carteACE.splice(1, 1, this.selectedHS2[2]);
- carteACE.splice(2, 1, this.selectedHS2[4]);
- carteBDF.splice(0, 1, this.selectedHS2[1]);
- carteBDF.splice(1, 1, this.selectedHS2[3]);
- carteBDF.splice(2, 1, this.selectedHS2[5]);
-
- carteACF.splice(0, 1, this.selectedHS2[0]);
- carteACF.splice(1, 1, this.selectedHS2[2]);
- carteACF.splice(2, 1, this.selectedHS2[5]);
- carteBDE.splice(0, 1, this.selectedHS2[1]);
- carteBDE.splice(1, 1, this.selectedHS2[3]);
- carteBDE.splice(2, 1, this.selectedHS2[4]);
-
- carteADE.splice(0, 1, this.selectedHS2[0]);
- carteADE.splice(1, 1, this.selectedHS2[3]);
- carteADE.splice(2, 1, this.selectedHS2[4]);
- carteBCF.splice(0, 1, this.selectedHS2[1]);
- carteBCF.splice(1, 1, this.selectedHS2[2]);
- carteBCF.splice(2, 1, this.selectedHS2[5]);
-
- carteADF.splice(0, 1, this.selectedHS2[0]);
- carteADF.splice(1, 1, this.selectedHS2[3]);
- carteADF.splice(2, 1, this.selectedHS2[5]);
- carteBCE.splice(0, 1, this.selectedHS2[1]);
- carteBCE.splice(1, 1, this.selectedHS2[2]);
- carteBCE.splice(2, 1, this.selectedHS2[4]);
-
- carteAEF.splice(0, 1, this.selectedHS2[0]);
- carteAEF.splice(1, 1, this.selectedHS2[4]);
- carteAEF.splice(2, 1, this.selectedHS2[5]);
- carteBCD.splice(0, 1, this.selectedHS2[1]);
- carteBCD.splice(1, 1, this.selectedHS2[2]);
- carteBCD.splice(2, 1, this.selectedHS2[3]);
-
-
- // modalité de toutes les 4 cartes
- var colors1= $.map(this.selectedHS2, function(el) { return $(el).data("color");});
- var shapes1 = $.map(this.selectedHS2, function(el) { return $(el).data("shape");});
- var fills1= $.map(this.selectedHS2,function(el) { return $(el).data("fill");});
- var numbers1 = $.map(this.selectedHS2, function(el) { return $(el).data("number");});
-
- console.log(colors1, shapes1, fills1, numbers1);
-
- // modalité des combinaison de carte (ab ac ad ...) pour verifier si forme un set
-
- var colors2 = $.map(carteABC, function(el) { return $(el).data("color");});
- var shapes2 = $.map(carteABC, function(el) { return $(el).data("shape");});
- var fills2 = $.map(carteABC, function(el) { return $(el).data("fill");});
- var numbers2 = $.map(carteABC, function(el) { return $(el).data("number");});
- var colors3 = $.map(carteDEF, function(el) { return $(el).data("color");});
- var shapes3 = $.map(carteDEF, function(el) { return $(el).data("shape");});
- var fills3 = $.map(carteDEF, function(el) { return $(el).data("fill");});
- var numbers3 = $.map(carteDEF, function(el) { return $(el).data("number");});
-
- var colors4 = $.map(carteABD, function(el) { return $(el).data("color");});
- var shapes4 = $.map(carteABD, function(el) { return $(el).data("shape");});
- var fills4 = $.map(carteABD, function(el) { return $(el).data("fill");});
- var numbers4 = $.map(carteABD, function(el) { return $(el).data("number");});
- var colors5 = $.map(carteCEF, function(el) { return $(el).data("color");});
- var shapes5 = $.map(carteCEF, function(el) { return $(el).data("shape");});
- var fills5 = $.map(carteCEF, function(el) { return $(el).data("fill");});
- var numbers5 = $.map(carteCEF, function(el) { return $(el).data("number");});
-
-
- var colors6 = $.map(carteABE, function(el) { return $(el).data("color");});
- var shapes6 = $.map(carteABE, function(el) { return $(el).data("shape");});
- var fills6 = $.map(carteABE, function(el) { return $(el).data("fill");});
- var numbers6 = $.map(carteABE, function(el) { return $(el).data("number");});
- var colors7 = $.map(carteCDF, function(el) { return $(el).data("color");});
- var shapes7 = $.map(carteCDF, function(el) { return $(el).data("shape");});
- var fills7 = $.map(carteCDF, function(el) { return $(el).data("fill");});
- var numbers7 = $.map(carteCDF, function(el) { return $(el).data("number");});
-
-
- var colors8 = $.map(carteABF, function(el) { return $(el).data("color");});
- var shapes8 = $.map(carteABF, function(el) { return $(el).data("shape");});
- var fills8 = $.map(carteABF, function(el) { return $(el).data("fill");});
- var numbers8 = $.map(carteABF, function(el) { return $(el).data("number");});
- var colors9 = $.map(carteCDE, function(el) { return $(el).data("color");});
- var shapes9 = $.map(carteCDE, function(el) { return $(el).data("shape");});
- var fills9 = $.map(carteCDE, function(el) { return $(el).data("fill");});
- var numbers9 = $.map(carteCDE, function(el) { return $(el).data("number");});
-
- var colors10 = $.map(carteACD, function(el) { return $(el).data("color");});
- var shapes10 = $.map(carteACD, function(el) { return $(el).data("shape");});
- var fills10 = $.map(carteACD, function(el) { return $(el).data("fill");});
- var numbers10 = $.map(carteACD, function(el) { return $(el).data("number");});
- var colors11 = $.map(carteBEF, function(el) { return $(el).data("color");});
- var shapes11 = $.map(carteBEF, function(el) { return $(el).data("shape");});
- var fills11 = $.map(carteBEF, function(el) { return $(el).data("fill");});
- var numbers11 = $.map(carteBEF, function(el) { return $(el).data("number");});
-
- var colors12 = $.map(carteACE,function(el) { return $(el).data("color");});
- var shapes12 = $.map(carteACE, function(el) { return $(el).data("shape");});
- var fills12 = $.map(carteACE, function(el) { return $(el).data("fill");});
- var numbers12 = $.map(carteACE, function(el) { return $(el).data("number");});
- var colors13 = $.map(carteBDF, function(el) { return $(el).data("color");});
- var shapes13 = $.map(carteBDF, function(el) { return $(el).data("shape");});
- var fills13 = $.map(carteBDF, function(el) { return $(el).data("fill");});
- var numbers13 = $.map(carteBDF, function(el) { return $(el).data("number");});
-
- var colors14 = $.map(carteACF, function(el) { return $(el).data("color");});
- var shapes14 = $.map(carteACF, function(el) { return $(el).data("shape");});
- var fills14 = $.map(carteACF, function(el) { return $(el).data("fill");});
- var numbers14 = $.map(carteACF, function(el) { return $(el).data("number");});
- var colors15 = $.map(carteBDE, function(el) { return $(el).data("color");});
- var shapes15 = $.map(carteBDE, function(el) { return $(el).data("shape");});
- var fills15 = $.map(carteBDE, function(el) { return $(el).data("fill");});
- var numbers15 = $.map(carteBDE, function(el) { return $(el).data("number");});
-
- var colors16 = $.map(carteADE, function(el) { return $(el).data("color");});
- var shapes16 = $.map(carteADE, function(el) { return $(el).data("shape");});
- var fills16 = $.map(carteADE, function(el) { return $(el).data("fill");});
- var numbers16 = $.map(carteADE, function(el) { return $(el).data("number");});
- var colors17 = $.map(carteBCF, function(el) { return $(el).data("color");});
- var shapes17 = $.map(carteBCF, function(el) { return $(el).data("shape");});
- var fills17 = $.map(carteBCF, function(el) { return $(el).data("fill");});
- var numbers17 = $.map(carteBCF, function(el) { return $(el).data("number");});
-
- var colors18 = $.map(carteADF, function(el) { return $(el).data("color");});
- var shapes18 = $.map(carteADF, function(el) { return $(el).data("shape");});
- var fills18 = $.map(carteADF, function(el) { return $(el).data("fill");});
- var numbers18 = $.map(carteADF, function(el) { return $(el).data("number");});
- var colors19 = $.map(carteBCE, function(el) { return $(el).data("color");});
- var shapes19 = $.map(carteBCE, function(el) { return $(el).data("shape");});
- var fills19 = $.map(carteBCE, function(el) { return $(el).data("fill");});
- var numbers19 = $.map(carteBCE, function(el) { return $(el).data("number");});
-
- var colors20 = $.map(carteAEF, function(el) { return $(el).data("color");});
- var shapes20 = $.map(carteAEF, function(el) { return $(el).data("shape");});
- var fills20 = $.map(carteAEF, function(el) { return $(el).data("fill");});
- var numbers20 = $.map(carteAEF, function(el) { return $(el).data("number");});
- var colors21 = $.map(carteBCD, function(el) { return $(el).data("color");});
- var shapes21 = $.map(carteBCD, function(el) { return $(el).data("shape");});
- var fills21 = $.map(carteBCD, function(el) { return $(el).data("fill");});
- var numbers21 = $.map(carteBCD, function(el) { return $(el).data("number");});
-
-
-
- if (colors1[0] === colors1[1] && colors1[0] === colors1[2]) {
- colors2.push(colors1[0]);
- colors3.push(colors1[0]);
- } else {
- if (colors1[0] === 'red' && colors1[1] === 'green' && colors1[2] === 'purple') {
- colors3.push('lightblue');
- colors2.push('lightblue');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'purple' && colors1[2] === 'green') {
- colors3.push('lightblue');
- colors2.push('lightblue');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'red' && colors1[2] === 'green') {
- colors3.push('lightblue');
- colors2.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'green' && colors1[2] === 'red') {
- colors3.push('lightblue');
- colors2.push('lightblue');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'purple' && colors1[2] === 'red') {
- colors3.push('lightblue');
- colors2.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[1] === 'red' && colors1[2] === 'purple') {
- colors3.push('lightblue');
- colors2.push('lightblue');
- }
-
-
- if (colors1[0] === 'green' && colors1[1] === 'purple' && colors1[2] === 'lightblue') {
- colors3.push('red');
- colors2.push('red');
-
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'lightblue' && colors1[2] === 'purple') {
- colors3.push('red');
- colors2.push('red');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'lightblue' && colors1[2] === 'green') {
- colors3.push('red');
- colors2.push('red');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'green' && colors1[2] === 'lightblue') {
- colors3.push('red');
- colors2.push('red');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'purple' && colors1[2] === 'green') {
- colors3.push('red');
- colors2.push('red');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'green' && colors1[2] === 'purple') {
- colors3.push('red');
- colors2.push('red');
- }
-
-
- if (colors1[0] === 'red' && colors1[1] === 'green' && colors1[2] === 'lightblue') {
- colors3.push('purple');
- colors2.push('purple');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'lightblue' && colors1[2] === 'green') {
- colors3.push('purple');
- colors2.push('purple');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'green' && colors1[2] === 'red') {
- colors3.push('purple');
- colors2.push('purple');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'red' && colors1[2] === 'green') {
- colors3.push('purple');
- colors2.push('purple');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'lightblue' && colors1[2] === 'red') {
- colors3.push('purple');
- colors2.push('purple');
- }
- if (colors1[0] === 'green' && colors1[1] === 'red' && colors1[2] === 'lightblue') {
- colors3.push('purple');
- colors2.push('purple');
- }
-
-
- if (colors1[0] === 'red' && colors1[1] === 'purple' && colors1[2] === 'lightblue') {
- colors3.push('green');
- colors2.push('green');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'lightblue' && colors1[2] === 'purple') {
- colors3.push('green');
- colors2.push('green');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'purple' && colors1[2] === 'red') {
- colors3.push('green');
- colors2.push('green');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'red' && colors1[2] === 'purple') {
- colors3.push('green');
- colors2.push('green');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'lightblue' && colors1[2] === 'red') {
- colors3.push('green');
- colors2.push('green');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'red' && colors1[2] === 'lightblue') {
- colors3.push('green');
- colors2.push('green');
- }
-
- }
-
-
- if (shapes1[0] === shapes1 [1] === shapes1 [2]) {
- shapes3.push(shapes1[0]);
- shapes2.push(shapes1[0]);
- } else {
- if (shapes1[0] === 'oval' && shapes1[1] === 'diamond' && shapes1[2] === 'wave') {
- shapes3.push('rectangle');
- shapes2.push('rectangle');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'wave' && shapes1[2] === 'diamond') {
- shapes3.push('rectangle');
- shapes2.push('rectangle');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'diamond' && shapes1[2] === 'oval') {
- shapes3.push('rectangle');
- shapes2.push('rectangle');
-
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'oval' && shapes1[2] === 'diamond') {
- shapes3.push('rectangle');
- shapes2.push('rectangle');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'oval' && shapes1[2] === 'wave') {
- shapes3.push('rectangle');
- shapes2.push('rectangle');
- }
- if (shapes1[0] === 'diamond' && shapes1[1] === 'wave' && shapes1[2] === 'oval') {
- shapes3.push('rectangle');
- shapes2.push('rectangle');
- }
-
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'diamond' && shapes1[2] === 'rectangle') {
- shapes3.push('wave');
- shapes2.push('wave');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'rectangle' && shapes1[2] === 'diamond') {
- shapes3.push('wave');
- shapes2.push('wave');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'oval' && shapes1[2] === 'diamond') {
- shapes3.push('wave');
- shapes2.push('wave');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'diamond' && shapes1[2] === 'oval') {
- shapes3.push('wave');
- shapes2.push('wave');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'oval' && shapes1[2] === 'rectangle') {
- shapes3.push('wave');
- shapes2.push('wave');
- }
- if (shapes1[0] === 'diamond' && shapes1[1] === 'rectangle' && shapes1[2] === 'oval') {
- shapes3.push('wave');
- shapes2.push('wave');
- }
-
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'wave' && shapes1[2] === 'rectangle') {
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'rectangle' && shapes1[2] === 'wave') {
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'wave' && shapes1[2] === 'oval') {
- shapes3.push('diamond');
- shapes2.push('diamond');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'oval' && shapes1[2] === 'wave') {
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'oval' && shapes1[2] === 'rectangle') {
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'rectangle' && shapes1[2] === 'oval') {
- shapes3.push('diamond');
- shapes2.push('diamond');
- }
-
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'wave' && shapes1[2] === 'rectangle') {
- shapes3.push('oval');
- shapes2.push('oval');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'rectangle' && shapes1[2] === 'wave') {
- shapes3.push('oval');
- shapes2.push('oval');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'wave' && shapes1[2] === 'diamond') {
- shapes3.push('oval');
- shapes2.push('oval');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'diamond' && shapes1[2] === 'wave') {
- shapes3.push('oval');
- shapes2.push('oval');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'diamond' && shapes1[2] === 'rectangle') {
- shapes3.push('oval');
- shapes2.push('oval');
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'rectangle' && shapes1[2] === 'diamond') {
- shapes3.push('oval');
- shapes2.push('oval');
- }
-
- }
- if (fills1[0] === fills1 [1] && fills1[0] === fills1 [2]) {
- fills3.push(fills1[0]);
- fills2.push(fills1[0]);
- } else {
- if (fills1[0] === 'solid' && fills1[1] === 'stripped' && fills1[2] === 'open') {
- fills3.push('quadrillage');
- fills2.push('quadrillage');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'open' && fills1[2] === 'stripped') {
- fills3.push('quadrillage');
- fills2.push('quadrillage');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'open' && fills1[2] === 'solid') {
- fills3.push('quadrillage');
- fills2.push('quadrillage');
- }
- if (fills1[0] === 'stripped' && fills1[1] === 'solid' && fills1[2] === 'open') {
- fills3.push('quadrillage');
- fills2.push('quadrillage');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'stripped' && fills1[2] === 'solid') {
- fills3.push('quadrillage');
- fills2.push('quadrillage');
- }
- if (fills1[0] === 'open' && fills1[1] === 'solid' && fills1[2] === 'stripped') {
- fills3.push('quadrillage');
- fills2.push('quadrillage');
- }
-
-
- if (fills1[0] === 'solid' && fills1[1] === 'stripped' && fills1[2] === 'quadrillage') {
- fills3.push('open');
- fills2.push('open');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'quadrillage' && fills1[2] === 'stripped') {
- fills3.push('open');
- fills2.push('open');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'solid' && fills1[2] === 'stripped') {
- fills3.push('open');
- fills2.push('open');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'stripped' && fills1[2] === 'solid') {
- fills3.push('open');
- fills2.push('open');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'quadrillage' && fills1[2] === 'solid') {
- fills3.push('open');
- fills2.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[1] === 'solid' && fills1[2] === 'quadrillage') {
- fills3.push('open');
- fills2.push('open');
- }
-
-
- if (fills1[0] === 'solid' && fills1[1] === 'open' && fills1[2] === 'quadrillage') {
- fills3.push('stripped');
- fills2.push('stripped');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'quadrillage' && fills1[2] === 'open') {
- fills3.push('stripped');
- fills2.push('stripped');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'solid' && fills1[2] === 'open') {
- fills3.push('stripped');
- fills2.push('stripped');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'open' && fills1[2] === 'solid') {
- fills3.push('stripped');
- fills2.push('stripped');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'quadrillage' && fills1[2] === 'solid') {
- fills3.push('stripped');
- fills2.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[1] === 'solid' && fills1[2] === 'quadrillage') {
- fills3.push('stripped');
- fills2.push('stripped');
- }
-
-
- if (fills1[0] === 'stripped' && fills1[1] === 'open' && fills1[2] === 'quadrillage') {
- fills3.push('solid');
- fills2.push('solid');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'quadrillage' && fills1[2] === 'open') {
- fills3.push('solid');
- fills2.push('solid');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'stripped' && fills1[2] === 'open') {
- fills3.push('solid');
- fills2.push('solid');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'open' && fills1[2] === 'stripped') {
- fills3.push('solid');
- fills2.push('solid');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'quadrillage' && fills1[2] === 'stripped') {
- fills3.push('solid');
- fills2.push('solid');
- }
- if (fills1[0] === 'open' && fills1[1] === 'stripped' && fills1[2] === 'quadrillage') {
- fills3.push('solid');
- fills2.push('solid');
- }
-
-
- }
- if (numbers1[0] === numbers1[1] && numbers1[0] === numbers1[2]) {
- numbers3.push(numbers1[0]);
- numbers2.push(numbers1[0]);
- } else {
- if (numbers1[0] === 1 && numbers1[1] === 2 && numbers1[2] === 3) {
- numbers3.push(4);
- numbers2.push(4);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 3 && numbers1[2] === 2) {
- numbers3.push(4);
- numbers2.push(4);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 1 && numbers1[2] === 3) {
- numbers3.push(4);
- numbers2.push(4);
- }
- if (numbers1[0] === 2 && numbers1[1] === 3 && numbers1[2] === 1) {
- numbers3.push(4);
- numbers2.push(4);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 1 && numbers1[2] === 2) {
- numbers3.push(4);
- numbers2.push(4);
- }
- if (numbers1[0] === 3 && numbers1[1] === 2 && numbers1[2] === 1) {
- numbers3.push(4);
- numbers2.push(4);
- }
-
-
- if (numbers1[0] === 1 && numbers1[1] === 2 && numbers1[2] === 4) {
- numbers3.push(3);
- numbers2.push(3);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 4 && numbers1[2] === 2) {
- numbers3.push(3);
- numbers2.push(3);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 1 && numbers1[2] === 4) {
- numbers3.push(3);
- numbers2.push(3);
- }
- if (numbers1[0] === 2 && numbers1[1] === 4 && numbers1[2] === 1) {
- numbers3.push(3);
- numbers2.push(3);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 1 && numbers1[2] === 2) {
- numbers3.push(3);
- numbers2.push(3);
- }
- if (numbers1[0] === 4 && numbers1[1] === 2 && numbers1[2] === 1) {
- numbers3.push(3);
- numbers2.push(3);
- }
-
-
- if (numbers1[0] === 1 && numbers1[1] === 3 && numbers1[2] === 4) {
- numbers3.push(2);
- numbers2.push(2);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 4 && numbers1[2] === 3) {
- numbers3.push(2);
- numbers2.push(2);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 1 && numbers1[2] === 4) {
- numbers3.push(2);
- numbers2.push(2);
- }
- if (numbers1[0] === 3 && numbers1[1] === 4 && numbers1[2] === 1) {
- numbers3.push(2);
- numbers2.push(2);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 1 && numbers1[2] === 3) {
- numbers3.push(2);
- numbers2.push(2);
- }
- if (numbers1[0] === 4 && numbers1[1] === 3 && numbers1[2] === 1) {
- numbers3.push(2);
- numbers2.push(2);
- }
-
-
- if (numbers1[0] === 2 && numbers1[1] === 3 && numbers1[2] === 4) {
- numbers3.push(1);
- numbers2.push(1);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 4 && numbers1[2] === 3) {
- numbers3.push(1);
- numbers2.push(1);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 2 && numbers1[2] === 4) {
- numbers3.push(1);
- numbers2.push(1);
- }
- if (numbers1[0] === 3 && numbers1[1] === 4 && numbers1[2] === 2) {
- numbers3.push(1);
- numbers2.push(1);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 2 && numbers1[2] === 3) {
- numbers3.push(1);
- numbers2.push(1);
- }
- if (numbers1[0] === 4 && numbers1[1] === 3 && numbers1[2] === 2) {
- numbers3.push(1);
- numbers2.push(1);
- }
- }
-
-
-
-
-
- if (colors1[0] === colors1 [1] && colors1[0] === colors1 [3]) {
- colors4.push(colors1[0]);
- colors5.push(colors1[0]);
- } else {
- if (colors1[0] === 'red' && colors1[1] === 'green' && colors1[3] === 'purple') {
- colors4.push('lightblue');
- colors5.push('lightblue');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'purple' && colors1[3] === 'green') {
- colors4.push('lightblue');
- colors5.push('lightblue');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'red' && colors1[3] === 'green') {
- colors4.push('lightblue');
- colors5.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'green' && colors1[3] === 'red') {
- colors4.push('lightblue');
- colors5.push('lightblue');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'purple' && colors1[3] === 'red') {
- colors4.push('lightblue');
- colors5.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[1] === 'red' && colors1[3] === 'purple') {
- colors4.push('lightblue');
- colors5.push('lightblue');
- }
-
-
- if (colors1[0] === 'green' && colors1[1] === 'purple' && colors1[3] === 'lightblue') {
- colors4.push('red');
- colors5.push('red');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'lightblue' && colors1[3] === 'purple') {
- colors4.push('red');
- colors5.push('red');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'lightblue' && colors1[3] === 'green') {
- colors4.push('red');
- colors5.push('red');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'green' && colors1[3] === 'lightblue') {
- colors4.push('red');
- colors5.push('red');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'purple' && colors1[3] === 'green') {
- colors4.push('red');
- colors5.push('red');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'green' && colors1[3] === 'purple') {
- colors4.push('red');
- colors5.push('red');
- }
-
-
- if (colors1[0] === 'red' && colors1[1] === 'green' && colors1[3] === 'lightblue') {
- colors4.push('purple');
- colors5.push('purple');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'lightblue' && colors1[3] === 'green') {
- colors4.push('purple');
- colors5.push('purple');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'green' && colors1[3] === 'red') {
- colors4.push('purple');
- colors5.push('purple');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'red' && colors1[3] === 'green') {
- colors4.push('purple');
- colors5.push('purple');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'lightblue' && colors1[3] === 'red') {
- colors4.push('purple');
- colors5.push('purple');
- }
- if (colors1[0] === 'green' && colors1[1] === 'red' && colors1[3] === 'lightblue') {
- colors4.push('purple');
- colors5.push('purple');
- }
-
-
- if (colors1[0] === 'red' && colors1[1] === 'purple' && colors1[3] === 'lightblue') {
- colors4.push('green');
- colors5.push('green');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'lightblue' && colors1[3] === 'purple') {
- colors4.push('green');
- colors5.push('green');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'purple' && colors1[3] === 'red') {
- colors4.push('green');
- colors5.push('green');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'red' && colors1[3] === 'purple') {
- colors4.push('green');
- colors5.push('green');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'lightblue' && colors1[3] === 'red') {
- colors4.push('green');
- colors5.push('green');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'red' && colors1[3] === 'lightblue') {
- colors4.push('green');
- colors5.push('green');
- }
-
- }
-
-
- if (shapes1[0] === shapes1 [1] && shapes1[0]=== shapes1 [3]) {
- shapes4.push(shapes1[0]);
- shapes5.push(shapes1[0]);
- } else {
- if (shapes1[0] === 'oval' && shapes1[1] === 'diamond' && shapes1[3] === 'wave') {
- shapes4.push('rectangle');
- shapes5.push('rectangle');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'wave' && shapes1[3] === 'diamond') {
- shapes4.push('rectangle');
- shapes5.push('rectangle');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'diamond' && shapes1[3] === 'oval') {
- shapes4.push('rectangle');
- shapes5.push('rectangle');
-
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'oval' && shapes1[3] === 'diamond') {
- shapes4.push('rectangle');
- shapes5.push('rectangle');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'oval' && shapes1[3] === 'wave') {
- shapes4.push('rectangle');
- shapes5.push('rectangle');
- }
- if (shapes1[0] === 'diamond' && shapes1[1] === 'wave' && shapes1[3] === 'oval') {
- shapes4.push('rectangle');
- shapes5.push('rectangle');
- }
-
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'diamond' && shapes1[3] === 'rectangle') {
- shapes4.push('wave');
- shapes5.push('wave');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'rectangle' && shapes1[3] === 'diamond') {
- shapes4.push('wave');
- shapes5.push('wave');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'oval' && shapes1[3] === 'diamond') {
- shapes4.push('wave');
- shapes5.push('wave');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'diamond' && shapes1[3] === 'oval') {
- shapes4.push('wave');
- shapes5.push('wave');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'oval' && shapes1[3] === 'rectangle') {
- shapes4.push('wave');
- shapes5.push('wave');
- }
- if (shapes1[0] === 'diamond' && shapes1[1] === 'rectangle' && shapes1[3] === 'oval') {
- shapes4.push('wave');
- shapes5.push('wave');
- }
-
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'wave' && shapes1[3] === 'rectangle') {
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'rectangle' && shapes1[3] === 'wave') {
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'wave' && shapes1[3] === 'oval') {
- shapes4.push('diamond');
- shapes5.push('diamond');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'oval' && shapes1[3] === 'wave') {
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'oval' && shapes1[3] === 'rectangle') {
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'rectangle' && shapes1[3] === 'oval') {
- shapes4.push('diamond');
- shapes5.push('diamond');
- }
-
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'wave' && shapes1[3] === 'rectangle') {
- shapes4.push('oval');
- shapes5.push('oval');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'rectangle' && shapes1[3] === 'wave') {
- shapes4.push('oval');
- shapes5.push('oval');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'wave' && shapes1[3] === 'diamond') {
- shapes4.push('oval');
- shapes5.push('oval');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'diamond' && shapes1[3] === 'wave') {
- shapes4.push('oval');
- shapes5.push('oval');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'diamond' && shapes1[3] === 'rectangle') {
- shapes4.push('oval');
- shapes5.push('oval');
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'rectangle' && shapes1[3] === 'diamond') {
- shapes4.push('oval');
- shapes5.push('oval');
- }
-
- }
- if (fills1[0] === fills1 [1] && fills1[0] === fills1 [3]) {
- fills4.push(fills1[0]);
- fills5.push(fills1[0]);
- } else {
- if (fills1[0] === 'solid' && fills1[1] === 'stripped' && fills1[3] === 'open') {
- fills4.push('quadrillage');
- fills5.push('quadrillage');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'open' && fills1[3] === 'stripped') {
- fills4.push('quadrillage');
- fills5.push('quadrillage');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'open' && fills1[3] === 'solid') {
- fills4.push('quadrillage');
- fills5.push('quadrillage');
- }
- if (fills1[0] === 'stripped' && fills1[1] === 'solid' && fills1[3] === 'open') {
- fills4.push('quadrillage');
- fills5.push('quadrillage');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'stripped' && fills1[3] === 'solid') {
- fills4.push('quadrillage');
- fills5.push('quadrillage');
- }
- if (fills1[0] === 'open' && fills1[1] === 'solid' && fills1[3] === 'stripped') {
- fills4.push('quadrillage');
- fills5.push('quadrillage');
- }
-
-
- if (fills1[0] === 'solid' && fills1[1] === 'stripped' && fills1[3] === 'quadrillage') {
- fills4.push('open');
- fills5.push('open');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'quadrillage' && fills1[3] === 'stripped') {
- fills4.push('open');
- fills5.push('open');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'solid' && fills1[3] === 'stripped') {
- fills4.push('open');
- fills5.push('open');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'stripped' && fills1[3] === 'solid') {
- fills4.push('open');
- fills5.push('open');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'quadrillage' && fills1[3] === 'solid') {
- fills4.push('open');
- fills5.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[1] === 'solid' && fills1[3] === 'quadrillage') {
- fills4.push('open');
- fills5.push('open');
- }
-
-
- if (fills1[0] === 'solid' && fills1[1] === 'open' && fills1[3] === 'quadrillage') {
- fills4.push('stripped');
- fills5.push('stripped');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'quadrillage' && fills1[3] === 'open') {
- fills4.push('stripped');
- fills5.push('stripped');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'solid' && fills1[3] === 'open') {
- fills4.push('stripped');
- fills5.push('stripped');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'open' && fills1[3] === 'solid') {
- fills4.push('stripped');
- fills5.push('stripped');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'quadrillage' && fills1[3] === 'solid') {
- fills4.push('stripped');
- fills5.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[1] === 'solid' && fills1[3] === 'quadrillage') {
- fills4.push('stripped');
- fills5.push('stripped');
- }
-
-
- if (fills1[0] === 'stripped' && fills1[1] === 'open' && fills1[3] === 'quadrillage') {
- fills4.push('solid');
- fills5.push('solid');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'quadrillage' && fills1[3] === 'open') {
- fills4.push('solid');
- fills5.push('solid');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'stripped' && fills1[3] === 'open') {
- fills4.push('solid');
- fills5.push('solid');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'open' && fills1[3] === 'stripped') {
- fills4.push('solid');
- fills5.push('solid');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'quadrillage' && fills1[3] === 'stripped') {
- fills4.push('solid');
- fills5.push('solid');
- }
- if (fills1[0] === 'open' && fills1[1] === 'stripped' && fills1[3] === 'quadrillage') {
- fills4.push('solid');
- fills5.push('solid');
- }
-
-
- }
- if (numbers1[0] === numbers1[1] && numbers1[0] === numbers1[3]) {
- numbers4.push(numbers1[0]);
- numbers5.push(numbers1[0]);
- } else {
- if (numbers1[0] === 1 && numbers1[1] === 2 && numbers1[3] === 3) {
- numbers4.push(4);
- numbers5.push(4);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 3 && numbers1[3] === 2) {
- numbers4.push(4);
- numbers5.push(4);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 1 && numbers1[3] === 3) {
- numbers4.push(4);
- numbers5.push(4);
- }
- if (numbers1[0] === 2 && numbers1[1] === 3 && numbers1[3] === 1) {
- numbers4.push(4);
- numbers5.push(4);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 1 && numbers1[3] === 2) {
- numbers4.push(4);
- numbers5.push(4);
- }
- if (numbers1[0] === 3 && numbers1[1] === 2 && numbers1[3] === 1) {
- numbers4.push(4);
- numbers5.push(4);
- }
-
-
- if (numbers1[0] === 1 && numbers1[1] === 2 && numbers1[3] === 4) {
- numbers4.push(3);
- numbers5.push(3);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 4 && numbers1[3] === 2) {
- numbers4.push(3);
- numbers5.push(3);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 1 && numbers1[3] === 4) {
- numbers4.push(3);
- numbers5.push(3);
- }
- if (numbers1[0] === 2 && numbers1[1] === 4 && numbers1[3] === 1) {
- numbers4.push(3);
- numbers5.push(3);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 1 && numbers1[3] === 2) {
- numbers4.push(3);
- numbers5.push(3);
- }
- if (numbers1[0] === 4 && numbers1[1] === 2 && numbers1[3] === 1) {
- numbers4.push(3);
- numbers5.push(3);
- }
-
-
- if (numbers1[0] === 1 && numbers1[1] === 3 && numbers1[3] === 4) {
- numbers4.push(2);
- numbers5.push(2);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 4 && numbers1[3] === 3) {
- numbers4.push(2);
- numbers5.push(2);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 1 && numbers1[3] === 4) {
- numbers4.push(2);
- numbers5.push(2);
- }
- if (numbers1[0] === 3 && numbers1[1] === 4 && numbers1[3] === 1) {
- numbers4.push(2);
- numbers5.push(2);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 1 && numbers1[3] === 3) {
- numbers4.push(2);
- numbers5.push(2);
- }
- if (numbers1[0] === 4 && numbers1[1] === 3 && numbers1[3] === 1) {
- numbers4.push(2);
- numbers5.push(2);
- }
-
-
- if (numbers1[0] === 2 && numbers1[1] === 3 && numbers1[3] === 4) {
- numbers4.push(1);
- numbers5.push(1);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 4 && numbers1[3] === 3) {
- numbers4.push(1);
- numbers5.push(1);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 2 && numbers1[3] === 4) {
- numbers4.push(1);
- numbers5.push(1);
- }
- if (numbers1[0] === 3 && numbers1[1] === 4 && numbers1[3] === 2) {
- numbers4.push(1);
- numbers5.push(1);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 2 && numbers1[3] === 3) {
- numbers4.push(1);
- numbers5.push(1);
- }
- if (numbers1[0] === 4 && numbers1[1] === 3 && numbers1[3] === 2) {
- numbers4.push(1);
- numbers5.push(1);
- }
- }
-
-
-
-// ABE
-
-
- if (colors1[0] === colors1 [1] && colors1[0] === colors1 [4]) {
- colors6.push(colors1[0]);
- colors7.push(colors1[0]);
- } else {
- if (colors1[0] === 'red' && colors1[1] === 'green' && colors1[4] === 'purple') {
- colors6.push('lightblue');
- colors7.push('lightblue');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'purple' && colors1[4] === 'green') {
- colors6.push('lightblue');
- colors7.push('lightblue');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'red' && colors1[4] === 'green') {
- colors6.push('lightblue');
- colors7.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'green' && colors1[4] === 'red') {
- colors6.push('lightblue');
- colors7.push('lightblue');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'purple' && colors1[4] === 'red') {
- colors6.push('lightblue');
- colors7.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[1] === 'red' && colors1[4] === 'purple') {
- colors6.push('lightblue');
- colors7.push('lightblue');
- }
-
-
- if (colors1[0] === 'green' && colors1[1] === 'purple' && colors1[4] === 'lightblue') {
- colors6.push('red');
- colors7.push('red');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'lightblue' && colors1[4] === 'purple') {
- colors6.push('red');
- colors7.push('red');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'lightblue' && colors1[4] === 'green') {
- colors6.push('red');
- colors7.push('red');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'green' && colors1[4] === 'lightblue') {
- colors6.push('red');
- colors7.push('red');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'purple' && colors1[4] === 'green') {
- colors6.push('red');
- colors7.push('red');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'green' && colors1[4] === 'purple') {
- colors6.push('red');
- colors7.push('red');
- }
-
-
- if (colors1[0] === 'red' && colors1[1] === 'green' && colors1[4] === 'lightblue') {
- colors6.push('purple');
- colors7.push('purple');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'lightblue' && colors1[4] === 'green') {
- colors6.push('purple');
- colors7.push('purple');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'green' && colors1[4] === 'red') {
- colors6.push('purple');
- colors7.push('purple');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'red' && colors1[4] === 'green') {
- colors6.push('purple');
- colors7.push('purple');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'lightblue' && colors1[4] === 'red') {
- colors6.push('purple');
- colors7.push('purple');
- }
- if (colors1[0] === 'green' && colors1[1] === 'red' && colors1[4] === 'lightblue') {
- colors6.push('purple');
- colors7.push('purple');
- }
-
-
- if (colors1[0] === 'red' && colors1[1] === 'purple' && colors1[4] === 'lightblue') {
- colors6.push('green');
- colors7.push('green');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'lightblue' && colors1[4] === 'purple') {
- colors6.push('green');
- colors7.push('green');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'purple' && colors1[4] === 'red') {
- colors6.push('green');
- colors7.push('green');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'red' && colors1[4] === 'purple') {
- colors6.push('green');
- colors7.push('green');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'lightblue' && colors1[4] === 'red') {
- colors6.push('green');
- colors7.push('green');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'red' && colors1[4] === 'lightblue') {
- colors6.push('green');
- colors7.push('green');
- }
-
- }
-
-
- if (shapes1[0] === shapes1 [1] && shapes1[0] === shapes1 [4]) {
- shapes6.push(shapes1[0]);
- shapes7.push(shapes1[0]);
- } else {
- if (shapes1[0] === 'oval' && shapes1[1] === 'diamond' && shapes1[4] === 'wave') {
- shapes6.push('rectangle');
- shapes7.push('rectangle');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'wave' && shapes1[4] === 'diamond') {
- shapes6.push('rectangle');
- shapes7.push('rectangle');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'diamond' && shapes1[4] === 'oval') {
- shapes6.push('rectangle');
- shapes7.push('rectangle');
-
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'oval' && shapes1[4] === 'diamond') {
- shapes6.push('rectangle');
- shapes7.push('rectangle');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'oval' && shapes1[4] === 'wave') {
- shapes6.push('rectangle');
- shapes7.push('rectangle');
- }
- if (shapes1[0] === 'diamond' && shapes1[1] === 'wave' && shapes1[4] === 'oval') {
- shapes6.push('rectangle');
- shapes7.push('rectangle');
- }
-
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'diamond' && shapes1[4] === 'rectangle') {
- shapes6.push('wave');
- shapes7.push('wave');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'rectangle' && shapes1[4] === 'diamond') {
- shapes6.push('wave');
- shapes7.push('wave');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'oval' && shapes1[4] === 'diamond') {
- shapes6.push('wave');
- shapes7.push('wave');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'diamond' && shapes1[4] === 'oval') {
- shapes6.push('wave');
- shapes7.push('wave');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'oval' && shapes1[4] === 'rectangle') {
- shapes6.push('wave');
- shapes7.push('wave');
- }
- if (shapes1[0] === 'diamond' && shapes1[1] === 'rectangle' && shapes1[4] === 'oval') {
- shapes6.push('wave');
- shapes7.push('wave');
- }
-
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'wave' && shapes1[4] === 'rectangle') {
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'rectangle' && shapes1[4] === 'wave') {
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'wave' && shapes1[4] === 'oval') {
- shapes6.push('diamond');
- shapes7.push('diamond');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'oval' && shapes1[4] === 'wave') {
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'oval' && shapes1[4] === 'rectangle') {
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'rectangle' && shapes1[4] === 'oval') {
- shapes6.push('diamond');
- shapes7.push('diamond');
- }
-
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'wave' && shapes1[4] === 'rectangle') {
- shapes6.push('oval');
- shapes7.push('oval');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'rectangle' && shapes1[4] === 'wave') {
- shapes6.push('oval');
- shapes7.push('oval');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'wave' && shapes1[4] === 'diamond') {
- shapes6.push('oval');
- shapes7.push('oval');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'diamond' && shapes1[4] === 'wave') {
- shapes6.push('oval');
- shapes7.push('oval');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'diamond' && shapes1[4] === 'rectangle') {
- shapes6.push('oval');
- shapes7.push('oval');
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'rectangle' && shapes1[4] === 'diamond') {
- shapes6.push('oval');
- shapes7.push('oval');
- }
-
- }
- if (fills1[0] === fills1[1] && fills1[0] === fills1[4]) {
- fills6.push(fills1[0]);
- fills7.push(fills1[0]);
- } else {
- if (fills1[0] === 'solid' && fills1[1] === 'stripped' && fills1[4] === 'open') {
- fills6.push('quadrillage');
- fills7.push('quadrillage');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'open' && fills1[4] === 'stripped') {
- fills6.push('quadrillage');
- fills7.push('quadrillage');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'open' && fills1[4] === 'solid') {
- fills6.push('quadrillage');
- fills7.push('quadrillage');
- }
- if (fills1[0] === 'stripped' && fills1[1] === 'solid' && fills1[4] === 'open') {
- fills6.push('quadrillage');
- fills7.push('quadrillage');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'stripped' && fills1[4] === 'solid') {
- fills6.push('quadrillage');
- fills7.push('quadrillage');
- }
- if (fills1[0] === 'open' && fills1[1] === 'solid' && fills1[4] === 'stripped') {
- fills6.push('quadrillage');
- fills7.push('quadrillage');
- }
-
-
- if (fills1[0] === 'solid' && fills1[1] === 'stripped' && fills1[4] === 'quadrillage') {
- fills6.push('open');
- fills7.push('open');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'quadrillage' && fills1[4] === 'stripped') {
- fills6.push('open');
- fills7.push('open');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'solid' && fills1[4] === 'stripped') {
- fills6.push('open');
- fills7.push('open');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'stripped' && fills1[4] === 'solid') {
- fills6.push('open');
- fills7.push('open');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'quadrillage' && fills1[4] === 'solid') {
- fills6.push('open');
- fills7.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[1] === 'solid' && fills1[4] === 'quadrillage') {
- fills6.push('open');
- fills7.push('open');
- }
-
-
- if (fills1[0] === 'solid' && fills1[1] === 'open' && fills1[4] === 'quadrillage') {
- fills6.push('stripped');
- fills7.push('stripped');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'quadrillage' && fills1[4] === 'open') {
- fills6.push('stripped');
- fills7.push('stripped');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'solid' && fills1[4] === 'open') {
- fills6.push('stripped');
- fills7.push('stripped');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'open' && fills1[4] === 'solid') {
- fills6.push('stripped');
- fills7.push('stripped');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'quadrillage' && fills1[4] === 'solid') {
- fills6.push('stripped');
- fills7.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[1] === 'solid' && fills1[4] === 'quadrillage') {
- fills6.push('stripped');
- fills7.push('stripped');
- }
-
-
- if (fills1[0] === 'stripped' && fills1[1] === 'open' && fills1[4] === 'quadrillage') {
- fills6.push('solid');
- fills7.push('solid');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'quadrillage' && fills1[4] === 'open') {
- fills6.push('solid');
- fills7.push('solid');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'stripped' && fills1[4] === 'open') {
- fills6.push('solid');
- fills7.push('solid');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'open' && fills1[4] === 'stripped') {
- fills6.push('solid');
- fills7.push('solid');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'quadrillage' && fills1[4] === 'stripped') {
- fills6.push('solid');
- fills7.push('solid');
- }
- if (fills1[0] === 'open' && fills1[1] === 'stripped' && fills1[4] === 'quadrillage') {
- fills6.push('solid');
- fills7.push('solid');
- }
-
-
- }
- if (numbers1[0] === numbers1[1] && numbers1[0] === numbers1[4]) {
- numbers6.push(numbers1[0]);
- numbers7.push(numbers1[0]);
- } else {
- if (numbers1[0] === 1 && numbers1[1] === 2 && numbers1[4] === 3) {
- numbers6.push(4);
- numbers7.push(4);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 3 && numbers1[4] === 2) {
- numbers6.push(4);
- numbers7.push(4);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 1 && numbers1[4] === 3) {
- numbers6.push(4);
- numbers7.push(4);
- }
- if (numbers1[0] === 2 && numbers1[1] === 3 && numbers1[4] === 1) {
- numbers6.push(4);
- numbers7.push(4);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 1 && numbers1[4] === 2) {
- numbers6.push(4);
- numbers7.push(4);
- }
- if (numbers1[0] === 3 && numbers1[1] === 2 && numbers1[4] === 1) {
- numbers6.push(4);
- numbers7.push(4);
- }
-
-
- if (numbers1[0] === 1 && numbers1[1] === 2 && numbers1[4] === 4) {
- numbers6.push(3);
- numbers7.push(3);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 4 && numbers1[4] === 2) {
- numbers6.push(3);
- numbers7.push(3);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 1 && numbers1[4] === 4) {
- numbers6.push(3);
- numbers7.push(3);
- }
- if (numbers1[0] === 2 && numbers1[1] === 4 && numbers1[4] === 1) {
- numbers6.push(3);
- numbers7.push(3);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 1 && numbers1[4] === 2) {
- numbers6.push(3);
- numbers7.push(3);
- }
- if (numbers1[0] === 4 && numbers1[1] === 2 && numbers1[4] === 1) {
- numbers6.push(3);
- numbers7.push(3);
- }
-
-
- if (numbers1[0] === 1 && numbers1[1] === 3 && numbers1[4] === 4) {
- numbers6.push(2);
- numbers7.push(2);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 4 && numbers1[4] === 3) {
- numbers6.push(2);
- numbers7.push(2);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 1 && numbers1[4] === 4) {
- numbers6.push(2);
- numbers7.push(2);
- }
- if (numbers1[0] === 3 && numbers1[1] === 4 && numbers1[4] === 1) {
- numbers6.push(2);
- numbers7.push(2);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 1 && numbers1[4] === 3) {
- numbers6.push(2);
- numbers7.push(2);
- }
- if (numbers1[0] === 4 && numbers1[1] === 3 && numbers1[4] === 1) {
- numbers6.push(2);
- numbers7.push(2);
- }
-
-
- if (numbers1[0] === 2 && numbers1[1] === 3 && numbers1[4] === 4) {
- numbers6.push(1);
- numbers7.push(1);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 4 && numbers1[4] === 3) {
- numbers6.push(1);
- numbers7.push(1);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 2 && numbers1[4] === 4) {
- numbers6.push(1);
- numbers7.push(1);
- }
- if (numbers1[0] === 3 && numbers1[1] === 4 && numbers1[4] === 2) {
- numbers6.push(1);
- numbers7.push(1);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 2 && numbers1[4] === 3) {
- numbers6.push(1);
- numbers7.push(1);
- }
- if (numbers1[0] === 4 && numbers1[1] === 3 && numbers1[4] === 2) {
- numbers6.push(1);
- numbers7.push(1);
- }
- }
-
-
-
-
-
- if (colors1[0] === colors1 [1] && colors1[0] === colors1 [5]) {
- colors8.push(colors1[0]);
- colors9.push(colors1[0]);
- } else {
- if (colors1[0] === 'red' && colors1[1] === 'green' && colors1[5] === 'purple') {
- colors8.push('lightblue');
- colors9.push('lightblue');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'purple' && colors1[5] === 'green') {
- colors8.push('lightblue');
- colors9.push('lightblue');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'red' && colors1[5] === 'green') {
- colors8.push('lightblue');
- colors9.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'green' && colors1[5] === 'red') {
- colors8.push('lightblue');
- colors9.push('lightblue');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'purple' && colors1[5] === 'red') {
- colors8.push('lightblue');
- colors9.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[1] === 'red' && colors1[5] === 'purple') {
- colors8.push('lightblue');
- colors9.push('lightblue');
- }
-
-
- if (colors1[0] === 'green' && colors1[1] === 'purple' && colors1[5] === 'lightblue') {
- colors8.push('red');
- colors9.push('red');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'lightblue' && colors1[5] === 'purple') {
- colors8.push('red');
- colors9.push('red');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'lightblue' && colors1[5] === 'green') {
- colors8.push('red');
- colors9.push('red');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'green' && colors1[5] === 'lightblue') {
- colors8.push('red');
- colors9.push('red');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'purple' && colors1[5] === 'green') {
- colors8.push('red');
- colors9.push('red');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'green' && colors1[5] === 'purple') {
- colors8.push('red');
- colors9.push('red');
- }
-
-
- if (colors1[0] === 'red' && colors1[1] === 'green' && colors1[5] === 'lightblue') {
- colors8.push('purple');
- colors9.push('purple');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'lightblue' && colors1[5] === 'green') {
- colors8.push('purple');
- colors9.push('purple');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'green' && colors1[5] === 'red') {
- colors8.push('purple');
- colors9.push('purple');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'red' && colors1[5] === 'green') {
- colors8.push('purple');
- colors9.push('purple');
- }
-
- if (colors1[0] === 'green' && colors1[1] === 'lightblue' && colors1[5] === 'red') {
- colors8.push('purple');
- colors9.push('purple');
- }
- if (colors1[0] === 'green' && colors1[1] === 'red' && colors1[5] === 'lightblue') {
- colors8.push('purple');
- colors9.push('purple');
- }
-
-
- if (colors1[0] === 'red' && colors1[1] === 'purple' && colors1[5] === 'lightblue') {
- colors8.push('green');
- colors9.push('green');
- }
-
- if (colors1[0] === 'red' && colors1[1] === 'lightblue' && colors1[5] === 'purple') {
- colors8.push('green');
- colors9.push('green');
- }
-
- if (colors1[0] === 'lightblue' && colors1[1] === 'purple' && colors1[5] === 'red') {
- colors8.push('green');
- colors9.push('green');
- }
- if (colors1[0] === 'lightblue' && colors1[1] === 'red' && colors1[5] === 'purple') {
- colors8.push('green');
- colors9.push('green');
- }
-
- if (colors1[0] === 'purple' && colors1[1] === 'lightblue' && colors1[5] === 'red') {
- colors8.push('green');
- colors9.push('green');
- }
- if (colors1[0] === 'purple' && colors1[1] === 'red' && colors1[5] === 'lightblue') {
- colors8.push('green');
- colors9.push('green');
- }
-
- }
-
-
- if (shapes1[0] === shapes1 [1] && shapes1[0] === shapes1 [5]) {
- shapes8.push(shapes1[0]);
- shapes9.push(shapes1[0]);
- } else {
- if (shapes1[0] === 'oval' && shapes1[1] === 'diamond' && shapes1[5] === 'wave') {
- shapes8.push('rectangle');
- shapes9.push('rectangle');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'wave' && shapes1[5] === 'diamond') {
- shapes8.push('rectangle');
- shapes9.push('rectangle');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'diamond' && shapes1[5] === 'oval') {
- shapes8.push('rectangle');
- shapes9.push('rectangle');
-
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'oval' && shapes1[5] === 'diamond') {
- shapes8.push('rectangle');
- shapes9.push('rectangle');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'oval' && shapes1[5] === 'wave') {
- shapes8.push('rectangle');
- shapes9.push('rectangle');
- }
- if (shapes1[0] === 'diamond' && shapes1[1] === 'wave' && shapes1[5] === 'oval') {
- shapes8.push('rectangle');
- shapes9.push('rectangle');
- }
-
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'diamond' && shapes1[5] === 'rectangle') {
- shapes8.push('wave');
- shapes9.push('wave');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'rectangle' && shapes1[5] === 'diamond') {
- shapes8.push('wave');
- shapes9.push('wave');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'oval' && shapes1[5] === 'diamond') {
- shapes8.push('wave');
- shapes9.push('wave');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'diamond' && shapes1[5] === 'oval') {
- shapes8.push('wave');
- shapes9.push('wave');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'oval' && shapes1[5] === 'rectangle') {
- shapes8.push('wave');
- shapes9.push('wave');
- }
- if (shapes1[0] === 'diamond' && shapes1[1] === 'rectangle' && shapes1[5] === 'oval') {
- shapes8.push('wave');
- shapes9.push('wave');
- }
-
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'wave' && shapes1[5] === 'rectangle') {
- shapes8.push('diamond');
- shapes9.push('diamond');
- }
-
- if (shapes1[0] === 'oval' && shapes1[1] === 'rectangle' && shapes1[5] === 'wave') {
- shapes8.push('diamond');
- shapes9.push('diamond');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'wave' && shapes1[5] === 'oval') {
- shapes8.push('diamond');
- shapes9.push('diamond');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'oval' && shapes1[5] === 'wave') {
- shapes8.push('diamond');
- shapes9.push('diamond');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'oval' && shapes1[5] === 'rectangle') {
- shapes8.push('diamond');
- shapes9.push('diamond');
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'rectangle' && shapes1[5] === 'oval') {
- shapes8.push('diamond');
- shapes9.push('diamond');
- }
-
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'wave' && shapes1[5] === 'rectangle') {
- shapes8.push('oval');
- shapes9.push('oval');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[1] === 'rectangle' && shapes1[5] === 'wave') {
- shapes8.push('oval');
- shapes9.push('oval');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'wave' && shapes1[5] === 'diamond') {
- shapes8.push('oval');
- shapes9.push('oval');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[1] === 'diamond' && shapes1[5] === 'wave') {
- shapes8.push('oval');
- shapes9.push('oval');
- }
-
- if (shapes1[0] === 'wave' && shapes1[1] === 'diamond' && shapes1[5] === 'rectangle') {
- shapes8.push('oval');
- shapes9.push('oval');
- }
- if (shapes1[0] === 'wave' && shapes1[1] === 'rectangle' && shapes1[5] === 'diamond') {
- shapes8.push('oval');
- shapes9.push('oval');
- }
-
- }
- if (fills1[0] === fills1 [1] && fills1[0] === fills1 [5]) {
- fills8.push(fills1[0]);
- fills9.push(fills1[0]);
- } else {
- if (fills1[0] === 'solid' && fills1[1] === 'stripped' && fills1[5] === 'open') {
- fills8.push('quadrillage');
- fills9.push('quadrillage');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'open' && fills1[5] === 'stripped') {
- fills8.push('quadrillage');
- fills9.push('quadrillage');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'open' && fills1[5] === 'solid') {
- fills8.push('quadrillage');
- fills9.push('quadrillage');
- }
- if (fills1[0] === 'stripped' && fills1[1] === 'solid' && fills1[5] === 'open') {
- fills8.push('quadrillage');
- fills9.push('quadrillage');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'stripped' && fills1[5] === 'solid') {
- fills8.push('quadrillage');
- fills9.push('quadrillage');
- }
- if (fills1[0] === 'open' && fills1[1] === 'solid' && fills1[5] === 'stripped') {
- fills8.push('quadrillage');
- fills9.push('quadrillage');
- }
-
-
- if (fills1[0] === 'solid' && fills1[1] === 'stripped' && fills1[5] === 'quadrillage') {
- fills8.push('open');
- fills9.push('open');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'quadrillage' && fills1[5] === 'stripped') {
- fills8.push('open');
- fills9.push('open');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'solid' && fills1[5] === 'stripped') {
- fills8.push('open');
- fills9.push('open');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'stripped' && fills1[5] === 'solid') {
- fills8.push('open');
- fills9.push('open');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'quadrillage' && fills1[5] === 'solid') {
- fills8.push('open');
- fills9.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[1] === 'solid' && fills1[5] === 'quadrillage') {
- fills8.push('open');
- fills9.push('open');
- }
-
-
- if (fills1[0] === 'solid' && fills1[1] === 'open' && fills1[5] === 'quadrillage') {
- fills8.push('stripped');
- fills9.push('stripped');
- }
-
- if (fills1[0] === 'solid' && fills1[1] === 'quadrillage' && fills1[5] === 'open') {
- fills8.push('stripped');
- fills9.push('stripped');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'solid' && fills1[5] === 'open') {
- fills8.push('stripped');
- fills9.push('stripped');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'open' && fills1[5] === 'solid') {
- fills8.push('stripped');
- fills9.push('stripped');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'quadrillage' && fills1[5] === 'solid') {
- fills8.push('stripped');
- fills9.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[1] === 'solid' && fills1[5] === 'quadrillage') {
- fills8.push('stripped');
- fills9.push('stripped');
- }
-
-
- if (fills1[0] === 'stripped' && fills1[1] === 'open' && fills1[5] === 'quadrillage') {
- fills8.push('solid');
- fills9.push('solid');
- }
-
- if (fills1[0] === 'stripped' && fills1[1] === 'quadrillage' && fills1[5] === 'open') {
- fills8.push('solid');
- fills9.push('solid');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[1] === 'stripped' && fills1[5] === 'open') {
- fills8.push('solid');
- fills9.push('solid');
- }
- if (fills1[0] === 'quadrillage' && fills1[1] === 'open' && fills1[5] === 'stripped') {
- fills8.push('solid');
- fills9.push('solid');
- }
-
- if (fills1[0] === 'open' && fills1[1] === 'quadrillage' && fills1[5] === 'stripped') {
- fills8.push('solid');
- fills9.push('solid');
- }
- if (fills1[0] === 'open' && fills1[1] === 'stripped' && fills1[5] === 'quadrillage') {
- fills8.push('solid');
- fills9.push('solid');
- }
-
-
- }
- if (numbers1[0] === numbers1[1] && numbers1[0] === numbers1[5]) {
- numbers8.push(numbers1[0]);
- numbers9.push(numbers1[0]);
- } else {
- if (numbers1[0] === 1 && numbers1[1] === 2 && numbers1[5] === 3) {
- numbers8.push(4);
- numbers9.push(4);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 3 && numbers1[5] === 2) {
- numbers8.push(4);
- numbers9.push(4);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 1 && numbers1[5] === 3) {
- numbers8.push(4);
- numbers9.push(4);
- }
- if (numbers1[0] === 2 && numbers1[1] === 3 && numbers1[5] === 1) {
- numbers8.push(4);
- numbers9.push(4);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 1 && numbers1[5] === 2) {
- numbers8.push(4);
- numbers9.push(4);
- }
- if (numbers1[0] === 3 && numbers1[1] === 2 && numbers1[5] === 1) {
- numbers8.push(4);
- numbers9.push(4);
- }
-
-
- if (numbers1[0] === 1 && numbers1[1] === 2 && numbers1[5] === 4) {
- numbers8.push(3);
- numbers9.push(3);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 4 && numbers1[5] === 2) {
- numbers8.push(3);
- numbers9.push(3);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 1 && numbers1[5] === 4) {
- numbers8.push(3);
- numbers9.push(3);
- }
- if (numbers1[0] === 2 && numbers1[1] === 4 && numbers1[5] === 1) {
- numbers8.push(3);
- numbers9.push(3);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 1 && numbers1[5] === 2) {
- numbers8.push(3);
- numbers9.push(3);
- }
- if (numbers1[0] === 4 && numbers1[1] === 2 && numbers1[5] === 1) {
- numbers8.push(3);
- numbers9.push(3);
- }
-
-
- if (numbers1[0] === 1 && numbers1[1] === 3 && numbers1[5] === 4) {
- numbers8.push(2);
- numbers9.push(2);
- }
-
- if (numbers1[0] === 1 && numbers1[1] === 4 && numbers1[5] === 3) {
- numbers8.push(2);
- numbers9.push(2);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 1 && numbers1[5] === 4) {
- numbers8.push(2);
- numbers9.push(2);
- }
- if (numbers1[0] === 3 && numbers1[1] === 4 && numbers1[5] === 1) {
- numbers8.push(2);
- numbers9.push(2);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 1 && numbers1[5] === 3) {
- numbers8.push(2);
- numbers9.push(2);
- }
- if (numbers1[0] === 4 && numbers1[1] === 3 && numbers1[5] === 1) {
- numbers8.push(2);
- numbers9.push(2);
- }
-
-
- if (numbers1[0] === 2 && numbers1[1] === 3 && numbers1[5] === 4) {
- numbers8.push(1);
- numbers9.push(1);
- }
-
- if (numbers1[0] === 2 && numbers1[1] === 4 && numbers1[5] === 3) {
- numbers8.push(1);
- numbers9.push(1);
- }
-
- if (numbers1[0] === 3 && numbers1[1] === 2 && numbers1[5] === 4) {
- numbers8.push(1);
- numbers9.push(1);
- }
- if (numbers1[0] === 3 && numbers1[1] === 4 && numbers1[5] === 2) {
- numbers8.push(1);
- numbers9.push(1);
- }
-
- if (numbers1[0] === 4 && numbers1[1] === 2 && numbers1[5] === 3) {
- numbers8.push(1);
- numbers9.push(1);
- }
- if (numbers1[0] === 4 && numbers1[1] === 3 && numbers1[5] === 2) {
- numbers8.push(1);
- numbers9.push(1);
- }
- }
-
-
-
-
-
- if (colors1[0] === colors1 [2] && colors1[0] === colors1 [3]) {
- colors10.push(colors1[0]);
- colors11.push(colors1[0]);
- } else {
- if (colors1[0] === 'red' && colors1[2] === 'green' && colors1[3] === 'purple') {
- colors10.push('lightblue');
- colors11.push('lightblue');
- }
-
- if (colors1[0] === 'red' && colors1[2] === 'purple' && colors1[3] === 'green') {
- colors10.push('lightblue');
- colors11.push('lightblue');
- }
-
- if (colors1[0] === 'purple' && colors1[2] === 'red' && colors1[3] === 'green') {
- colors10.push('lightblue');
- colors11.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'green' && colors1[3] === 'red') {
- colors10.push('lightblue');
- colors11.push('lightblue');
- }
-
- if (colors1[0] === 'green' && colors1[2] === 'purple' && colors1[3] === 'red') {
- colors10.push('lightblue');
- colors11.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[2] === 'red' && colors1[3] === 'purple') {
- colors10.push('lightblue');
- colors11.push('lightblue');
- }
-
-
- if (colors1[0] === 'green' && colors1[2] === 'purple' && colors1[3] === 'lightblue') {
- colors10.push('red');
- colors11.push('red');
- }
-
- if (colors1[0] === 'green' && colors1[2] === 'lightblue' && colors1[3] === 'purple') {
- colors10.push('red');
- colors11.push('red');
- }
-
- if (colors1[0] === 'purple' && colors1[2] === 'lightblue' && colors1[3] === 'green') {
- colors10.push('red');
- colors11.push('red');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'green' && colors1[3] === 'lightblue') {
- colors10.push('red');
- colors11.push('red');
- }
-
- if (colors1[0] === 'lightblue' && colors1[2] === 'purple' && colors1[3] === 'green') {
- colors10.push('red');
- colors11.push('red');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'green' && colors1[3] === 'purple') {
- colors10.push('red');
- colors11.push('red');
- }
-
-
- if (colors1[0] === 'red' && colors1[2] === 'green' && colors1[3] === 'lightblue') {
- colors10.push('purple');
- colors11.push('purple');
- }
-
- if (colors1[0] === 'red' && colors1[2] === 'lightblue' && colors1[3] === 'green') {
- colors10.push('purple');
- colors11.push('purple');
- }
-
- if (colors1[0] === 'lightblue' && colors1[2] === 'green' && colors1[3] === 'red') {
- colors10.push('purple');
- colors11.push('purple');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'red' && colors1[3] === 'green') {
- colors10.push('purple');
- colors11.push('purple');
- }
-
- if (colors1[0] === 'green' && colors1[2] === 'lightblue' && colors1[3] === 'red') {
- colors10.push('purple');
- colors11.push('purple');
- }
- if (colors1[0] === 'green' && colors1[2] === 'red' && colors1[3] === 'lightblue') {
- colors10.push('purple');
- colors11.push('purple');
- }
-
-
- if (colors1[0] === 'red' && colors1[2] === 'purple' && colors1[3] === 'lightblue') {
- colors10.push('green');
- colors11.push('green');
- }
-
- if (colors1[0] === 'red' && colors1[2] === 'lightblue' && colors1[3] === 'purple') {
- colors10.push('green');
- colors11.push('green');
- }
-
- if (colors1[0] === 'lightblue' && colors1[2] === 'purple' && colors1[3] === 'red') {
- colors10.push('green');
- colors11.push('green');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'red' && colors1[3] === 'purple') {
- colors10.push('green');
- colors11.push('green');
- }
-
- if (colors1[0] === 'purple' && colors1[2] === 'lightblue' && colors1[3] === 'red') {
- colors10.push('green');
- colors11.push('green');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'red' && colors1[3] === 'lightblue') {
- colors10.push('green');
- colors11.push('green');
- }
-
- }
-
-
- if (shapes1[0] === shapes1 [2] && shapes1[0] === shapes1 [3]) {
- shapes10.push(shapes1[0]);
- shapes11.push(shapes1[0]);
- } else {
- if (shapes1[0] === 'oval' && shapes1[2] === 'diamond' && shapes1[3] === 'wave') {
- shapes10.push('rectangle');
- shapes11.push('rectangle');
- }
-
- if (shapes1[0] === 'oval' && shapes1[2] === 'wave' && shapes1[3] === 'diamond') {
- shapes10.push('rectangle');
- shapes11.push('rectangle');
- }
-
- if (shapes1[0] === 'wave' && shapes1[2] === 'diamond' && shapes1[3] === 'oval') {
- shapes10.push('rectangle');
- shapes11.push('rectangle');
-
- }
- if (shapes1[0] === 'wave' && shapes1[2] === 'oval' && shapes1[3] === 'diamond') {
- shapes10.push('rectangle');
- shapes11.push('rectangle');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[2] === 'oval' && shapes1[3] === 'wave') {
- shapes10.push('rectangle');
- shapes11.push('rectangle');
- }
- if (shapes1[0] === 'diamond' && shapes1[2] === 'wave' && shapes1[3] === 'oval') {
- shapes10.push('rectangle');
- shapes11.push('rectangle');
- }
-
-
- if (shapes1[0] === 'oval' && shapes1[2] === 'diamond' && shapes1[3] === 'rectangle') {
- shapes10.push('wave');
- shapes11.push('wave');
- }
-
- if (shapes1[0] === 'oval' && shapes1[2] === 'rectangle' && shapes1[3] === 'diamond') {
- shapes10.push('wave');
- shapes11.push('wave');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'oval' && shapes1[3] === 'diamond') {
- shapes10.push('wave');
- shapes11.push('wave');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'diamond' && shapes1[3] === 'oval') {
- shapes10.push('wave');
- shapes11.push('wave');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[2] === 'oval' && shapes1[3] === 'rectangle') {
- shapes10.push('wave');
- shapes11.push('wave');
- }
- if (shapes1[0] === 'diamond' && shapes1[2] === 'rectangle' && shapes1[3] === 'oval') {
- shapes10.push('wave');
- shapes11.push('wave');
- }
-
-
- if (shapes1[0] === 'oval' && shapes1[2] === 'wave' && shapes1[3] === 'rectangle') {
- shapes10.push('diamond');
- shapes11.push('diamond');
- }
-
- if (shapes1[0] === 'oval' && shapes1[2] === 'rectangle' && shapes1[3] === 'wave') {
- shapes10.push('diamond');
- shapes11.push('diamond');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'wave' && shapes1[3] === 'oval') {
- shapes10.push('diamond');
- shapes11.push('diamond');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'oval' && shapes1[3] === 'wave') {
- shapes10.push('diamond');
- shapes11.push('diamond');
- }
-
- if (shapes1[0] === 'wave' && shapes1[2] === 'oval' && shapes1[3] === 'rectangle') {
- shapes10.push('diamond');
- shapes11.push('diamond');
- }
- if (shapes1[0] === 'wave' && shapes1[2] === 'rectangle' && shapes1[3] === 'oval') {
- shapes10.push('diamond');
- shapes11.push('diamond');
- }
-
-
- if (shapes1[0] === 'diamond' && shapes1[2] === 'wave' && shapes1[3] === 'rectangle') {
- shapes10.push('oval');
- shapes11.push('oval');
- }
-
- if (shapes1[0] === 'diamond' && shapes1[2] === 'rectangle' && shapes1[3] === 'wave') {
- shapes10.push('oval');
- shapes11.push('oval');
- }
-
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'wave' && shapes1[3] === 'diamond') {
- shapes10.push('oval');
- shapes11.push('oval');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'diamond' && shapes1[3] === 'wave') {
- shapes10.push('oval');
- shapes11.push('oval');
- }
-
- if (shapes1[0] === 'wave' && shapes1[2] === 'diamond' && shapes1[3] === 'rectangle') {
- shapes10.push('oval');
- shapes11.push('oval');
- }
- if (shapes1[0] === 'wave' && shapes1[2] === 'rectangle' && shapes1[3] === 'diamond') {
- shapes10.push('oval');
- shapes11.push('oval');
- }
-
- }
- if (fills1[0] === fills1 [2]&& fills1[0] === fills1 [3]) {
- fills10.push(fills1[0]);
- fills11.push(fills1[0]);
- } else {
- if (fills1[0] === 'solid' && fills1[2] === 'stripped' && fills1[3] === 'open') {
- fills10.push('quadrillage');
- fills11.push('quadrillage');
- }
-
- if (fills1[0] === 'solid' && fills1[2] === 'open' && fills1[3] === 'stripped') {
- fills10.push('quadrillage');
- fills11.push('quadrillage');
- }
-
- if (fills1[0] === 'stripped' && fills1[2] === 'open' && fills1[3] === 'solid') {
- fills10.push('quadrillage');
- fills11.push('quadrillage');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'solid' && fills1[3] === 'open') {
- fills10.push('quadrillage');
- fills11.push('quadrillage');
- }
-
- if (fills1[0] === 'open' && fills1[2] === 'stripped' && fills1[3] === 'solid') {
- fills10.push('quadrillage');
- fills11.push('quadrillage');
- }
- if (fills1[0] === 'open' && fills1[2] === 'solid' && fills1[3] === 'stripped') {
- fills10.push('quadrillage');
- fills11.push('quadrillage');
- }
-
-
- if (fills1[0] === 'solid' && fills1[2] === 'stripped' && fills1[3] === 'quadrillage') {
- fills10.push('open');
- fills11.push('open');
- }
-
- if (fills1[0] === 'solid' && fills1[2] === 'quadrillage' && fills1[3] === 'stripped') {
- fills10.push('open');
- fills11.push('open');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[2] === 'solid' && fills1[3] === 'stripped') {
- fills10.push('open');
- fills11.push('open');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'stripped' && fills1[3] === 'solid') {
- fills10.push('open');
- fills11.push('open');
- }
-
- if (fills1[0] === 'stripped' && fills1[2] === 'quadrillage' && fills1[3] === 'solid') {
- fills10.push('open');
- fills11.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'solid' && fills1[3] === 'quadrillage') {
- fills10.push('open');
- fills11.push('open');
- }
-
-
- if (fills1[0] === 'solid' && fills1[2] === 'open' && fills1[3] === 'quadrillage') {
- fills10.push('stripped');
- fills11.push('stripped');
- }
-
- if (fills1[0] === 'solid' && fills1[2] === 'quadrillage' && fills1[3] === 'open') {
- fills10.push('stripped');
- fills11.push('stripped');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[2] === 'solid' && fills1[3] === 'open') {
- fills10.push('stripped');
- fills11.push('stripped');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'open' && fills1[3] === 'solid') {
- fills10.push('stripped');
- fills11.push('stripped');
- }
-
- if (fills1[0] === 'open' && fills1[2] === 'quadrillage' && fills1[3] === 'solid') {
- fills10.push('stripped');
- fills11.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[2] === 'solid' && fills1[3] === 'quadrillage') {
- fills10.push('stripped');
- fills11.push('stripped');
- }
-
-
- if (fills1[0] === 'stripped' && fills1[2] === 'open' && fills1[3] === 'quadrillage') {
- fills10.push('solid');
- fills11.push('solid');
- }
-
- if (fills1[0] === 'stripped' && fills1[2] === 'quadrillage' && fills1[3] === 'open') {
- fills10.push('solid');
- fills11.push('solid');
- }
-
- if (fills1[0] === 'quadrillage' && fills1[2] === 'stripped' && fills1[3] === 'open') {
- fills10.push('solid');
- fills11.push('solid');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'open' && fills1[3] === 'stripped') {
- fills10.push('solid');
- fills11.push('solid');
- }
-
- if (fills1[0] === 'open' && fills1[2] === 'quadrillage' && fills1[3] === 'stripped') {
- fills10.push('solid');
- fills11.push('solid');
- }
- if (fills1[0] === 'open' && fills1[2] === 'stripped' && fills1[3] === 'quadrillage') {
- fills10.push('solid');
- fills11.push('solid');
- }
-
-
- }
- if (numbers1[0] === numbers1[2] && numbers1[0] === numbers1[3]) {
- numbers10.push(numbers1[0]);
- numbers11.push(numbers1[0]);
- } else {
- if (numbers1[0] === 1 && numbers1[2] === 2 && numbers1[3] === 3) {
- numbers10.push(4);
- numbers11.push(4);
- }
-
- if (numbers1[0] === 1 && numbers1[2] === 3 && numbers1[3] === 2) {
- numbers10.push(4);
- numbers11.push(4);
- }
-
- if (numbers1[0] === 2 && numbers1[2] === 1 && numbers1[3] === 3) {
- numbers10.push(4);
- numbers11.push(4);
- }
- if (numbers1[0] === 2 && numbers1[2] === 3 && numbers1[3] === 1) {
- numbers10.push(4);
- numbers11.push(4);
- }
-
- if (numbers1[0] === 3 && numbers1[2] === 1 && numbers1[3] === 2) {
- numbers10.push(4);
- numbers11.push(4);
- }
- if (numbers1[0] === 3 && numbers1[2] === 2 && numbers1[3] === 1) {
- numbers10.push(4);
- numbers11.push(4);
- }
-
-
- if (numbers1[0] === 1 && numbers1[2] === 2 && numbers1[3] === 4) {
- numbers10.push(3);
- numbers11.push(3);
- }
-
- if (numbers1[0] === 1 && numbers1[2] === 4 && numbers1[3] === 2) {
- numbers10.push(3);
- numbers11.push(3);
- }
-
- if (numbers1[0] === 2 && numbers1[2] === 1 && numbers1[3] === 4) {
- numbers10.push(3);
- numbers11.push(3);
- }
- if (numbers1[0] === 2 && numbers1[2] === 4 && numbers1[3] === 1) {
- numbers10.push(3);
- numbers11.push(3);
- }
-
- if (numbers1[0] === 4 && numbers1[2] === 1 && numbers1[3] === 2) {
- numbers10.push(3);
- numbers11.push(3);
- }
- if (numbers1[0] === 4 && numbers1[2] === 2 && numbers1[3] === 1) {
- numbers10.push(3);
- numbers11.push(3);
- }
-
-
- if (numbers1[0] === 1 && numbers1[2] === 3 && numbers1[3] === 4) {
- numbers10.push(2);
- numbers11.push(2);
- }
-
- if (numbers1[0] === 1 && numbers1[2] === 4 && numbers1[3] === 3) {
- numbers10.push(2);
- numbers11.push(2);
- }
-
- if (numbers1[0] === 3 && numbers1[2] === 1 && numbers1[3] === 4) {
- numbers10.push(2);
- numbers11.push(2);
- }
- if (numbers1[0] === 3 && numbers1[2] === 4 && numbers1[3] === 1) {
- numbers10.push(2);
- numbers11.push(2);
- }
-
- if (numbers1[0] === 4 && numbers1[2] === 1 && numbers1[3] === 3) {
- numbers10.push(2);
- numbers11.push(2);
- }
- if (numbers1[0] === 4 && numbers1[2] === 3 && numbers1[3] === 1) {
- numbers10.push(2);
- numbers11.push(2);
- }
-
-
- if (numbers1[0] === 2 && numbers1[2] === 3 && numbers1[3] === 4) {
- numbers10.push(1);
- numbers11.push(1);
- }
-
- if (numbers1[0] === 2 && numbers1[2] === 4 && numbers1[3] === 3) {
- numbers10.push(1);
- numbers11.push(1);
- }
-
- if (numbers1[0] === 3 && numbers1[2] === 2 && numbers1[3] === 4) {
- numbers10.push(1);
- numbers11.push(1);
- }
- if (numbers1[0] === 3 && numbers1[2] === 4 && numbers1[3] === 2) {
- numbers10.push(1);
- numbers11.push(1);
- }
-
- if (numbers1[0] === 4 && numbers1[2] === 2 && numbers1[3] === 3) {
- numbers10.push(1);
- numbers11.push(1);
- }
- if (numbers1[0] === 4 && numbers1[2] === 3 && numbers1[3] === 2) {
- numbers10.push(1);
- numbers11.push(1);
- }
- }
-
-
-
- if (colors1[0] === colors1 [2]&& colors1[0] === colors1 [4]) {
- colors12.push(colors1[0]);
- colors13.push(colors1[0]);
- } else {
- if (colors1[0] === 'red' && colors1[2] === 'green' && colors1[4] === 'purple') {
- colors12.push('lightblue');
- colors13.push('lightblue');
- }
-
- if (colors1[0] === 'red' && colors1[2] === 'purple' && colors1[4] === 'green') {
- colors12.push('lightblue');
- colors13.push('lightblue');
- }
-
- if (colors1[0] === 'purple' && colors1[2] === 'red' && colors1[4] === 'green') {
- colors12.push('lightblue');
- colors13.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'green' && colors1[4] === 'red') {
- colors12.push('lightblue');
- colors13.push('lightblue');
- }
-
- if (colors1[0] === 'green' && colors1[2] === 'purple' && colors1[4] === 'red') {
- colors12.push('lightblue');
- colors13.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[2] === 'red' && colors1[4] === 'purple') {
- colors12.push('lightblue');
- colors13.push('lightblue');
- }
-
-
- if (colors1[0] === 'green' && colors1[2] === 'purple' && colors1[4] === 'lightblue') {
- colors12.push('red');
- colors13.push('red');
- }
-
- if (colors1[0] === 'green' && colors1[2] === 'lightblue' && colors1[4] === 'purple') {
- colors12.push('red');
- colors13.push('red');
- }
-
- if (colors1[0] === 'purple' && colors1[2] === 'lightblue' && colors1[4] === 'green') {
- colors12.push('red');
- colors13.push('red');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'green' && colors1[4] === 'lightblue') {
- colors12.push('red');
- colors13.push('red');
- }
-
- if (colors1[0] === 'lightblue' && colors1[2] === 'purple' && colors1[4] === 'green') {
- colors12.push('red');
- colors13.push('red');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'green' && colors1[4] === 'purple') {
- colors12.push('red');
- colors13.push('red');
- }
-
-
- if (colors1[0] === 'red' && colors1[2] === 'green' && colors1[4] === 'lightblue') {
- colors12.push('purple');
- colors13.push('purple');
- }
-
- if (colors1[0] === 'red' && colors1[2] === 'lightblue' && colors1[4] === 'green') {
- colors12.push('purple');
- colors13.push('purple');
- }
-
- if (colors1[0] === 'lightblue' && colors1[2] === 'green' && colors1[4] === 'red') {
- colors12.push('purple');
- colors13.push('purple');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'red' && colors1[4] === 'green') {
- colors12.push('purple');
- colors13.push('purple');
- }
-
- if (colors1[0] === 'green' && colors1[2] === 'lightblue' && colors1[4] === 'red') {
- colors12.push('purple');
- colors13.push('purple');
- }
- if (colors1[0] === 'green' && colors1[2] === 'red' && colors1[4] === 'lightblue') {
- colors12.push('purple');
- colors13.push('purple');
- }
-
-
- if (colors1[0] === 'red' && colors1[2] === 'purple' && colors1[4] === 'lightblue') {
- colors12.push('green');
- colors13.push('green');
- }
-
- if (colors1[0] === 'red' && colors1[2] === 'lightblue' && colors1[4] === 'purple') {
- colors12.push('green');
- colors13.push('green');
- }
-
- if (colors1[0] === 'lightblue' && colors1[2] === 'purple' && colors1[4] === 'red') {
- colors12.push('green');
- colors13.push('green');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'red' && colors1[4] === 'purple') {
- colors12.push('green');
- colors13.push('green');
- }
-
- if (colors1[0] === 'purple' && colors1[2] === 'lightblue' && colors1[4] === 'red') {
- colors12.push('green');
- colors13.push('green');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'red' && colors1[4] === 'lightblue') {
- colors12.push('green');
- colors13.push('green');
- }
-
- }
-
-
- if (shapes1[0] === shapes1 [2] && shapes1[0] === shapes1 [4]) {
- shapes12.push(shapes1[0]);
- shapes13.push(shapes1[0]);
- } else {
- if (shapes1[0] === 'oval' && shapes1[2] === 'diamond' && shapes1[4] === 'wave') {
- shapes12.push('rectangle');
- shapes13.push('rectangle');
- }
-
- if (shapes1[0] === 'oval' && shapes1[2] === 'wave' && shapes1[4] === 'diamond') {
- shapes12.push('rectangle');
- shapes13.push('rectangle');
- }
-
- if (shapes1[0] === 'wave' && shapes1[2] === 'diamond' && shapes1[4] === 'oval') {
- shapes12.push('rectangle');
- shapes13.push('rectangle');
-
- }
- if (shapes1[0] === 'wave' && shapes1[2] === 'oval' && shapes1[4] === 'diamond') {
- shapes12.push('rectangle');
- shapes13.push('rectangle');
+ // if card is new, add it, otherwise remove it
+ var ids = $.map(self.selected2, function(el) { return $(el).data("id");});
+ if (ids.indexOf($(card).data('id')) >= 0) {
+ self.deselectCard2(card);
+ } else {
+ self.selectCard2(card);
}
- if (shapes1[0] === 'diamond' && shapes1[2] === 'oval' && shapes1[4] === 'wave') {
- shapes12.push('rectangle');
- shapes13.push('rectangle');
- }
- if (shapes1[0] === 'diamond' && shapes1[2] === 'wave' && shapes1[4] === 'oval') {
- shapes12.push('rectangle');
- shapes13.push('rectangle');
+ if (self.selected2.length === 4) {
+ self.silentSubmission2();
}
+ });
+ },
+ setCardListeners3: function() {
+ var self = this;
+ // what happens when a card is clicked:
+ this.$board3.on('click', '.card', function(e) {
+ e.stopImmediatePropagation();
+ var card = e.currentTarget;
- if (shapes1[0] === 'oval' && shapes1[2] === 'diamond' && shapes1[4] === 'rectangle') {
- shapes12.push('wave');
- shapes13.push('wave');
+ // if card is new, add it, otherwise remove it
+ var ids = $.map(self.selected3, function(el) { return $(el).data("id");});
+ if (ids.indexOf($(card).data('id')) >= 0) {
+ self.deselectCard3(card);
+ } else {
+ self.selectCard3(card);
}
- if (shapes1[0] === 'oval' && shapes1[2] === 'rectangle' && shapes1[4] === 'diamond') {
- shapes12.push('wave');
- shapes13.push('wave');
+ if (self.selected3.length === 4) {
+ self.silentSubmission3();
}
+ });
+ },
+ setCardListeners4: function() {
+ var self = this;
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'oval' && shapes1[4] === 'diamond') {
- shapes12.push('wave');
- shapes13.push('wave');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'diamond' && shapes1[4] === 'oval') {
- shapes12.push('wave');
- shapes13.push('wave');
- }
+ // what happens when a card is clicked:
+ this.$board4.on('click', '.card', function(e) {
+ e.stopImmediatePropagation();
+ var card = e.currentTarget;
- if (shapes1[0] === 'diamond' && shapes1[2] === 'oval' && shapes1[4] === 'rectangle') {
- shapes12.push('wave');
- shapes13.push('wave');
- }
- if (shapes1[0] === 'diamond' && shapes1[2] === 'rectangle' && shapes1[4] === 'oval') {
- shapes12.push('wave');
- shapes13.push('wave');
+ // if card is new, add it, otherwise remove it
+ var ids = $.map(self.selected4, function(el) { return $(el).data("id");});
+ if (ids.indexOf($(card).data('id')) >= 0) {
+ self.deselectCard4(card);
+ } else {
+ self.selectCard4(card);
}
-
- if (shapes1[0] === 'oval' && shapes1[2] === 'wave' && shapes1[4] === 'rectangle') {
- shapes12.push('diamond');
- shapes13.push('diamond');
+ if (self.selected4.length === 5) {
+ self.silentSubmission4();
}
+ });
+ },
- if (shapes1[0] === 'oval' && shapes1[2] === 'rectangle' && shapes1[4] === 'wave') {
- shapes12.push('diamond');
- shapes13.push('diamond');
- }
+ setCardListenersHS: function() {
+ var self = this;
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'wave' && shapes1[4] === 'oval') {
- shapes12.push('diamond');
- shapes13.push('diamond');
+ // what happens when a card is clicked:
+ this.$boardHS.on('click', '.card', function(e) {
+ e.stopImmediatePropagation();
+ var card = e.currentTarget;
- }
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'oval' && shapes1[4] === 'wave') {
- shapes12.push('diamond');
- shapes13.push('diamond');
+ // if card is new, add it, otherwise remove it
+ var ids = $.map(self.selectedHS, function(el) { return $(el).data("id");});
+ if (ids.indexOf($(card).data('id')) >= 0) {
+ self.deselectCardHS(card);
+ } else {
+ self.selectCardHS(card);
}
- if (shapes1[0] === 'wave' && shapes1[2] === 'oval' && shapes1[4] === 'rectangle') {
- shapes12.push('diamond');
- shapes13.push('diamond');
- }
- if (shapes1[0] === 'wave' && shapes1[2] === 'rectangle' && shapes1[4] === 'oval') {
- shapes12.push('diamond');
- shapes13.push('diamond');
+ if (self.selectedHS.length === 4) {
+ self.silentSubmissionHS();
}
+ });
+ },
+ setCardListenersHS0: function() {
+ var self = this;
- if (shapes1[0] === 'diamond' && shapes1[2] === 'wave' && shapes1[4] === 'rectangle') {
- shapes12.push('oval');
- shapes13.push('oval');
- }
+ // what happens when a card is clicked:
+ this.$boardHS0.on('click', '.card', function(e) {
+ e.stopImmediatePropagation();
+ var card = e.currentTarget;
- if (shapes1[0] === 'diamond' && shapes1[2] === 'rectangle' && shapes1[4] === 'wave') {
- shapes12.push('oval');
- shapes13.push('oval');
+ // if card is new, add it, otherwise remove it
+ var ids = $.map(self.selectedHS0, function(el) { return $(el).data("id");});
+ if (ids.indexOf($(card).data('id')) >= 0) {
+ self.deselectCardHS0(card);
+ } else {
+ self.selectCardHS0(card);
}
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'wave' && shapes1[4] === 'diamond') {
- shapes12.push('oval');
- shapes13.push('oval');
-
- }
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'diamond' && shapes1[4] === 'wave') {
- shapes12.push('oval');
- shapes13.push('oval');
+ if (self.selectedHS0.length === 4) {
+ self.silentSubmissionHS0();
}
+ });
+ },
- if (shapes1[0] === 'wave' && shapes1[2] === 'diamond' && shapes1[4] === 'rectangle') {
- shapes12.push('oval');
- shapes13.push('oval');
- }
- if (shapes1[0] === 'wave' && shapes1[2] === 'rectangle' && shapes1[4] === 'diamond') {
- shapes12.push('oval');
- shapes13.push('oval');
- }
- }
- if (fills1[0] === fills1 [2] && fills1[0]=== fills1 [4]) {
- fills12.push(fills1[0]);
- fills13.push(fills1[0]);
- } else {
- if (fills1[0] === 'solid' && fills1[2] === 'stripped' && fills1[4] === 'open') {
- fills12.push('quadrillage');
- fills13.push('quadrillage');
- }
+ setCardListenersHS1: function() {
+ var self = this;
- if (fills1[0] === 'solid' && fills1[2] === 'open' && fills1[4] === 'stripped') {
- fills12.push('quadrillage');
- fills13.push('quadrillage');
- }
+ // what happens when a card is clicked:
+ this.$boardHS1.on('click', '.card', function(e) {
+ e.stopImmediatePropagation();
+ var card = e.currentTarget;
- if (fills1[0] === 'stripped' && fills1[2] === 'open' && fills1[4] === 'solid') {
- fills12.push('quadrillage');
- fills13.push('quadrillage');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'solid' && fills1[4] === 'open') {
- fills12.push('quadrillage');
- fills13.push('quadrillage');
+ // if card is new, add it, otherwise remove it
+ var ids = $.map(self.selectedHS1, function(el) { return $(el).data("id");});
+ if (ids.indexOf($(card).data('id')) >= 0) {
+ self.deselectCardHS1(card);
+ } else {
+ self.selectCardHS1(card);
}
- if (fills1[0] === 'open' && fills1[2] === 'stripped' && fills1[4] === 'solid') {
- fills12.push('quadrillage');
- fills13.push('quadrillage');
- }
- if (fills1[0] === 'open' && fills1[2] === 'solid' && fills1[4] === 'stripped') {
- fills12.push('quadrillage');
- fills13.push('quadrillage');
+ if (self.selectedHS1.length === 4) {
+ self.silentSubmissionHS1();
}
+ });
+ },
+ setCardListenersHS2: function() {
+ var self = this;
+ // what happens when a card is clicked:
+ this.$boardHS2.on('click', '.card', function(e) {
+ e.stopImmediatePropagation();
+ var card = e.currentTarget;
- if (fills1[0] === 'solid' && fills1[2] === 'stripped' && fills1[4] === 'quadrillage') {
- fills12.push('open');
- fills13.push('open');
+ // if card is new, add it, otherwise remove it
+ var ids = $.map(self.selectedHS2, function(el) { return $(el).data("id");});
+ if (ids.indexOf($(card).data('id')) >= 0) {
+ self.deselectCardHS2(card);
+ } else {
+ self.selectCardHS2(card);
}
- if (fills1[0] === 'solid' && fills1[2] === 'quadrillage' && fills1[4] === 'stripped') {
- fills12.push('open');
- fills13.push('open');
+ if (self.selectedHS2.length === 6) {
+ self.silentSubmissionHS2();
}
+ });
+ },
- if (fills1[0] === 'quadrillage' && fills1[2] === 'solid' && fills1[4] === 'stripped') {
- fills12.push('open');
- fills13.push('open');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'stripped' && fills1[4] === 'solid') {
- fills12.push('open');
- fills13.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'quadrillage' && fills1[4] === 'solid') {
- fills12.push('open');
- fills13.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'solid' && fills1[4] === 'quadrillage') {
- fills12.push('open');
- fills13.push('open');
- }
- if (fills1[0] === 'solid' && fills1[2] === 'open' && fills1[4] === 'quadrillage') {
- fills12.push('stripped');
- fills13.push('stripped');
- }
- if (fills1[0] === 'solid' && fills1[2] === 'quadrillage' && fills1[4] === 'open') {
- fills12.push('stripped');
- fills13.push('stripped');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'solid' && fills1[4] === 'open') {
- fills12.push('stripped');
- fills13.push('stripped');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'open' && fills1[4] === 'solid') {
- fills12.push('stripped');
- fills13.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[2] === 'quadrillage' && fills1[4] === 'solid') {
- fills12.push('stripped');
- fills13.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[2] === 'solid' && fills1[4] === 'quadrillage') {
- fills12.push('stripped');
- fills13.push('stripped');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'open' && fills1[4] === 'quadrillage') {
- fills12.push('solid');
- fills13.push('solid');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'quadrillage' && fills1[4] === 'open') {
- fills12.push('solid');
- fills13.push('solid');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'stripped' && fills1[4] === 'open') {
- fills12.push('solid');
- fills13.push('solid');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'open' && fills1[4] === 'stripped') {
- fills12.push('solid');
- fills13.push('solid');
- }
- if (fills1[0] === 'open' && fills1[2] === 'quadrillage' && fills1[4] === 'stripped') {
- fills12.push('solid');
- fills13.push('solid');
- }
- if (fills1[0] === 'open' && fills1[2] === 'stripped' && fills1[4] === 'quadrillage') {
- fills12.push('solid');
- fills13.push('solid');
- }
- }
- if (numbers1[0] === numbers1[2] && numbers1[0]=== numbers1[4]) {
- numbers12.push(numbers1[0]);
- numbers13.push(numbers1[0]);
- } else {
- if (numbers1[0] === 1 && numbers1[2] === 2 && numbers1[4] === 3) {
- numbers12.push(4);
- numbers13.push(4);
- }
- if (numbers1[0] === 1 && numbers1[2] === 3 && numbers1[4] === 2) {
- numbers12.push(4);
- numbers13.push(4);
- }
- if (numbers1[0] === 2 && numbers1[2] === 1 && numbers1[4] === 3) {
- numbers12.push(4);
- numbers13.push(4);
- }
- if (numbers1[0] === 2 && numbers1[2] === 3 && numbers1[4] === 1) {
- numbers12.push(4);
- numbers13.push(4);
- }
- if (numbers1[0] === 3 && numbers1[2] === 1 && numbers1[4] === 2) {
- numbers12.push(4);
- numbers13.push(4);
- }
- if (numbers1[0] === 3 && numbers1[2] === 2 && numbers1[4] === 1) {
- numbers12.push(4);
- numbers13.push(4);
- }
+ setPageListeners0: function() {
+ var self = this;
- if (numbers1[0] === 1 && numbers1[2] === 2 && numbers1[4] === 4) {
- numbers12.push(3);
- numbers13.push(3);
- }
+ // if the user clicks on the page outside the game board, clear selected
+ $(document).on('click', function() {
+ self.clearSelections0.call(self);
+ });
+ },
- if (numbers1[0] === 1 && numbers1[2] === 4 && numbers1[4] === 2) {
- numbers12.push(3);
- numbers13.push(3);
- }
+ setPageListeners: function() {
+ var self = this;
- if (numbers1[0] === 2 && numbers1[2] === 1 && numbers1[4] === 4) {
- numbers12.push(3);
- numbers13.push(3);
- }
- if (numbers1[0] === 2 && numbers1[2] === 4 && numbers1[4] === 1) {
- numbers12.push(3);
- numbers13.push(3);
- }
+ // if the user clicks on the page outside the game board, clear selected
+ $(document).on('click', function() {
+ self.clearSelections.call(self);
+ });
+ },
- if (numbers1[0] === 4 && numbers1[2] === 1 && numbers1[4] === 2) {
- numbers12.push(3);
- numbers13.push(3);
- }
- if (numbers1[0] === 4 && numbers1[2] === 2 && numbers1[4] === 1) {
- numbers12.push(3);
- numbers13.push(3);
- }
+ setPageListeners1: function() {
+ var self = this;
+ // if the user clicks on the page outside the game board, clear selected
+ $(document).on('click', function() {
+ self.clearSelections1.call(self);
+ });
+ },
- if (numbers1[0] === 1 && numbers1[2] === 3 && numbers1[4] === 4) {
- numbers12.push(2);
- numbers13.push(2);
- }
+ setPageListeners2: function() {
+ var self = this;
- if (numbers1[0] === 1 && numbers1[2] === 4 && numbers1[4] === 3) {
- numbers12.push(2);
- numbers13.push(2);
- }
+ // if the user clicks on the page outside the game board, clear selected
+ $(document).on('click', function() {
+ self.clearSelections2.call(self);
+ });
+ },
- if (numbers1[0] === 3 && numbers1[2] === 1 && numbers1[4] === 4) {
- numbers12.push(2);
- numbers13.push(2);
- }
- if (numbers1[0] === 3 && numbers1[2] === 4 && numbers1[4] === 1) {
- numbers12.push(2);
- numbers13.push(2);
- }
+ setPageListeners3: function() {
+ var self = this;
- if (numbers1[0] === 4 && numbers1[2] === 1 && numbers1[4] === 3) {
- numbers12.push(2);
- numbers13.push(2);
- }
- if (numbers1[0] === 4 && numbers1[2] === 3 && numbers1[4] === 1) {
- numbers12.push(2);
- numbers13.push(2);
- }
+ // if the user clicks on the page outside the game board, clear selected
+ $(document).on('click', function() {
+ self.clearSelections3.call(self);
+ });
+ },
+ setPageListeners4: function() {
+ var self = this;
- if (numbers1[0] === 2 && numbers1[2] === 3 && numbers1[4] === 4) {
- numbers12.push(1);
- numbers13.push(1);
- }
+ // if the user clicks on the page outside the game board, clear selected
+ $(document).on('click', function() {
+ self.clearSelections4.call(self);
+ });
+ },
- if (numbers1[0] === 2 && numbers1[2] === 4 && numbers1[4] === 3) {
- numbers12.push(1);
- numbers13.push(1);
- }
- if (numbers1[0] === 3 && numbers1[2] === 2 && numbers1[4] === 4) {
- numbers12.push(1);
- numbers13.push(1);
- }
- if (numbers1[0] === 3 && numbers1[2] === 4 && numbers1[4] === 2) {
- numbers12.push(1);
- numbers13.push(1);
- }
+ setPageListenersHS: function() {
+ var self = this;
- if (numbers1[0] === 4 && numbers1[2] === 2 && numbers1[4] === 3) {
- numbers12.push(1);
- numbers13.push(1);
- }
- if (numbers1[0] === 4 && numbers1[2] === 3 && numbers1[4] === 2) {
- numbers12.push(1);
- numbers13.push(1);
- }
- }
+ // if the user clicks on the page outside the game board, clear selected
+ $(document).on('click', function() {
+ self.clearSelectionsHS.call(self);
+ });
+ },
+ setPageListenersHS0: function() {
+ var self = this;
+ // if the user clicks on the page outside the game board, clear selected
+ $(document).on('click', function() {
+ self.clearSelectionsHS0.call(self);
+ });
+ },
+ setPageListenersHS1: function() {
+ var self = this;
+ // if the user clicks on the page outside the game board, clear selected
+ $(document).on('click', function() {
+ self.clearSelectionsHS1.call(self);
+ });
+ },
+ setPageListenersHS2: function() {
+ var self = this;
+ // if the user clicks on the page outside the game board, clear selected
+ $(document).on('click', function() {
+ self.clearSelectionsHS2.call(self);
+ });
+ },
- if (colors1[0] === colors1 [2] && colors1[0] === colors1 [5]) {
- colors14.push(colors1[0]);
- colors15.push(colors1[0]);
- } else {
- if (colors1[0] === 'red' && colors1[2] === 'green' && colors1[5] === 'purple') {
- colors14.push('lightblue');
- colors15.push('lightblue');
- }
- if (colors1[0] === 'red' && colors1[2] === 'purple' && colors1[5] === 'green') {
- colors14.push('lightblue');
- colors15.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'red' && colors1[5] === 'green') {
- colors14.push('lightblue');
- colors15.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'green' && colors1[5] === 'red') {
- colors14.push('lightblue');
- colors15.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[2] === 'purple' && colors1[5] === 'red') {
- colors14.push('lightblue');
- colors15.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[2] === 'red' && colors1[5] === 'purple') {
- colors14.push('lightblue');
- colors15.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[2] === 'purple' && colors1[5] === 'lightblue') {
- colors14.push('red');
- colors15.push('red');
- }
- if (colors1[0] === 'green' && colors1[2] === 'lightblue' && colors1[5] === 'purple') {
- colors14.push('red');
- colors15.push('red');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'lightblue' && colors1[5] === 'green') {
- colors14.push('red');
- colors15.push('red');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'green' && colors1[5] === 'lightblue') {
- colors14.push('red');
- colors15.push('red');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'purple' && colors1[5] === 'green') {
- colors14.push('red');
- colors15.push('red');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'green' && colors1[5] === 'purple') {
- colors14.push('red');
- colors15.push('red');
- }
- if (colors1[0] === 'red' && colors1[2] === 'green' && colors1[5] === 'lightblue') {
- colors14.push('purple');
- colors15.push('purple');
- }
- if (colors1[0] === 'red' && colors1[2] === 'lightblue' && colors1[5] === 'green') {
- colors14.push('purple');
- colors15.push('purple');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'green' && colors1[5] === 'red') {
- colors14.push('purple');
- colors15.push('purple');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'red' && colors1[5] === 'green') {
- colors14.push('purple');
- colors15.push('purple');
- }
- if (colors1[0] === 'green' && colors1[2] === 'lightblue' && colors1[5] === 'red') {
- colors14.push('purple');
- colors15.push('purple');
- }
- if (colors1[0] === 'green' && colors1[2] === 'red' && colors1[5] === 'lightblue') {
- colors14.push('purple');
- colors15.push('purple');
- }
+ selectCard0: function(card) {
+ if (this.selected0.length < 3) {
+ $(card).addClass('selected');
+ this.selected0.push(card);
+ }
- if (colors1[0] === 'red' && colors1[2] === 'purple' && colors1[5] === 'lightblue') {
- colors14.push('green');
- colors15.push('green');
- }
+ },
- if (colors1[0] === 'red' && colors1[2] === 'lightblue' && colors1[5] === 'purple') {
- colors14.push('green');
- colors15.push('green');
- }
+ selectCard: function(card) {
+ if (this.selected.length < 3) {
+ $(card).addClass('selected');
+ this.selected.push(card);
- if (colors1[0] === 'lightblue' && colors1[2] === 'purple' && colors1[5] === 'red') {
- colors14.push('green');
- colors15.push('green');
- }
- if (colors1[0] === 'lightblue' && colors1[2] === 'red' && colors1[5] === 'purple') {
- colors14.push('green');
- colors15.push('green');
- }
+ }
- if (colors1[0] === 'purple' && colors1[2] === 'lightblue' && colors1[5] === 'red') {
- colors14.push('green');
- colors15.push('green');
- }
- if (colors1[0] === 'purple' && colors1[2] === 'red' && colors1[5] === 'lightblue') {
- colors14.push('green');
- colors15.push('green');
- }
+ },
- }
+ selectCard1: function(card) {
- if (shapes1[0] === shapes1 [2] && shapes1[0] === shapes1 [5]) {
- shapes14.push(shapes1[0]);
- shapes15.push(shapes1[0]);
- } else {
- if (shapes1[0] === 'oval' && shapes1[2] === 'diamond' && shapes1[5] === 'wave') {
- shapes14.push('rectangle');
- shapes15.push('rectangle');
- }
+ if (this.selected1.length < 3) {
+ $(card).addClass('selected');
+ this.selected1.push(card);
+ }
- if (shapes1[0] === 'oval' && shapes1[2] === 'wave' && shapes1[5] === 'diamond') {
- shapes14.push('rectangle');
- shapes15.push('rectangle');
- }
+ },
- if (shapes1[0] === 'wave' && shapes1[2] === 'diamond' && shapes1[5] === 'oval') {
- shapes14.push('rectangle');
- shapes15.push('rectangle');
+ selectCard2: function(card) {
+ if (this.selected2.length < 4) {
+ $(card).addClass('selected');
+ this.selected2.push(card);
- }
- if (shapes1[0] === 'wave' && shapes1[2] === 'oval' && shapes1[5] === 'diamond') {
- shapes14.push('rectangle');
- shapes15.push('rectangle');
- }
+ }
- if (shapes1[0] === 'diamond' && shapes1[2] === 'oval' && shapes1[5] === 'wave') {
- shapes14.push('rectangle');
- shapes15.push('rectangle');
- }
- if (shapes1[0] === 'diamond' && shapes1[2] === 'wave' && shapes1[5] === 'oval') {
- shapes14.push('rectangle');
- shapes15.push('rectangle');
- }
+ },
+ selectCard3: function(card) {
- if (shapes1[0] === 'oval' && shapes1[2] === 'diamond' && shapes1[5] === 'rectangle') {
- shapes14.push('wave');
- shapes15.push('wave');
- }
- if (shapes1[0] === 'oval' && shapes1[2] === 'rectangle' && shapes1[5] === 'diamond') {
- shapes14.push('wave');
- shapes15.push('wave');
- }
+ if (this.selected3.length < 4) {
+ $(card).addClass('selected');
+ this.selected3.push(card);
+ }
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'oval' && shapes1[5] === 'diamond') {
- shapes14.push('wave');
- shapes15.push('wave');
+ },
- }
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'diamond' && shapes1[5] === 'oval') {
- shapes14.push('wave');
- shapes15.push('wave');
- }
+ selectCard4: function(card) {
- if (shapes1[0] === 'diamond' && shapes1[2] === 'oval' && shapes1[5] === 'rectangle') {
- shapes14.push('wave');
- shapes15.push('wave');
- }
- if (shapes1[0] === 'diamond' && shapes1[2] === 'rectangle' && shapes1[5] === 'oval') {
- shapes14.push('wave');
- shapes15.push('wave');
- }
+ if (this.selected4.length < 5) {
+ $(card).addClass('selected');
+ this.selected4.push(card);
+ }
- if (shapes1[0] === 'oval' && shapes1[2] === 'wave' && shapes1[5] === 'rectangle') {
- shapes14.push('diamond');
- shapes15.push('diamond');
- }
+ },
- if (shapes1[0] === 'oval' && shapes1[2] === 'rectangle' && shapes1[5] === 'wave') {
- shapes14.push('diamond');
- shapes15.push('diamond');
- }
+ selectCardHS: function(card) {
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'wave' && shapes1[5] === 'oval') {
- shapes14.push('diamond');
- shapes15.push('diamond');
+ if (this.selectedHS.length < 4) {
+ $(card).addClass('selected');
+ this.selectedHS.push(card);
+ }
- }
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'oval' && shapes1[5] === 'wave') {
- shapes14.push('diamond');
- shapes15.push('diamond');
- }
+ },
- if (shapes1[0] === 'wave' && shapes1[2] === 'oval' && shapes1[5] === 'rectangle') {
- shapes14.push('diamond');
- shapes15.push('diamond');
- }
- if (shapes1[0] === 'wave' && shapes1[2] === 'rectangle' && shapes1[5] === 'oval') {
- shapes14.push('diamond');
- shapes15.push('diamond');
- }
+ selectCardHS0: function(card) {
+ if (this.selectedHS0.length < 4) {
+ $(card).addClass('selected');
+ this.selectedHS0.push(card);
- if (shapes1[0] === 'diamond' && shapes1[2] === 'wave' && shapes1[5] === 'rectangle') {
- shapes14.push('oval');
- shapes15.push('oval');
- }
+ }
- if (shapes1[0] === 'diamond' && shapes1[2] === 'rectangle' && shapes1[5] === 'wave') {
- shapes14.push('oval');
- shapes15.push('oval');
- }
+ },
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'wave' && shapes1[5] === 'diamond') {
- shapes14.push('oval');
- shapes15.push('oval');
- }
- if (shapes1[0] === 'rectangle' && shapes1[2] === 'diamond' && shapes1[5] === 'wave') {
- shapes14.push('oval');
- shapes15.push('oval');
- }
+ selectCardHS1: function(card) {
- if (shapes1[0] === 'wave' && shapes1[2] === 'diamond' && shapes1[5] === 'rectangle') {
- shapes14.push('oval');
- shapes15.push('oval');
- }
- if (shapes1[0] === 'wave' && shapes1[2] === 'rectangle' && shapes1[5] === 'diamond') {
- shapes14.push('oval');
- shapes15.push('oval');
- }
+ if (this.selectedHS1.length < 4) {
+ $(card).addClass('selected');
+ this.selectedHS1.push(card);
}
- if (fills1[0] === fills1 [2] && fills1[0] === fills1 [5]) {
- fills14.push(fills1[0]);
- fills15.push(fills1[0]);
- } else {
- if (fills1[0] === 'solid' && fills1[2] === 'stripped' && fills1[5] === 'open') {
- fills14.push('quadrillage');
- fills15.push('quadrillage');
- }
- if (fills1[0] === 'solid' && fills1[2] === 'open' && fills1[5] === 'stripped') {
- fills14.push('quadrillage');
- fills15.push('quadrillage');
- }
+ },
+ selectCardHS2: function(card) {
- if (fills1[0] === 'stripped' && fills1[2] === 'open' && fills1[5] === 'solid') {
- fills14.push('quadrillage');
- fills15.push('quadrillage');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'solid' && fills1[5] === 'open') {
- fills14.push('quadrillage');
- fills15.push('quadrillage');
- }
+ if (this.selectedHS2.length < 6) {
+ $(card).addClass('selected');
+ this.selectedHS2.push(card);
- if (fills1[0] === 'open' && fills1[2] === 'stripped' && fills1[5] === 'solid') {
- fills14.push('quadrillage');
- fills15.push('quadrillage');
- }
- if (fills1[0] === 'open' && fills1[2] === 'solid' && fills1[5] === 'stripped') {
- fills14.push('quadrillage');
- fills15.push('quadrillage');
- }
+ }
+ },
- if (fills1[0] === 'solid' && fills1[2] === 'stripped' && fills1[5] === 'quadrillage') {
- fills14.push('open');
- fills15.push('open');
- }
- if (fills1[0] === 'solid' && fills1[2] === 'quadrillage' && fills1[5] === 'stripped') {
- fills14.push('open');
- fills15.push('open');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'solid' && fills1[5] === 'stripped') {
- fills14.push('open');
- fills15.push('open');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'stripped' && fills1[5] === 'solid') {
- fills14.push('open');
- fills15.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'quadrillage' && fills1[5] === 'solid') {
- fills14.push('open');
- fills15.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'solid' && fills1[5] === 'quadrillage') {
- fills14.push('open');
- fills15.push('open');
- }
- if (fills1[0] === 'solid' && fills1[2] === 'open' && fills1[5] === 'quadrillage') {
- fills14.push('stripped');
- fills15.push('stripped');
- }
- if (fills1[0] === 'solid' && fills1[2] === 'quadrillage' && fills1[5] === 'open') {
- fills14.push('stripped');
- fills15.push('stripped');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'solid' && fills1[5] === 'open') {
- fills14.push('stripped');
- fills15.push('stripped');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'open' && fills1[5] === 'solid') {
- fills14.push('stripped');
- fills15.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[2] === 'quadrillage' && fills1[5] === 'solid') {
- fills14.push('stripped');
- fills15.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[2] === 'solid' && fills1[5] === 'quadrillage') {
- fills14.push('stripped');
- fills15.push('stripped');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'open' && fills1[5] === 'quadrillage') {
- fills14.push('solid');
- fills15.push('solid');
- }
- if (fills1[0] === 'stripped' && fills1[2] === 'quadrillage' && fills1[5] === 'open') {
- fills14.push('solid');
- fills15.push('solid');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'stripped' && fills1[5] === 'open') {
- fills14.push('solid');
- fills15.push('solid');
- }
- if (fills1[0] === 'quadrillage' && fills1[2] === 'open' && fills1[5] === 'stripped') {
- fills14.push('solid');
- fills15.push('solid');
- }
- if (fills1[0] === 'open' && fills1[2] === 'quadrillage' && fills1[5] === 'stripped') {
- fills14.push('solid');
- fills15.push('solid');
- }
- if (fills1[0] === 'open' && fills1[2] === 'stripped' && fills1[5] === 'quadrillage') {
- fills14.push('solid');
- fills15.push('solid');
- }
- }
- if (numbers1[0] === numbers1[2] && numbers1[0] === numbers1[5]) {
- numbers14.push(numbers1[0]);
- numbers15.push(numbers1[0]);
- } else {
- if (numbers1[0] === 1 && numbers1[2] === 2 && numbers1[5] === 3) {
- numbers14.push(4);
- numbers15.push(4);
- }
- if (numbers1[0] === 1 && numbers1[2] === 3 && numbers1[5] === 2) {
- numbers14.push(4);
- numbers15.push(4);
- }
+ deselectCard0: function(card) {
+ var self = this;
+ var index = self.selected0.indexOf(card);
+ if (index > -1) {
+ self.selected0.splice(index, 1);
+ }
+ $(card).removeClass('selected');
+ },
+ deselectCard: function(card) {
+ var self = this;
+ var index = self.selected.indexOf(card);
+ if (index > -1) {
+ self.selected.splice(index, 1);
+ }
+ $(card).removeClass('selected');
+ },
+ deselectCard1: function(card) {
+ var self = this;
+ var index = self.selected1.indexOf(card);
+ if (index > -1) {
+ self.selected1.splice(index, 1);
+ }
+ $(card).removeClass('selected');
+ },
+ deselectCard2: function(card) {
+ var self = this;
+ var index = self.selected2.indexOf(card);
+ if (index > -1) {
+ self.selected2.splice(index, 1);
+ }
+ $(card).removeClass('selected');
+ },
+ deselectCard3: function(card) {
+ var self = this;
+ var index = self.selected3.indexOf(card);
+ if (index > -1) {
+ self.selected3.splice(index, 1);
+ }
+ $(card).removeClass('selected');
+ },
+ deselectCard4: function(card) {
+ var self = this;
+ var index = self.selected4.indexOf(card);
+ if (index > -1) {
+ self.selected4.splice(index, 1);
+ }
+ $(card).removeClass('selected');
+ },
+ deselectCardHS: function(card) {
+ var self = this;
+ var index = self.selectedHS.indexOf(card);
+ if (index > -1) {
+ self.selectedHS.splice(index, 1);
+ }
+ $(card).removeClass('selected');
+ },
- if (numbers1[0] === 2 && numbers1[2] === 1 && numbers1[5] === 3) {
- numbers14.push(4);
- numbers15.push(4);
- }
- if (numbers1[0] === 2 && numbers1[2] === 3 && numbers1[5] === 1) {
- numbers14.push(4);
- numbers15.push(4);
- }
+ deselectCardHS0: function(card) {
+ var self = this;
+ var index = self.selectedHS0.indexOf(card);
+ if (index > -1) {
+ self.selectedHS0.splice(index, 1);
+ }
+ $(card).removeClass('selected');
+ },
- if (numbers1[0] === 3 && numbers1[2] === 1 && numbers1[5] === 2) {
- numbers14.push(4);
- numbers15.push(4);
- }
- if (numbers1[0] === 3 && numbers1[2] === 2 && numbers1[5] === 1) {
- numbers14.push(4);
- numbers15.push(4);
- }
+ deselectCardHS1: function(card) {
+ var self = this;
+ var index = self.selectedHS1.indexOf(card);
+ if (index > -1) {
+ self.selectedHS1.splice(index, 1);
+ }
+ $(card).removeClass('selected');
+ },
+ deselectCardHS2: function(card) {
+ var self = this;
+ var index = self.selectedHS2.indexOf(card);
+ if (index > -1) {
+ self.selectedHS2.splice(index, 1);
+ }
+ $(card).removeClass('selected');
+ },
- if (numbers1[0] === 1 && numbers1[2] === 2 && numbers1[5] === 4) {
- numbers14.push(3);
- numbers15.push(3);
- }
- if (numbers1[0] === 1 && numbers1[2] === 4 && numbers1[5] === 2) {
- numbers14.push(3);
- numbers15.push(3);
- }
- if (numbers1[0] === 2 && numbers1[2] === 1 && numbers1[5] === 4) {
- numbers14.push(3);
- numbers15.push(3);
- }
- if (numbers1[0] === 2 && numbers1[2] === 4 && numbers1[5] === 1) {
- numbers14.push(3);
- numbers15.push(3);
- }
- if (numbers1[0] === 4 && numbers1[2] === 1 && numbers1[5] === 2) {
- numbers14.push(3);
- numbers15.push(3);
- }
- if (numbers1[0] === 4 && numbers1[2] === 2 && numbers1[5] === 1) {
- numbers14.push(3);
- numbers15.push(3);
- }
- if (numbers1[0] === 1 && numbers1[2] === 3 && numbers1[5] === 4) {
- numbers14.push(2);
- numbers15.push(2);
- }
- if (numbers1[0] === 1 && numbers1[2] === 4 && numbers1[5] === 3) {
- numbers14.push(2);
- numbers15.push(2);
- }
- if (numbers1[0] === 3 && numbers1[2] === 1 && numbers1[5] === 4) {
- numbers14.push(2);
- numbers15.push(2);
- }
- if (numbers1[0] === 3 && numbers1[2] === 4 && numbers1[5] === 1) {
- numbers14.push(2);
- numbers15.push(2);
- }
- if (numbers1[0] === 4 && numbers1[2] === 1 && numbers1[5] === 3) {
- numbers14.push(2);
- numbers15.push(2);
- }
- if (numbers1[0] === 4 && numbers1[2] === 3 && numbers1[5] === 1) {
- numbers14.push(2);
- numbers15.push(2);
- }
- if (numbers1[0] === 2 && numbers1[2] === 3 && numbers1[5] === 4) {
- numbers14.push(1);
- numbers15.push(1);
- }
- if (numbers1[0] === 2 && numbers1[2] === 4 && numbers1[5] === 3) {
- numbers14.push(1);
- numbers15.push(1);
- }
- if (numbers1[0] === 3 && numbers1[2] === 2 && numbers1[5] === 4) {
- numbers14.push(1);
- numbers15.push(1);
- }
- if (numbers1[0] === 3 && numbers1[2] === 4 && numbers1[5] === 2) {
- numbers14.push(1);
- numbers15.push(1);
- }
- if (numbers1[0] === 4 && numbers1[2] === 2 && numbers1[5] === 3) {
- numbers14.push(1);
- numbers15.push(1);
- }
- if (numbers1[0] === 4 && numbers1[2] === 3 && numbers1[5] === 2) {
- numbers14.push(1);
- numbers15.push(1);
- }
- }
+ clearSelections0: function() {
+ $.each(this.selected0, function(index, card) {
+ $(card).removeClass('selected');
+ });
+ this.selected0 = [];
+ },
+ clearSelections: function() {
+ $.each(this.selected, function(index, card) {
+ $(card).removeClass('selected');
+ });
+ this.selected = [];
+ },
+ clearSelections1: function() {
+ $.each(this.selected1, function(index, card) {
+ $(card).removeClass('selected');
+ });
+ this.selected1 = [];
+ },
+ clearSelections2: function() {
+ $.each(this.selected2, function(index, card) {
+ $(card).removeClass('selected');
+ });
+ this.selected2 = [];
+ },
+ clearSelections3: function() {
+ $.each(this.selected3, function(index, card) {
+ $(card).removeClass('selected');
+ });
+ this.selected3 = [];
+ },
+ clearSelections4: function() {
+ $.each(this.selected4, function(index, card) {
+ $(card).removeClass('selected');
+ });
+ this.selected4 = [];
+ },
+ clearSelectionsHS: function() {
+ $.each(this.selectedHS, function(index, card) {
+ $(card).removeClass('selected');
+ });
+ this.selectedHS = [];
+ },
- if (colors1[0] === colors1 [3] && colors1[0] === colors1 [4]) {
- colors16.push(colors1[0]);
- colors17.push(colors1[0]);
- } else {
- if (colors1[0] === 'red' && colors1[3] === 'green' && colors1[4] === 'purple') {
- colors16.push('lightblue');
- colors17.push('lightblue');
- }
+ clearSelectionsHS0: function() {
+ $.each(this.selectedHS0, function(index, card) {
+ $(card).removeClass('selected');
+ });
+ this.selectedHS0 = [];
+ },
+ clearSelectionsHS1: function() {
+ $.each(this.selectedHS1, function(index, card) {
+ $(card).removeClass('selected');
+ });
+ this.selectedHS1 = [];
+ },
+ clearSelectionsHS2: function() {
+ $.each(this.selectedHS2, function(index, card) {
+ $(card).removeClass('selected');
+ });
+ this.selectedHS2 = [];
+ },
- if (colors1[0] === 'red' && colors1[3] === 'purple' && colors1[4] === 'green') {
- colors16.push('lightblue');
- colors17.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[3] === 'red' && colors1[4] === 'green') {
- colors16.push('lightblue');
- colors17.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[3] === 'green' && colors1[4] === 'red') {
- colors16.push('lightblue');
- colors17.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[3] === 'purple' && colors1[4] === 'red') {
- colors16.push('lightblue');
- colors17.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[3] === 'red' && colors1[4] === 'purple') {
- colors16.push('lightblue');
- colors17.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[3] === 'purple' && colors1[4] === 'lightblue') {
- colors16.push('red');
- colors17.push('red');
- }
- if (colors1[0] === 'green' && colors1[3] === 'lightblue' && colors1[4] === 'purple') {
- colors16.push('red');
- colors17.push('red');
- }
- if (colors1[0] === 'purple' && colors1[3] === 'lightblue' && colors1[4] === 'green') {
- colors16.push('red');
- colors17.push('red');
- }
- if (colors1[0] === 'purple' && colors1[3] === 'green' && colors1[4] === 'lightblue') {
- colors16.push('red');
- colors17.push('red');
- }
- if (colors1[0] === 'lightblue' && colors1[3] === 'purple' && colors1[4] === 'green') {
- colors16.push('red');
- colors17.push('red');
- }
- if (colors1[0] === 'lightblue' && colors1[3] === 'green' && colors1[4] === 'purple') {
- colors16.push('red');
- colors17.push('red');
- }
- if (colors1[0] === 'red' && colors1[3] === 'green' && colors1[4] === 'lightblue') {
- colors16.push('purple');
- colors17.push('purple');
- }
- if (colors1[0] === 'red' && colors1[3] === 'lightblue' && colors1[4] === 'green') {
- colors16.push('purple');
- colors17.push('purple');
- }
- if (colors1[0] === 'lightblue' && colors1[3] === 'green' && colors1[4] === 'red') {
- colors16.push('purple');
- colors17.push('purple');
- }
- if (colors1[0] === 'lightblue' && colors1[3] === 'red' && colors1[4] === 'green') {
- colors16.push('purple');
- colors17.push('purple');
- }
- if (colors1[0] === 'green' && colors1[3] === 'lightblue' && colors1[4] === 'red') {
- colors16.push('purple');
- colors17.push('purple');
- }
- if (colors1[0] === 'green' && colors1[3] === 'red' && colors1[4] === 'lightblue') {
- colors16.push('purple');
- colors17.push('purple');
- }
- if (colors1[0] === 'red' && colors1[3] === 'purple' && colors1[4] === 'lightblue') {
- colors16.push('green');
- colors17.push('green');
- }
- if (colors1[0] === 'red' && colors1[3] === 'lightblue' && colors1[4] === 'purple') {
- colors16.push('green');
- colors17.push('green');
- }
+// cards1 combinaison ab, cards2 combinaison cd, selectedCards(taille toujours 2) pré-effectuer les combinaison 0 et 1, 0 et 2, 0 et 3...
- if (colors1[0] === 'lightblue' && colors1[3] === 'purple' && colors1[4] === 'red') {
- colors16.push('green');
- colors17.push('green');
- }
- if (colors1[0] === 'lightblue' && colors1[3] === 'red' && colors1[4] === 'purple') {
- colors16.push('green');
- colors17.push('green');
- }
+ generateVirtualCard34: function(cards1, cards2){
+ var colors2= $.map(cards1, function(el) { return $(el).data("color");});
+ var shapes2 = $.map(cards1, function(el) { return $(el).data("shape");});
+ var fills2 = $.map(cards1, function(el) { return $(el).data("fills");});
+ var numbers2 = $.map(cards1, function(el) { return $(el).data("number");});
- if (colors1[0] === 'purple' && colors1[3] === 'lightblue' && colors1[4] === 'red') {
- colors16.push('green');
- colors17.push('green');
- }
- if (colors1[0] === 'purple' && colors1[3] === 'red' && colors1[4] === 'lightblue') {
- colors16.push('green');
- colors17.push('green');
- }
+ var colors3= $.map(cards2, function(el) { return $(el).data("color");});
+ var shapes3 = $.map(cards2, function(el) { return $(el).data("shape");});
+ var fills3 = $.map(cards2, function(el) { return $(el).data("fills");});
+ var numbers3 = $.map(cards2, function(el) { return $(el).data("number");});
+ if(colors2[0] === colors2 [1]){
+ colors2.push(colors2[0]);
+ colors3.push(colors2[0]);
}
-
-
- if (shapes1[0] === shapes1 [3] && shapes1[0] === shapes1 [4]) {
- shapes16.push(shapes1[0]);
- shapes17.push(shapes1[0]);
- } else {
- if (shapes1[0] === 'oval' && shapes1[3] === 'diamond' && shapes1[4] === 'wave') {
- shapes16.push('rectangle');
- shapes17.push('rectangle');
+ else{
+ if(colors2[0] === 'red' && colors2[1] === 'green'){
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (shapes1[0] === 'oval' && shapes1[3] === 'wave' && shapes1[4] === 'diamond') {
- shapes16.push('rectangle');
- shapes17.push('rectangle');
+ if(colors2[0] === 'red' && colors2[1] === 'purple'){
+ colors3.push('green');
+ colors2.push('green');
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'diamond' && shapes1[4] === 'oval') {
- shapes16.push('rectangle');
- shapes17.push('rectangle');
-
+ if(colors2[0] === 'green' && colors2[1] === 'purple'){
+ colors3.push('red');
+ colors2.push('red');
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'oval' && shapes1[4] === 'diamond') {
- shapes16.push('rectangle');
- shapes17.push('rectangle');
+ if(colors2[0] === 'green' && colors2[1] === 'red'){
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'oval' && shapes1[4] === 'wave') {
- shapes16.push('rectangle');
- shapes17.push('rectangle');
+ if(colors2[0] === 'purple' && colors2[1] === 'red'){
+ colors3.push('green');
+ colors2.push('green');
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'wave' && shapes1[4] === 'oval') {
- shapes16.push('rectangle');
- shapes17.push('rectangle');
+ if(colors2[0] === 'purple' && colors2[1] === 'green'){
+ colors3.push('red');
+ colors2.push('red');
}
-
- if (shapes1[0] === 'oval' && shapes1[3] === 'diamond' && shapes1[4] === 'rectangle') {
- shapes16.push('wave');
- shapes17.push('wave');
+ }
+ if(shapes2[0] === shapes2 [1]){
+ shapes3.push(shapes2[0]);
+ shapes2.push(shapes2[0]);
+ }
+ else{
+ if(shapes2[0] === 'oval' && shapes2[1] === 'diamond'){
+ shapes3.push('wave');
+ shapes2.push('wave');
}
- if (shapes1[0] === 'oval' && shapes1[3] === 'rectangle' && shapes1[4] === 'diamond') {
- shapes16.push('wave');
- shapes17.push('wave');
+ if(shapes2[0] === 'oval' && shapes2[1] === 'wave'){
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'oval' && shapes1[4] === 'diamond') {
- shapes16.push('wave');
- shapes17.push('wave');
+ if(shapes2[0] === 'diamond' && shapes2[1] === 'oval'){
+ shapes3.push('wave');
+ shapes2.push('wave');
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'diamond' && shapes1[4] === 'oval') {
- shapes16.push('wave');
- shapes17.push('wave');
+ if(shapes2[0] === 'diamond' && shapes2[1] === 'wave'){
+ shapes3.push('oval');
+ shapes2.push('oval');
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'oval' && shapes1[4] === 'rectangle') {
- shapes16.push('wave');
- shapes17.push('wave');
+ if(shapes2[0] === 'wave' && shapes2[1] === 'diamond'){
+ shapes3.push('oval');
+ shapes2.push('oval');
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'rectangle' && shapes1[4] === 'oval') {
- shapes16.push('wave');
- shapes17.push('wave');
+ if(shapes2[0] === 'wave' && shapes2[1] === 'oval'){
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
-
-
- if (shapes1[0] === 'oval' && shapes1[3] === 'wave' && shapes1[4] === 'rectangle') {
- shapes16.push('diamond');
- shapes17.push('diamond');
+ }
+ if(fills2[0] === fills2 [1]){
+ fills3.push(fills2[0]);
+ fills2.push(fills2[0]);
+ }
+ else{
+ if(fills2[0] === 'solid' && fills2[1] === 'stripped'){
+ fills3.push('open');
+ fills2.push('open');
}
- if (shapes1[0] === 'oval' && shapes1[3] === 'rectangle' && shapes1[4] === 'wave') {
- shapes16.push('diamond');
- shapes17.push('diamond');
+ if(fills2[0] === 'solid' && fills2[1] === 'open'){
+ fills3.push('stripped');
+ fills2.push('stripped');
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'wave' && shapes1[4] === 'oval') {
- shapes16.push('diamond');
- shapes17.push('diamond');
-
+ if(fills2[0] === 'stripped' && fills2[1] === 'open'){
+ fills3.push('solid');
+ fills2.push('solid');
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'oval' && shapes1[4] === 'wave') {
- shapes16.push('diamond');
- shapes17.push('diamond');
+ if(fills2[0] === 'open' && fills2[1] === 'stripped'){
+ fills3.push('solid');
+ fills2.push('solid');
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'oval' && shapes1[4] === 'rectangle') {
- shapes16.push('diamond');
- shapes17.push('diamond');
+ if(fills2[0] === 'stripped' && fills2[1] === 'solid'){
+ fills3.push('open');
+ fills2.push('open');
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'rectangle' && shapes1[4] === 'oval') {
- shapes16.push('diamond');
- shapes17.push('diamond');
+ if(fills2[0] === 'open' && fills2[1] === 'solid'){
+ fills3.push('stripped');
+ fills2.push('stripped');
}
-
-
- if (shapes1[0] === 'diamond' && shapes1[3] === 'wave' && shapes1[4] === 'rectangle') {
- shapes16.push('oval');
- shapes17.push('oval');
+ }
+ if(numbers2[0] === numbers2[1]){
+ numbers3.push(numbers2[0]);
+ numbers2.push(numbers2[0]);
+ }
+ else{
+ if(numbers2[0] === 1 && numbers2[1] === 2){
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'rectangle' && shapes1[4] === 'wave') {
- shapes16.push('oval');
- shapes17.push('oval');
+ if(numbers2[0] === 1 && numbers2[1] === 3){
+ numbers3.push(2);
+ numbers2.push(2);
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'wave' && shapes1[4] === 'diamond') {
- shapes16.push('oval');
- shapes17.push('oval');
-
+ if(numbers2[0] === 2 && numbers2[1] === 1){
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'diamond' && shapes1[4] === 'wave') {
- shapes16.push('oval');
- shapes17.push('oval');
+ if(numbers2[0] === 2 && numbers2[1] === 3){
+ numbers3.push(1);
+ numbers2.push(1);
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'diamond' && shapes1[4] === 'rectangle') {
- shapes16.push('oval');
- shapes17.push('oval');
+ if(numbers2[0] === 3 && numbers2[1] === 1){
+ numbers3.push(2);
+ numbers2.push(2);
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'rectangle' && shapes1[4] === 'diamond') {
- shapes16.push('oval');
- shapes17.push('oval');
+ if(numbers2[0] === 3 && numbers2[1] === 2){
+ numbers3.push(1);
+ numbers2.push(1);
}
}
- if (fills1[0] === fills1 [3]&& fills1[0] === fills1 [4]) {
- fills16.push(fills1[0]);
- fills17.push(fills1[0]);
- } else {
- if (fills1[0] === 'solid' && fills1[3] === 'stripped' && fills1[4] === 'open') {
- fills16.push('quadrillage');
- fills17.push('quadrillage');
- }
-
- if (fills1[0] === 'solid' && fills1[3] === 'open' && fills1[4] === 'stripped') {
- fills16.push('quadrillage');
- fills17.push('quadrillage');
- }
- if (fills1[0] === 'stripped' && fills1[3] === 'open' && fills1[4] === 'solid') {
- fills16.push('quadrillage');
- fills17.push('quadrillage');
- }
- if (fills1[0] === 'stripped' && fills1[3] === 'solid' && fills1[4] === 'open') {
- fills16.push('quadrillage');
- fills17.push('quadrillage');
- }
-
- if (fills1[0] === 'open' && fills1[3] === 'stripped' && fills1[4] === 'solid') {
- fills16.push('quadrillage');
- fills17.push('quadrillage');
- }
- if (fills1[0] === 'open' && fills1[3] === 'solid' && fills1[4] === 'stripped') {
- fills16.push('quadrillage');
- fills17.push('quadrillage');
- }
+ if(this.isSet(colors2) && this.isSet(shapes2) && this.isSet(fills2) && this.isSet(numbers2)) {
+ return this.isSet(colors3) && this.isSet(shapes3) && this.isSet(fills3) && this.isSet(numbers3)
+ }
+ },
- if (fills1[0] === 'solid' && fills1[3] === 'stripped' && fills1[4] === 'quadrillage') {
- fills16.push('open');
- fills17.push('open');
- }
+ generateVirtualCard33: function(cards1, cards2){
+ var colors2= $.map(cards1, function(el) { return $(el).data("color");});
+ var shapes2 = $.map(cards1, function(el) { return $(el).data("shape");});
+ var numbers2 = $.map(cards1, function(el) { return $(el).data("number");});
- if (fills1[0] === 'solid' && fills1[3] === 'quadrillage' && fills1[4] === 'stripped') {
- fills16.push('open');
- fills17.push('open');
- }
+ var colors3= $.map(cards2, function(el) { return $(el).data("color");});
+ var shapes3 = $.map(cards2, function(el) { return $(el).data("shape");});
+ var numbers3 = $.map(cards2, function(el) { return $(el).data("number");});
- if (fills1[0] === 'quadrillage' && fills1[3] === 'solid' && fills1[4] === 'stripped') {
- fills16.push('open');
- fills17.push('open');
- }
- if (fills1[0] === 'quadrillage' && fills1[3] === 'stripped' && fills1[4] === 'solid') {
- fills16.push('open');
- fills17.push('open');
+ if(colors2[0] === colors2 [1]){
+ colors2.push(colors2[0]);
+ colors3.push(colors2[0]);
+ }
+ else{
+ if(colors2[0] === 'red' && colors2[1] === 'green'){
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (fills1[0] === 'stripped' && fills1[3] === 'quadrillage' && fills1[4] === 'solid') {
- fills16.push('open');
- fills17.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[3] === 'solid' && fills1[4] === 'quadrillage') {
- fills16.push('open');
- fills17.push('open');
+ if(colors2[0] === 'red' && colors2[1] === 'purple'){
+ colors3.push('green');
+ colors2.push('green');
}
-
- if (fills1[0] === 'solid' && fills1[3] === 'open' && fills1[4] === 'quadrillage') {
- fills16.push('stripped');
- fills17.push('stripped');
+ if(colors2[0] === 'green' && colors2[1] === 'purple'){
+ colors3.push('red');
+ colors2.push('red');
}
-
- if (fills1[0] === 'solid' && fills1[3] === 'quadrillage' && fills1[4] === 'open') {
- fills16.push('stripped');
- fills17.push('stripped');
+ if(colors2[0] === 'green' && colors2[1] === 'red'){
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (fills1[0] === 'quadrillage' && fills1[3] === 'solid' && fills1[4] === 'open') {
- fills16.push('stripped');
- fills17.push('stripped');
+ if(colors2[0] === 'purple' && colors2[1] === 'red'){
+ colors3.push('green');
+ colors2.push('green');
}
- if (fills1[0] === 'quadrillage' && fills1[3] === 'open' && fills1[4] === 'solid') {
- fills16.push('stripped');
- fills17.push('stripped');
+ if(colors2[0] === 'purple' && colors2[1] === 'green'){
+ colors3.push('red');
+ colors2.push('red');
}
- if (fills1[0] === 'open' && fills1[3] === 'quadrillage' && fills1[4] === 'solid') {
- fills16.push('stripped');
- fills17.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[3] === 'solid' && fills1[4] === 'quadrillage') {
- fills16.push('stripped');
- fills17.push('stripped');
+ }
+ if(shapes2[0] === shapes2 [1]){
+ shapes3.push(shapes2[0]);
+ shapes2.push(shapes2[0]);
+ }
+ else{
+ if(shapes2[0] === 'oval' && shapes2[1] === 'diamond'){
+ shapes3.push('wave');
+ shapes2.push('wave');
}
-
- if (fills1[0] === 'stripped' && fills1[3] === 'open' && fills1[4] === 'quadrillage') {
- fills16.push('solid');
- fills17.push('solid');
+ if(shapes2[0] === 'oval' && shapes2[1] === 'wave'){
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
- if (fills1[0] === 'stripped' && fills1[3] === 'quadrillage' && fills1[4] === 'open') {
- fills16.push('solid');
- fills17.push('solid');
- }
+ if(shapes2[0] === 'diamond' && shapes2[1] === 'oval'){
+ shapes3.push('wave');
+ shapes2.push('wave');
- if (fills1[0] === 'quadrillage' && fills1[3] === 'stripped' && fills1[4] === 'open') {
- fills16.push('solid');
- fills17.push('solid');
}
- if (fills1[0] === 'quadrillage' && fills1[3] === 'open' && fills1[4] === 'stripped') {
- fills16.push('solid');
- fills17.push('solid');
+ if(shapes2[0] === 'diamond' && shapes2[1] === 'wave'){
+ shapes3.push('oval');
+ shapes2.push('oval');
}
- if (fills1[0] === 'open' && fills1[3] === 'quadrillage' && fills1[4] === 'stripped') {
- fills16.push('solid');
- fills17.push('solid');
+ if(shapes2[0] === 'wave' && shapes2[1] === 'diamond'){
+ shapes3.push('oval');
+ shapes2.push('oval');
}
- if (fills1[0] === 'open' && fills1[3] === 'stripped' && fills1[4] === 'quadrillage') {
- fills16.push('solid');
- fills17.push('solid');
+ if(shapes2[0] === 'wave' && shapes2[1] === 'oval'){
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
+ }
-
+ if(numbers2[0] === numbers2[1]){
+ numbers3.push(numbers2[0]);
+ numbers2.push(numbers2[0]);
}
- if (numbers1[0] === numbers1[3] && numbers1[0]=== numbers1[4]) {
- numbers16.push(numbers1[0]);
- numbers17.push(numbers1[0]);
- } else {
- if (numbers1[0] === 1 && numbers1[3] === 2 && numbers1[4] === 3) {
- numbers16.push(4);
- numbers17.push(4);
+ else{
+ if(numbers2[0] === 1 && numbers2[1] === 2){
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (numbers1[0] === 1 && numbers1[3] === 3 && numbers1[4] === 2) {
- numbers16.push(4);
- numbers17.push(4);
+ if(numbers2[0] === 1 && numbers2[1] === 3){
+ numbers3.push(2);
+ numbers2.push(2);
}
- if (numbers1[0] === 2 && numbers1[3] === 1 && numbers1[4] === 3) {
- numbers16.push(4);
- numbers17.push(4);
+ if(numbers2[0] === 2 && numbers2[1] === 1){
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (numbers1[0] === 2 && numbers1[3] === 3 && numbers1[4] === 1) {
- numbers16.push(4);
- numbers17.push(4);
+ if(numbers2[0] === 2 && numbers2[1] === 3){
+ numbers3.push(1);
+ numbers2.push(1);
}
- if (numbers1[0] === 3 && numbers1[3] === 1 && numbers1[4] === 2) {
- numbers16.push(4);
- numbers17.push(4);
- }
- if (numbers1[0] === 3 && numbers1[3] === 2 && numbers1[4] === 1) {
- numbers16.push(4);
- numbers17.push(4);
+ if(numbers2[0] === 3 && numbers2[1] === 1){
+ numbers3.push(2);
+ numbers2.push(2);
}
-
-
- if (numbers1[0] === 1 && numbers1[3] === 2 && numbers1[4] === 4) {
- numbers16.push(3);
- numbers17.push(3);
+ if(numbers2[0] === 3 && numbers2[1] === 2){
+ numbers3.push(1);
+ numbers2.push(1);
}
- if (numbers1[0] === 1 && numbers1[3] === 4 && numbers1[4] === 2) {
- numbers16.push(3);
- numbers17.push(3);
- }
+ }
- if (numbers1[0] === 2 && numbers1[3] === 1 && numbers1[4] === 4) {
- numbers16.push(3);
- numbers17.push(3);
- }
- if (numbers1[0] === 2 && numbers1[3] === 4 && numbers1[4] === 1) {
- numbers16.push(3);
- numbers17.push(3);
- }
+ if(this.isSet(colors2) && this.isSet(shapes2) && this.isSet(numbers2)) {
+ return this.isSet(colors3) && this.isSet(shapes3) && this.isSet(numbers3)
+ }
+ },
- if (numbers1[0] === 4 && numbers1[3] === 1 && numbers1[4] === 2) {
- numbers16.push(3);
- numbers17.push(3);
- }
- if (numbers1[0] === 4 && numbers1[3] === 2 && numbers1[4] === 1) {
- numbers16.push(3);
- numbers17.push(3);
- }
+ generateVirtualCard35: function(cards1, cards2){
+ // modalité des combinaison de carte (ab ac ad ...) pour verifier si forme un set
+ var colors2= $.map(cards1, function(el) { return $(el).data("color");});
+ var shapes2 = $.map(cards1, function(el) { return $(el).data("shape");});
+ var fills2 = $.map(cards1, function(el) { return $(el).data("fills");});
+ var borders2 = $.map(cards1, function(el) { return $(el).data("border");});
+ var numbers2 = $.map(cards1, function(el) { return $(el).data("number");});
- if (numbers1[0] === 1 && numbers1[3] === 3 && numbers1[4] === 4) {
- numbers16.push(2);
- numbers17.push(2);
- }
+ var colors3= $.map(cards2, function(el) { return $(el).data("color");});
+ var shapes3 = $.map(cards2, function(el) { return $(el).data("shape");});
+ var fills3 = $.map(cards2, function(el) { return $(el).data("fills");});
+ var borders3 = $.map(cards2, function(el) { return $(el).data("border");});
+ var numbers3 = $.map(cards2, function(el) { return $(el).data("number");});
- if (numbers1[0] === 1 && numbers1[3] === 4 && numbers1[4] === 3) {
- numbers16.push(2);
- numbers17.push(2);
- }
- if (numbers1[0] === 3 && numbers1[3] === 1 && numbers1[4] === 4) {
- numbers16.push(2);
- numbers17.push(2);
- }
- if (numbers1[0] === 3 && numbers1[3] === 4 && numbers1[4] === 1) {
- numbers16.push(2);
- numbers17.push(2);
+ if(colors2[0] === colors2 [1]){
+ colors2.push(colors2[0]);
+ colors3.push(colors2[0]);
+ }
+ else{
+ if(colors2[0] === 'red' && colors2[1] === 'green'){
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (numbers1[0] === 4 && numbers1[3] === 1 && numbers1[4] === 3) {
- numbers16.push(2);
- numbers17.push(2);
- }
- if (numbers1[0] === 4 && numbers1[3] === 3 && numbers1[4] === 1) {
- numbers16.push(2);
- numbers17.push(2);
+ if(colors2[0] === 'red' && colors2[1] === 'purple'){
+ colors3.push('green');
+ colors2.push('green');
}
-
- if (numbers1[0] === 2 && numbers1[3] === 3 && numbers1[4] === 4) {
- numbers16.push(1);
- numbers17.push(1);
+ if(colors2[0] === 'green' && colors2[1] === 'purple'){
+ colors3.push('red');
+ colors2.push('red');
}
-
- if (numbers1[0] === 2 && numbers1[3] === 4 && numbers1[4] === 3) {
- numbers16.push(1);
- numbers17.push(1);
+ if(colors2[0] === 'green' && colors2[1] === 'red'){
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (numbers1[0] === 3 && numbers1[3] === 2 && numbers1[4] === 4) {
- numbers16.push(1);
- numbers17.push(1);
+ if(colors2[0] === 'purple' && colors2[1] === 'red'){
+ colors3.push('green');
+ colors2.push('green');
}
- if (numbers1[0] === 3 && numbers1[3] === 4 && numbers1[4] === 2) {
- numbers16.push(1);
- numbers17.push(1);
+ if(colors2[0] === 'purple' && colors2[1] === 'green'){
+ colors3.push('red');
+ colors2.push('red');
}
- if (numbers1[0] === 4 && numbers1[3] === 2 && numbers1[4] === 3) {
- numbers16.push(1);
- numbers17.push(1);
- }
- if (numbers1[0] === 4 && numbers1[3] === 3 && numbers1[4] === 2) {
- numbers16.push(1);
- numbers17.push(1);
- }
}
-
-
-
-
-
-
-
-
- if (colors1[0] === colors1 [3] && colors1[0] === colors1 [5]) {
- colors18.push(colors1[0]);
- colors19.push(colors1[0]);
- } else {
- if (colors1[0] === 'red' && colors1[3] === 'green' && colors1[5] === 'purple') {
- colors18.push('lightblue');
- colors19.push('lightblue');
+ if(shapes2[0] === shapes2 [1]){
+ shapes3.push(shapes2[0]);
+ shapes2.push(shapes2[0]);
+ }
+ else{
+ if(shapes2[0] === 'oval' && shapes2[1] === 'diamond'){
+ shapes3.push('wave');
+ shapes2.push('wave');
}
- if (colors1[0] === 'red' && colors1[3] === 'purple' && colors1[5] === 'green') {
- colors18.push('lightblue');
- colors19.push('lightblue');
+ if(shapes2[0] === 'oval' && shapes2[1] === 'wave'){
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
- if (colors1[0] === 'purple' && colors1[3] === 'red' && colors1[5] === 'green') {
- colors18.push('lightblue');
- colors19.push('lightblue');
+ if(shapes2[0] === 'diamond' && shapes2[1] === 'oval'){
+ shapes3.push('wave');
+ shapes2.push('wave');
+
}
- if (colors1[0] === 'purple' && colors1[3] === 'green' && colors1[5] === 'red') {
- colors18.push('lightblue');
- colors19.push('lightblue');
+ if(shapes2[0] === 'diamond' && shapes2[1] === 'wave'){
+ shapes3.push('oval');
+ shapes2.push('oval');
}
- if (colors1[0] === 'green' && colors1[3] === 'purple' && colors1[5] === 'red') {
- colors18.push('lightblue');
- colors19.push('lightblue');
+ if(shapes2[0] === 'wave' && shapes2[1] === 'diamond'){
+ shapes3.push('oval');
+ shapes2.push('oval');
}
- if (colors1[0] === 'green' && colors1[3] === 'red' && colors1[5] === 'purple') {
- colors18.push('lightblue');
- colors19.push('lightblue');
+ if(shapes2[0] === 'wave' && shapes2[1] === 'oval'){
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
-
-
- if (colors1[0] === 'green' && colors1[3] === 'purple' && colors1[5] === 'lightblue') {
- colors18.push('red');
- colors19.push('red');
+ }
+ if(fills2[0] === fills2 [1]){
+ fills3.push(fills2[0]);
+ fills2.push(fills2[0]);
+ }
+ else{
+ if(fills2[0] === 'solid' && fills2[1] === 'stripped'){
+ fills3.push('open');
+ fills2.push('open');
}
- if (colors1[0] === 'green' && colors1[3] === 'lightblue' && colors1[5] === 'purple') {
- colors18.push('red');
- colors19.push('red');
+ if(fills2[0] === 'solid' && fills2[1] === 'open'){
+ fills3.push('stripped');
+ fills2.push('stripped');
}
- if (colors1[0] === 'purple' && colors1[3] === 'lightblue' && colors1[5] === 'green') {
- colors18.push('red');
- colors19.push('red');
+ if(fills2[0] === 'stripped' && fills2[1] === 'open'){
+ fills3.push('solid');
+ fills2.push('solid');
}
- if (colors1[0] === 'purple' && colors1[3] === 'green' && colors1[5] === 'lightblue') {
- colors18.push('red');
- colors19.push('red');
+ if(fills2[0] === 'open' && fills2[1] === 'stripped'){
+ fills3.push('solid');
+ fills2.push('solid');
}
- if (colors1[0] === 'lightblue' && colors1[3] === 'purple' && colors1[5] === 'green') {
- colors18.push('red');
- colors19.push('red');
+ if(fills2[0] === 'stripped' && fills2[1] === 'solid'){
+ fills3.push('open');
+ fills2.push('open');
}
- if (colors1[0] === 'lightblue' && colors1[3] === 'green' && colors1[5] === 'purple') {
- colors18.push('red');
- colors19.push('red');
+ if(fills2[0] === 'open' && fills2[1] === 'solid'){
+ fills3.push('stripped');
+ fills2.push('stripped');
}
+ }
-
- if (colors1[0] === 'red' && colors1[3] === 'green' && colors1[5] === 'lightblue') {
- colors18.push('purple');
- colors19.push('purple');
+ if(borders2[0] === borders2 [1]){
+ borders3.push(borders2[0]);
+ borders2.push(borders2[0]);
+ }
+ else{
+ if(borders2[0] === 'plein' && borders2[1] === 'point'){
+ borders3.push('rond');
+ borders2.push('rond');
}
- if (colors1[0] === 'red' && colors1[3] === 'lightblue' && colors1[5] === 'green') {
- colors18.push('purple');
- colors19.push('purple');
+ if(borders2[0] === 'point' && borders2[1] === 'plein'){
+ borders3.push('rond');
+ borders2.push('rond');
}
- if (colors1[0] === 'lightblue' && colors1[3] === 'green' && colors1[5] === 'red') {
- colors18.push('purple');
- colors19.push('purple');
+ if(borders2[0] === 'rond' && borders2[1] === 'plein'){
+ borders3.push('point');
+ borders2.push('point');
}
- if (colors1[0] === 'lightblue' && colors1[3] === 'red' && colors1[5] === 'green') {
- colors18.push('purple');
- colors19.push('purple');
+ if(borders2[0] === 'plein' && borders2[1] === 'rond'){
+ borders3.push('point');
+ borders2.push('point');
}
- if (colors1[0] === 'green' && colors1[3] === 'lightblue' && colors1[5] === 'red') {
- colors18.push('purple');
- colors19.push('purple');
+ if(borders2[0] === 'rond' && borders2[1] === 'point'){
+ borders3.push('plein');
+ borders2.push('plein');
}
- if (colors1[0] === 'green' && colors1[3] === 'red' && colors1[5] === 'lightblue') {
- colors18.push('purple');
- colors19.push('purple');
+ if(borders2[0] === 'point' && borders2[1] === 'rond'){
+ borders3.push('plein');
+ borders2.push('plein');
}
+ }
-
- if (colors1[0] === 'red' && colors1[3] === 'purple' && colors1[5] === 'lightblue') {
- colors18.push('green');
- colors19.push('green');
+ if(numbers2[0] === numbers2[1]){
+ numbers3.push(numbers2[0]);
+ numbers2.push(numbers2[0]);
+ }
+ else{
+ if(numbers2[0] === 1 && numbers2[1] === 2){
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (colors1[0] === 'red' && colors1[3] === 'lightblue' && colors1[5] === 'purple') {
- colors18.push('green');
- colors19.push('green');
+ if(numbers2[0] === 1 && numbers2[1] === 3){
+ numbers3.push(2);
+ numbers2.push(2);
}
- if (colors1[0] === 'lightblue' && colors1[3] === 'purple' && colors1[5] === 'red') {
- colors18.push('green');
- colors19.push('green');
+ if(numbers2[0] === 2 && numbers2[1] === 1){
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (colors1[0] === 'lightblue' && colors1[3] === 'red' && colors1[5] === 'purple') {
- colors18.push('green');
- colors19.push('green');
+ if(numbers2[0] === 2 && numbers2[1] === 3){
+ numbers3.push(1);
+ numbers2.push(1);
}
- if (colors1[0] === 'purple' && colors1[3] === 'lightblue' && colors1[5] === 'red') {
- colors18.push('green');
- colors19.push('green');
+ if(numbers2[0] === 3 && numbers2[1] === 1){
+ numbers3.push(2);
+ numbers2.push(2);
}
- if (colors1[0] === 'purple' && colors1[3] === 'red' && colors1[5] === 'lightblue') {
- colors18.push('green');
- colors19.push('green');
+ if(numbers2[0] === 3 && numbers2[1] === 2){
+ numbers3.push(1);
+ numbers2.push(1);
}
}
+ if(this.isSet(colors2) && this.isSet(shapes2) && this.isSet(fills2) && this.isSet(borders2) && this.isSet(numbers2)) {
+ return this.isSet(colors3) && this.isSet(shapes3) && this.isSet(fills3) && this.isSet(borders3) && this.isSet(numbers3)
+ }
+ },
+
- if (shapes1[0] === shapes1 [3] && shapes1[0] === shapes1 [5]) {
- shapes18.push(shapes1[0]);
- shapes19.push(shapes1[0]);
+ generateVirtualCard44: function(cards1, cards2){
+
+ var colors2= $.map(cards1, function(el) { return $(el).data("color");});
+ var shapes2 = $.map(cards1, function(el) { return $(el).data("shape");});
+ var fills2 = $.map(cards1, function(el) { return $(el).data("fills");});
+ var numbers2 = $.map(cards1, function(el) { return $(el).data("number");});
+
+ var colors3= $.map(cards2, function(el) { return $(el).data("color");});
+ var shapes3 = $.map(cards2, function(el) { return $(el).data("shape");});
+ var fills3 = $.map(cards2, function(el) { return $(el).data("fills");});
+ var numbers3 = $.map(cards2, function(el) { return $(el).data("number");});
+
+ if (colors2[0] === colors2[1] && colors2[0] === colors2[2]) {
+ colors2.push(colors2[0]);
+ colors3.push(colors2[0]);
} else {
- if (shapes1[0] === 'oval' && shapes1[3] === 'diamond' && shapes1[5] === 'wave') {
- shapes18.push('rectangle');
- shapes19.push('rectangle');
+ if (colors2[0] === 'red' && colors2[1] === 'green' && colors2[2] === 'purple') {
+ colors3.push('lightblue');
+ colors2.push('lightblue');
}
- if (shapes1[0] === 'oval' && shapes1[3] === 'wave' && shapes1[5] === 'diamond') {
- shapes18.push('rectangle');
- shapes19.push('rectangle');
+ if (colors2[0] === 'red' && colors2[1] === 'purple' && colors2[2] === 'green') {
+ colors3.push('lightblue');
+ colors2.push('lightblue');
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'diamond' && shapes1[5] === 'oval') {
- shapes18.push('rectangle');
- shapes19.push('rectangle');
-
+ if (colors2[0] === 'purple' && colors2[1] === 'red' && colors2[2] === 'green') {
+ colors3.push('lightblue');
+ colors2.push('lightblue');
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'oval' && shapes1[5] === 'diamond') {
- shapes18.push('rectangle');
- shapes19.push('rectangle');
+ if (colors2[0] === 'purple' && colors2[1] === 'green' && colors2[2] === 'red') {
+ colors3.push('lightblue');
+ colors2.push('lightblue');
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'oval' && shapes1[5] === 'wave') {
- shapes18.push('rectangle');
- shapes19.push('rectangle');
+ if (colors2[0] === 'green' && colors2[1] === 'purple' && colors2[2] === 'red') {
+ colors3.push('lightblue');
+ colors2.push('lightblue');
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'wave' && shapes1[5] === 'oval') {
- shapes18.push('rectangle');
- shapes19.push('rectangle');
+ if (colors2[0] === 'green' && colors2[1] === 'red' && colors2[2] === 'purple') {
+ colors3.push('lightblue');
+ colors2.push('lightblue');
}
- if (shapes1[0] === 'oval' && shapes1[3] === 'diamond' && shapes1[5] === 'rectangle') {
- shapes18.push('wave');
- shapes19.push('wave');
- }
+ if (colors2[0] === 'green' && colors2[1] === 'purple' && colors2[2] === 'lightblue') {
+ colors3.push('red');
+ colors2.push('red');
- if (shapes1[0] === 'oval' && shapes1[3] === 'rectangle' && shapes1[5] === 'diamond') {
- shapes18.push('wave');
- shapes19.push('wave');
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'oval' && shapes1[5] === 'diamond') {
- shapes18.push('wave');
- shapes19.push('wave');
+ if (colors2[0] === 'green' && colors2[1] === 'lightblue' && colors2[2] === 'purple') {
+ colors3.push('red');
+ colors2.push('red');
+ }
+ if (colors2[0] === 'purple' && colors2[1] === 'lightblue' && colors2[2] === 'green') {
+ colors3.push('red');
+ colors2.push('red');
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'diamond' && shapes1[5] === 'oval') {
- shapes18.push('wave');
- shapes19.push('wave');
+ if (colors2[0] === 'purple' && colors2[1] === 'green' && colors2[2] === 'lightblue') {
+ colors3.push('red');
+ colors2.push('red');
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'oval' && shapes1[5] === 'rectangle') {
- shapes18.push('wave');
- shapes19.push('wave');
+ if (colors2[0] === 'lightblue' && colors2[1] === 'purple' && colors2[2] === 'green') {
+ colors3.push('red');
+ colors2.push('red');
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'rectangle' && shapes1[5] === 'oval') {
- shapes18.push('wave');
- shapes19.push('wave');
+ if (colors2[0] === 'lightblue' && colors2[1] === 'green' && colors2[2] === 'purple') {
+ colors3.push('red');
+ colors2.push('red');
}
- if (shapes1[0] === 'oval' && shapes1[3] === 'wave' && shapes1[5] === 'rectangle') {
- shapes18.push('diamond');
- shapes19.push('diamond');
+ if (colors2[0] === 'red' && colors2[1] === 'green' && colors2[2] === 'lightblue') {
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (shapes1[0] === 'oval' && shapes1[3] === 'rectangle' && shapes1[5] === 'wave') {
- shapes18.push('diamond');
- shapes19.push('diamond');
+ if (colors2[0] === 'red' && colors2[1] === 'lightblue' && colors2[2] === 'green') {
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'wave' && shapes1[5] === 'oval') {
- shapes18.push('diamond');
- shapes19.push('diamond');
-
+ if (colors2[0] === 'lightblue' && colors2[1] === 'green' && colors2[2] === 'red') {
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'oval' && shapes1[5] === 'wave') {
- shapes18.push('diamond');
- shapes19.push('diamond');
+ if (colors2[0] === 'lightblue' && colors2[1] === 'red' && colors2[2] === 'green') {
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'oval' && shapes1[5] === 'rectangle') {
- shapes18.push('diamond');
- shapes19.push('diamond');
+ if (colors2[0] === 'green' && colors2[1] === 'lightblue' && colors2[2] === 'red') {
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'rectangle' && shapes1[5] === 'oval') {
- shapes18.push('diamond');
- shapes19.push('diamond');
+ if (colors2[0] === 'green' && colors2[1] === 'red' && colors2[2] === 'lightblue') {
+ colors3.push('purple');
+ colors2.push('purple');
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'wave' && shapes1[5] === 'rectangle') {
- shapes18.push('oval');
- shapes19.push('oval');
+ if (colors2[0] === 'red' && colors2[1] === 'purple' && colors2[2] === 'lightblue') {
+ colors3.push('green');
+ colors2.push('green');
}
- if (shapes1[0] === 'diamond' && shapes1[3] === 'rectangle' && shapes1[5] === 'wave') {
- shapes18.push('oval');
- shapes19.push('oval');
+ if (colors2[0] === 'red' && colors2[1] === 'lightblue' && colors2[2] === 'purple') {
+ colors3.push('green');
+ colors2.push('green');
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'wave' && shapes1[5] === 'diamond') {
- shapes18.push('oval');
- shapes19.push('oval');
-
+ if (colors2[0] === 'lightblue' && colors2[1] === 'purple' && colors2[2] === 'red') {
+ colors3.push('green');
+ colors2.push('green');
}
- if (shapes1[0] === 'rectangle' && shapes1[3] === 'diamond' && shapes1[5] === 'wave') {
- shapes18.push('oval');
- shapes19.push('oval');
+ if (colors2[0] === 'lightblue' && colors2[1] === 'red' && colors2[2] === 'purple') {
+ colors3.push('green');
+ colors2.push('green');
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'diamond' && shapes1[5] === 'rectangle') {
- shapes18.push('oval');
- shapes19.push('oval');
+ if (colors2[0] === 'purple' && colors2[1] === 'lightblue' && colors2[2] === 'red') {
+ colors3.push('green');
+ colors2.push('green');
}
- if (shapes1[0] === 'wave' && shapes1[3] === 'rectangle' && shapes1[5] === 'diamond') {
- shapes18.push('oval');
- shapes19.push('oval');
+ if (colors2[0] === 'purple' && colors2[1] === 'red' && colors2[2] === 'lightblue') {
+ colors3.push('green');
+ colors2.push('green');
}
}
- if (fills1[0] === fills1 [3] && fills1[0] === fills1 [5]) {
- fills18.push(fills1[0]);
- fills19.push(fills1[0]);
+
+
+ if (shapes2[0] === shapes2 [1] && shapes2[0] === shapes2 [2]) {
+ shapes3.push(shapes2[0]);
+ shapes2.push(shapes2[0]);
} else {
- if (fills1[0] === 'solid' && fills1[3] === 'stripped' && fills1[5] === 'open') {
- fills18.push('quadrillage');
- fills19.push('quadrillage');
+ if (shapes2[0] === 'oval' && shapes2[1] === 'diamond' && shapes2[2] === 'wave') {
+ shapes3.push('rectangle');
+ shapes2.push('rectangle');
}
- if (fills1[0] === 'solid' && fills1[3] === 'open' && fills1[5] === 'stripped') {
- fills18.push('quadrillage');
- fills19.push('quadrillage');
+ if (shapes2[0] === 'oval' && shapes2[1] === 'wave' && shapes2[2] === 'diamond') {
+ shapes3.push('rectangle');
+ shapes2.push('rectangle');
}
- if (fills1[0] === 'stripped' && fills1[3] === 'open' && fills1[5] === 'solid') {
- fills18.push('quadrillage');
- fills19.push('quadrillage');
+ if (shapes2[0] === 'wave' && shapes2[1] === 'diamond' && shapes2[2] === 'oval') {
+ shapes3.push('rectangle');
+ shapes2.push('rectangle');
+
}
- if (fills1[0] === 'stripped' && fills1[3] === 'solid' && fills1[5] === 'open') {
- fills18.push('quadrillage');
- fills19.push('quadrillage');
+ if (shapes2[0] === 'wave' && shapes2[1] === 'oval' && shapes2[2] === 'diamond') {
+ shapes3.push('rectangle');
+ shapes2.push('rectangle');
}
- if (fills1[0] === 'open' && fills1[3] === 'stripped' && fills1[5] === 'solid') {
- fills18.push('quadrillage');
- fills19.push('quadrillage');
+ if (shapes2[0] === 'diamond' && shapes2[1] === 'oval' && shapes2[2] === 'wave') {
+ shapes3.push('rectangle');
+ shapes2.push('rectangle');
}
- if (fills1[0] === 'open' && fills1[3] === 'solid' && fills1[5] === 'stripped') {
- fills18.push('quadrillage');
- fills19.push('quadrillage');
+ if (shapes2[0] === 'diamond' && shapes2[1] === 'wave' && shapes2[2] === 'oval') {
+ shapes3.push('rectangle');
+ shapes2.push('rectangle');
}
- if (fills1[0] === 'solid' && fills1[3] === 'stripped' && fills1[5] === 'quadrillage') {
- fills18.push('open');
- fills19.push('open');
+ if (shapes2[0] === 'oval' && shapes2[1] === 'diamond' && shapes2[2] === 'rectangle') {
+ shapes3.push('wave');
+ shapes2.push('wave');
}
- if (fills1[0] === 'solid' && fills1[3] === 'quadrillage' && fills1[5] === 'stripped') {
- fills18.push('open');
- fills19.push('open');
+ if (shapes2[0] === 'oval' && shapes2[1] === 'rectangle' && shapes2[2] === 'diamond') {
+ shapes3.push('wave');
+ shapes2.push('wave');
}
- if (fills1[0] === 'quadrillage' && fills1[3] === 'solid' && fills1[5] === 'stripped') {
- fills18.push('open');
- fills19.push('open');
+ if (shapes2[0] === 'rectangle' && shapes2[1] === 'oval' && shapes2[2] === 'diamond') {
+ shapes3.push('wave');
+ shapes2.push('wave');
+
}
- if (fills1[0] === 'quadrillage' && fills1[3] === 'stripped' && fills1[5] === 'solid') {
- fills18.push('open');
- fills19.push('open');
+ if (shapes2[0] === 'rectangle' && shapes2[1] === 'diamond' && shapes2[2] === 'oval') {
+ shapes3.push('wave');
+ shapes2.push('wave');
}
- if (fills1[0] === 'stripped' && fills1[3] === 'quadrillage' && fills1[5] === 'solid') {
- fills18.push('open');
- fills19.push('open');
+ if (shapes2[0] === 'diamond' && shapes2[1] === 'oval' && shapes2[2] === 'rectangle') {
+ shapes3.push('wave');
+ shapes2.push('wave');
}
- if (fills1[0] === 'stripped' && fills1[3] === 'solid' && fills1[5] === 'quadrillage') {
- fills18.push('open');
- fills19.push('open');
+ if (shapes2[0] === 'diamond' && shapes2[1] === 'rectangle' && shapes2[2] === 'oval') {
+ shapes3.push('wave');
+ shapes2.push('wave');
}
- if (fills1[0] === 'solid' && fills1[3] === 'open' && fills1[5] === 'quadrillage') {
- fills18.push('stripped');
- fills19.push('stripped');
+ if (shapes2[0] === 'oval' && shapes2[1] === 'wave' && shapes2[2] === 'rectangle') {
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
- if (fills1[0] === 'solid' && fills1[3] === 'quadrillage' && fills1[5] === 'open') {
- fills18.push('stripped');
- fills19.push('stripped');
+ if (shapes2[0] === 'oval' && shapes2[1] === 'rectangle' && shapes2[2] === 'wave') {
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
- if (fills1[0] === 'quadrillage' && fills1[3] === 'solid' && fills1[5] === 'open') {
- fills18.push('stripped');
- fills19.push('stripped');
+ if (shapes2[0] === 'rectangle' && shapes2[1] === 'wave' && shapes2[2] === 'oval') {
+ shapes3.push('diamond');
+ shapes2.push('diamond');
+
}
- if (fills1[0] === 'quadrillage' && fills1[3] === 'open' && fills1[5] === 'solid') {
- fills18.push('stripped');
- fills19.push('stripped');
+ if (shapes2[0] === 'rectangle' && shapes2[1] === 'oval' && shapes2[2] === 'wave') {
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
- if (fills1[0] === 'open' && fills1[3] === 'quadrillage' && fills1[5] === 'solid') {
- fills18.push('stripped');
- fills19.push('stripped');
+ if (shapes2[0] === 'wave' && shapes2[1] === 'oval' && shapes2[2] === 'rectangle') {
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
- if (fills1[0] === 'open' && fills1[3] === 'solid' && fills1[5] === 'quadrillage') {
- fills18.push('stripped');
- fills19.push('stripped');
+ if (shapes2[0] === 'wave' && shapes2[1] === 'rectangle' && shapes2[2] === 'oval') {
+ shapes3.push('diamond');
+ shapes2.push('diamond');
}
- if (fills1[0] === 'stripped' && fills1[3] === 'open' && fills1[5] === 'quadrillage') {
- fills18.push('solid');
- fills19.push('solid');
+ if (shapes2[0] === 'diamond' && shapes2[1] === 'wave' && shapes2[2] === 'rectangle') {
+ shapes3.push('oval');
+ shapes2.push('oval');
}
- if (fills1[0] === 'stripped' && fills1[3] === 'quadrillage' && fills1[5] === 'open') {
- fills18.push('solid');
- fills19.push('solid');
+ if (shapes2[0] === 'diamond' && shapes2[1] === 'rectangle' && shapes2[2] === 'wave') {
+ shapes3.push('oval');
+ shapes2.push('oval');
}
- if (fills1[0] === 'quadrillage' && fills1[3] === 'stripped' && fills1[5] === 'open') {
- fills18.push('solid');
- fills19.push('solid');
+ if (shapes2[0] === 'rectangle' && shapes2[1] === 'wave' && shapes2[2] === 'diamond') {
+ shapes3.push('oval');
+ shapes2.push('oval');
+
}
- if (fills1[0] === 'quadrillage' && fills1[3] === 'open' && fills1[5] === 'stripped') {
- fills18.push('solid');
- fills19.push('solid');
+ if (shapes2[0] === 'rectangle' && shapes2[1] === 'diamond' && shapes2[2] === 'wave') {
+ shapes3.push('oval');
+ shapes2.push('oval');
}
- if (fills1[0] === 'open' && fills1[3] === 'quadrillage' && fills1[5] === 'stripped') {
- fills18.push('solid');
- fills19.push('solid');
+ if (shapes2[0] === 'wave' && shapes2[1] === 'diamond' && shapes2[2] === 'rectangle') {
+ shapes3.push('oval');
+ shapes2.push('oval');
}
- if (fills1[0] === 'open' && fills1[3] === 'stripped' && fills1[5] === 'quadrillage') {
- fills18.push('solid');
- fills19.push('solid');
+ if (shapes2[0] === 'wave' && shapes2[1] === 'rectangle' && shapes2[2] === 'diamond') {
+ shapes3.push('oval');
+ shapes2.push('oval');
}
-
}
- if (numbers1[0] === numbers1[3] && numbers1[0] === numbers1[5]) {
- numbers18.push(numbers1[0]);
- numbers19.push(numbers1[0]);
+ if (fills2[0] === fills2 [1] && fills2[0] === fills2 [2]) {
+ fills3.push(fills2[0]);
+ fills2.push(fills2[0]);
} else {
- if (numbers1[0] === 1 && numbers1[3] === 2 && numbers1[5] === 3) {
- numbers18.push(4);
- numbers19.push(4);
+ if (fills2[0] === 'solid' && fills2[1] === 'stripped' && fills2[2] === 'open') {
+ fills3.push('quadrillage');
+ fills2.push('quadrillage');
}
- if (numbers1[0] === 1 && numbers1[3] === 3 && numbers1[5] === 2) {
- numbers18.push(4);
- numbers19.push(4);
+ if (fills2[0] === 'solid' && fills2[1] === 'open' && fills2[2] === 'stripped') {
+ fills3.push('quadrillage');
+ fills2.push('quadrillage');
}
- if (numbers1[0] === 2 && numbers1[3] === 1 && numbers1[5] === 3) {
- numbers18.push(4);
- numbers19.push(4);
+ if (fills2[0] === 'stripped' && fills2[1] === 'open' && fills2[2] === 'solid') {
+ fills3.push('quadrillage');
+ fills2.push('quadrillage');
}
- if (numbers1[0] === 2 && numbers1[3] === 3 && numbers1[5] === 1) {
- numbers18.push(4);
- numbers19.push(4);
+ if (fills2[0] === 'stripped' && fills2[1] === 'solid' && fills2[2] === 'open') {
+ fills3.push('quadrillage');
+ fills2.push('quadrillage');
}
- if (numbers1[0] === 3 && numbers1[3] === 1 && numbers1[5] === 2) {
- numbers18.push(4);
- numbers19.push(4);
+ if (fills2[0] === 'open' && fills2[1] === 'stripped' && fills2[2] === 'solid') {
+ fills3.push('quadrillage');
+ fills2.push('quadrillage');
}
- if (numbers1[0] === 3 && numbers1[3] === 2 && numbers1[5] === 1) {
- numbers18.push(4);
- numbers19.push(4);
+ if (fills2[0] === 'open' && fills2[1] === 'solid' && fills2[2] === 'stripped') {
+ fills3.push('quadrillage');
+ fills2.push('quadrillage');
}
- if (numbers1[0] === 1 && numbers1[3] === 2 && numbers1[5] === 4) {
- numbers18.push(3);
- numbers19.push(3);
+ if (fills2[0] === 'solid' && fills2[1] === 'stripped' && fills2[2] === 'quadrillage') {
+ fills3.push('open');
+ fills2.push('open');
}
- if (numbers1[0] === 1 && numbers1[3] === 4 && numbers1[5] === 2) {
- numbers18.push(3);
- numbers19.push(3);
+ if (fills2[0] === 'solid' && fills2[1] === 'quadrillage' && fills2[2] === 'stripped') {
+ fills3.push('open');
+ fills2.push('open');
}
- if (numbers1[0] === 2 && numbers1[3] === 1 && numbers1[5] === 4) {
- numbers18.push(3);
- numbers19.push(3);
+ if (fills2[0] === 'quadrillage' && fills2[1] === 'solid' && fills2[2] === 'stripped') {
+ fills3.push('open');
+ fills2.push('open');
}
- if (numbers1[0] === 2 && numbers1[3] === 4 && numbers1[5] === 1) {
- numbers18.push(3);
- numbers19.push(3);
+ if (fills2[0] === 'quadrillage' && fills2[1] === 'stripped' && fills2[2] === 'solid') {
+ fills3.push('open');
+ fills2.push('open');
}
- if (numbers1[0] === 4 && numbers1[3] === 1 && numbers1[5] === 2) {
- numbers18.push(3);
- numbers19.push(3);
+ if (fills2[0] === 'stripped' && fills2[1] === 'quadrillage' && fills2[2] === 'solid') {
+ fills3.push('open');
+ fills2.push('open');
}
- if (numbers1[0] === 4 && numbers1[3] === 2 && numbers1[5] === 1) {
- numbers18.push(3);
- numbers19.push(3);
+ if (fills2[0] === 'stripped' && fills2[1] === 'solid' && fills2[2] === 'quadrillage') {
+ fills3.push('open');
+ fills2.push('open');
}
- if (numbers1[0] === 1 && numbers1[3] === 3 && numbers1[5] === 4) {
- numbers18.push(2);
- numbers19.push(2);
+ if (fills2[0] === 'solid' && fills2[1] === 'open' && fills2[2] === 'quadrillage') {
+ fills3.push('stripped');
+ fills2.push('stripped');
}
- if (numbers1[0] === 1 && numbers1[3] === 4 && numbers1[5] === 3) {
- numbers18.push(2);
- numbers19.push(2);
+ if (fills2[0] === 'solid' && fills2[1] === 'quadrillage' && fills2[2] === 'open') {
+ fills3.push('stripped');
+ fills2.push('stripped');
}
- if (numbers1[0] === 3 && numbers1[3] === 1 && numbers1[5] === 4) {
- numbers18.push(2);
- numbers19.push(2);
+ if (fills2[0] === 'quadrillage' && fills2[1] === 'solid' && fills2[2] === 'open') {
+ fills3.push('stripped');
+ fills2.push('stripped');
}
- if (numbers1[0] === 3 && numbers1[3] === 4 && numbers1[5] === 1) {
- numbers18.push(2);
- numbers19.push(2);
+ if (fills2[0] === 'quadrillage' && fills2[1] === 'open' && fills2[2] === 'solid') {
+ fills3.push('stripped');
+ fills2.push('stripped');
}
- if (numbers1[0] === 4 && numbers1[3] === 1 && numbers1[5] === 3) {
- numbers18.push(2);
- numbers19.push(2);
+ if (fills2[0] === 'open' && fills2[1] === 'quadrillage' && fills2[2] === 'solid') {
+ fills3.push('stripped');
+ fills2.push('stripped');
}
- if (numbers1[0] === 4 && numbers1[3] === 3 && numbers1[5] === 1) {
- numbers18.push(2);
- numbers19.push(2);
+ if (fills2[0] === 'open' && fills2[1] === 'solid' && fills2[2] === 'quadrillage') {
+ fills3.push('stripped');
+ fills2.push('stripped');
}
- if (numbers1[0] === 2 && numbers1[3] === 3 && numbers1[5] === 4) {
- numbers18.push(1);
- numbers19.push(1);
+ if (fills2[0] === 'stripped' && fills2[1] === 'open' && fills2[2] === 'quadrillage') {
+ fills3.push('solid');
+ fills2.push('solid');
}
- if (numbers1[0] === 2 && numbers1[3] === 4 && numbers1[5] === 3) {
- numbers18.push(1);
- numbers19.push(1);
+ if (fills2[0] === 'stripped' && fills2[1] === 'quadrillage' && fills2[2] === 'open') {
+ fills3.push('solid');
+ fills2.push('solid');
}
- if (numbers1[0] === 3 && numbers1[3] === 2 && numbers1[5] === 4) {
- numbers18.push(1);
- numbers19.push(1);
+ if (fills2[0] === 'quadrillage' && fills2[1] === 'stripped' && fills2[2] === 'open') {
+ fills3.push('solid');
+ fills2.push('solid');
}
- if (numbers1[0] === 3 && numbers1[3] === 4 && numbers1[5] === 2) {
- numbers18.push(1);
- numbers19.push(1);
+ if (fills2[0] === 'quadrillage' && fills2[1] === 'open' && fills2[2] === 'stripped') {
+ fills3.push('solid');
+ fills2.push('solid');
}
- if (numbers1[0] === 4 && numbers1[3] === 2 && numbers1[5] === 3) {
- numbers18.push(1);
- numbers19.push(1);
+ if (fills2[0] === 'open' && fills2[1] === 'quadrillage' && fills2[2] === 'stripped') {
+ fills3.push('solid');
+ fills2.push('solid');
}
- if (numbers1[0] === 4 && numbers1[3] === 3 && numbers1[5] === 2) {
- numbers18.push(1);
- numbers19.push(1);
+ if (fills2[0] === 'open' && fills2[1] === 'stripped' && fills2[2] === 'quadrillage') {
+ fills3.push('solid');
+ fills2.push('solid');
}
- }
-
-
-
-
- if (colors1[0] === colors1 [4] && colors1[0] === colors1 [5]) {
- colors20.push(colors1[0]);
- colors21.push(colors1[0]);
+ }
+ if (numbers2[0] === numbers2[1] && numbers2[0] === numbers2[2]) {
+ numbers3.push(numbers2[0]);
+ numbers2.push(numbers2[0]);
} else {
- if (colors1[0] === 'red' && colors1[4] === 'green' && colors1[5] === 'purple') {
- colors20.push('lightblue');
- colors21.push('lightblue');
- }
-
- if (colors1[0] === 'red' && colors1[4] === 'purple' && colors1[5] === 'green') {
- colors20.push('lightblue');
- colors21.push('lightblue');
- }
-
- if (colors1[0] === 'purple' && colors1[4] === 'red' && colors1[5] === 'green') {
- colors20.push('lightblue');
- colors21.push('lightblue');
- }
- if (colors1[0] === 'purple' && colors1[4] === 'green' && colors1[5] === 'red') {
- colors20.push('lightblue');
- colors21.push('lightblue');
- }
-
- if (colors1[0] === 'green' && colors1[4] === 'purple' && colors1[5] === 'red') {
- colors20.push('lightblue');
- colors21.push('lightblue');
- }
- if (colors1[0] === 'green' && colors1[4] === 'red' && colors1[5] === 'purple') {
- colors20.push('lightblue');
- colors21.push('lightblue');
- }
-
-
- if (colors1[0] === 'green' && colors1[4] === 'purple' && colors1[5] === 'lightblue') {
- colors20.push('red');
- colors21.push('red');
+ if (numbers2[0] === 1 && numbers2[1] === 2 && numbers2[2] === 3) {
+ numbers3.push(4);
+ numbers2.push(4);
}
- if (colors1[0] === 'green' && colors1[4] === 'lightblue' && colors1[5] === 'purple') {
- colors20.push('red');
- colors21.push('red');
+ if (numbers2[0] === 1 && numbers2[1] === 3 && numbers2[2] === 2) {
+ numbers3.push(4);
+ numbers2.push(4);
}
- if (colors1[0] === 'purple' && colors1[4] === 'lightblue' && colors1[5] === 'green') {
- colors20.push('red');
- colors21.push('red');
+ if (numbers2[0] === 2 && numbers2[1] === 1 && numbers2[2] === 3) {
+ numbers3.push(4);
+ numbers2.push(4);
}
- if (colors1[0] === 'purple' && colors1[4] === 'green' && colors1[5] === 'lightblue') {
- colors20.push('red');
- colors21.push('red');
+ if (numbers2[0] === 2 && numbers2[1] === 3 && numbers2[2] === 1) {
+ numbers3.push(4);
+ numbers2.push(4);
}
- if (colors1[0] === 'lightblue' && colors1[4] === 'purple' && colors1[5] === 'green') {
- colors20.push('red');
- colors21.push('red');
+ if (numbers2[0] === 3 && numbers2[1] === 1 && numbers2[2] === 2) {
+ numbers3.push(4);
+ numbers2.push(4);
}
- if (colors1[0] === 'lightblue' && colors1[4] === 'green' && colors1[5] === 'purple') {
- colors20.push('red');
- colors21.push('red');
+ if (numbers2[0] === 3 && numbers2[1] === 2 && numbers2[2] === 1) {
+ numbers3.push(4);
+ numbers2.push(4);
}
- if (colors1[0] === 'red' && colors1[4] === 'green' && colors1[5] === 'lightblue') {
- colors20.push('purple');
- colors21.push('purple');
+ if (numbers2[0] === 1 && numbers2[1] === 2 && numbers2[2] === 4) {
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (colors1[0] === 'red' && colors1[4] === 'lightblue' && colors1[5] === 'green') {
- colors20.push('purple');
- colors21.push('purple');
+ if (numbers2[0] === 1 && numbers2[1] === 4 && numbers2[2] === 2) {
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (colors1[0] === 'lightblue' && colors1[4] === 'green' && colors1[5] === 'red') {
- colors20.push('purple');
- colors21.push('purple');
+ if (numbers2[0] === 2 && numbers2[1] === 1 && numbers2[2] === 4) {
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (colors1[0] === 'lightblue' && colors1[4] === 'red' && colors1[5] === 'green') {
- colors20.push('purple');
- colors21.push('purple');
+ if (numbers2[0] === 2 && numbers2[1] === 4 && numbers2[2] === 1) {
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (colors1[0] === 'green' && colors1[4] === 'lightblue' && colors1[5] === 'red') {
- colors20.push('purple');
- colors21.push('purple');
+ if (numbers2[0] === 4 && numbers2[1] === 1 && numbers2[2] === 2) {
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (colors1[0] === 'green' && colors1[4] === 'red' && colors1[5] === 'lightblue') {
- colors20.push('purple');
- colors21.push('purple');
+ if (numbers2[0] === 4 && numbers2[1] === 2 && numbers2[2] === 1) {
+ numbers3.push(3);
+ numbers2.push(3);
}
- if (colors1[0] === 'red' && colors1[4] === 'purple' && colors1[5] === 'lightblue') {
- colors20.push('green');
- colors21.push('green');
+ if (numbers2[0] === 1 && numbers2[1] === 3 && numbers2[2] === 4) {
+ numbers3.push(2);
+ numbers2.push(2);
}
- if (colors1[0] === 'red' && colors1[4] === 'lightblue' && colors1[5] === 'purple') {
- colors20.push('green');
- colors21.push('green');
+ if (numbers2[0] === 1 && numbers2[1] === 4 && numbers2[2] === 3) {
+ numbers3.push(2);
+ numbers2.push(2);
}
- if (colors1[0] === 'lightblue' && colors1[4] === 'purple' && colors1[5] === 'red') {
- colors20.push('green');
- colors21.push('green');
+ if (numbers2[0] === 3 && numbers2[1] === 1 && numbers2[2] === 4) {
+ numbers3.push(2);
+ numbers2.push(2);
}
- if (colors1[0] === 'lightblue' && colors1[4] === 'red' && colors1[5] === 'purple') {
- colors20.push('green');
- colors21.push('green');
+ if (numbers2[0] === 3 && numbers2[1] === 4 && numbers2[2] === 1) {
+ numbers3.push(2);
+ numbers2.push(2);
}
- if (colors1[0] === 'purple' && colors1[4] === 'lightblue' && colors1[5] === 'red') {
- colors20.push('green');
- colors21.push('green');
+ if (numbers2[0] === 4 && numbers2[1] === 1 && numbers2[2] === 3) {
+ numbers3.push(2);
+ numbers2.push(2);
}
- if (colors1[0] === 'purple' && colors1[4] === 'red' && colors1[5] === 'lightblue') {
- colors20.push('green');
- colors21.push('green');
+ if (numbers2[0] === 4 && numbers2[1] === 3 && numbers2[2] === 1) {
+ numbers3.push(2);
+ numbers2.push(2);
}
- }
-
- if (shapes1[0] === shapes1 [4] && shapes1[0] === shapes1 [5]) {
- shapes20.push(shapes1[0]);
- shapes21.push(shapes1[0]);
- } else {
- if (shapes1[0] === 'oval' && shapes1[4] === 'diamond' && shapes1[5] === 'wave') {
- shapes20.push('rectangle');
- shapes21.push('rectangle');
+ if (numbers2[0] === 2 && numbers2[1] === 3 && numbers2[2] === 4) {
+ numbers3.push(1);
+ numbers2.push(1);
}
- if (shapes1[0] === 'oval' && shapes1[4] === 'wave' && shapes1[5] === 'diamond') {
- shapes20.push('rectangle');
- shapes21.push('rectangle');
+ if (numbers2[0] === 2 && numbers2[1] === 4 && numbers2[2] === 3) {
+ numbers3.push(1);
+ numbers2.push(1);
}
- if (shapes1[0] === 'wave' && shapes1[4] === 'diamond' && shapes1[5] === 'oval') {
- shapes20.push('rectangle');
- shapes21.push('rectangle');
-
+ if (numbers2[0] === 3 && numbers2[1] === 2 && numbers2[2] === 4) {
+ numbers3.push(1);
+ numbers2.push(1);
}
- if (shapes1[0] === 'wave' && shapes1[4] === 'oval' && shapes1[5] === 'diamond') {
- shapes20.push('rectangle');
- shapes21.push('rectangle');
+ if (numbers2[0] === 3 && numbers2[1] === 4 && numbers2[2] === 2) {
+ numbers3.push(1);
+ numbers2.push(1);
}
- if (shapes1[0] === 'diamond' && shapes1[4] === 'oval' && shapes1[5] === 'wave') {
- shapes20.push('rectangle');
- shapes21.push('rectangle');
+ if (numbers2[0] === 4 && numbers2[1] === 2 && numbers2[2] === 3) {
+ numbers3.push(1);
+ numbers2.push(1);
}
- if (shapes1[0] === 'diamond' && shapes1[4] === 'wave' && shapes1[5] === 'oval') {
- shapes20.push('rectangle');
- shapes21.push('rectangle');
+ if (numbers2[0] === 4 && numbers2[1] === 3 && numbers2[2] === 2) {
+ numbers3.push(1);
+ numbers2.push(1);
}
+ }
- if (shapes1[0] === 'oval' && shapes1[4] === 'diamond' && shapes1[5] === 'rectangle') {
- shapes20.push('wave');
- shapes21.push('wave');
- }
+ if(this.isSet4(colors2) && this.isSet4(shapes2) && this.isSet4(fills2) && this.isSet4(numbers2)) {
+ return this.isSet4(colors3) && this.isSet4(shapes3) && this.isSet4(fills3) && this.isSet4(numbers3)
+ }
+ },
- if (shapes1[0] === 'oval' && shapes1[4] === 'rectangle' && shapes1[5] === 'diamond') {
- shapes20.push('wave');
- shapes21.push('wave');
- }
- if (shapes1[0] === 'rectangle' && shapes1[4] === 'oval' && shapes1[5] === 'diamond') {
- shapes20.push('wave');
- shapes21.push('wave');
- }
- if (shapes1[0] === 'rectangle' && shapes1[4] === 'diamond' && shapes1[5] === 'oval') {
- shapes20.push('wave');
- shapes21.push('wave');
- }
- if (shapes1[0] === 'diamond' && shapes1[4] === 'oval' && shapes1[5] === 'rectangle') {
- shapes20.push('wave');
- shapes21.push('wave');
- }
- if (shapes1[0] === 'diamond' && shapes1[4] === 'rectangle' && shapes1[5] === 'oval') {
- shapes20.push('wave');
- shapes21.push('wave');
- }
- if (shapes1[0] === 'oval' && shapes1[4] === 'wave' && shapes1[5] === 'rectangle') {
- shapes20.push('diamond');
- shapes21.push('diamond');
- }
- if (shapes1[0] === 'oval' && shapes1[4] === 'rectangle' && shapes1[5] === 'wave') {
- shapes20.push('diamond');
- shapes21.push('diamond');
- }
- if (shapes1[0] === 'rectangle' && shapes1[4] === 'wave' && shapes1[5] === 'oval') {
- shapes20.push('diamond');
- shapes21.push('diamond');
- }
- if (shapes1[0] === 'rectangle' && shapes1[4] === 'oval' && shapes1[5] === 'wave') {
- shapes20.push('diamond');
- shapes21.push('diamond');
- }
- if (shapes1[0] === 'wave' && shapes1[4] === 'oval' && shapes1[5] === 'rectangle') {
- shapes20.push('diamond');
- shapes21.push('diamond');
- }
- if (shapes1[0] === 'wave' && shapes1[4] === 'rectangle' && shapes1[5] === 'oval') {
- shapes20.push('diamond');
- shapes21.push('diamond');
- }
- if (shapes1[0] === 'diamond' && shapes1[4] === 'wave' && shapes1[5] === 'rectangle') {
- shapes20.push('oval');
- shapes21.push('oval');
- }
- if (shapes1[0] === 'diamond' && shapes1[4] === 'rectangle' && shapes1[5] === 'wave') {
- shapes20.push('oval');
- shapes21.push('oval');
- }
+ validateHyperSet0: function() {
+ var carteAB = [];
+ var carteCD = [];
+ var carteAC = [];
+ var carteBD = [];
+ var carteAD = [];
+ var carteBC = [];
- if (shapes1[0] === 'rectangle' && shapes1[4] === 'wave' && shapes1[5] === 'diamond') {
- shapes20.push('oval');
- shapes21.push('oval');
+ carteAB.splice(0,1,this.selectedHS0[0]);
+ carteAB.splice(1,1,this.selectedHS0[1]);
+ carteCD.splice(0,1,this.selectedHS0[2]);
+ carteCD.splice(1,1,this.selectedHS0[3]);
- }
- if (shapes1[0] === 'rectangle' && shapes1[4] === 'diamond' && shapes1[5] === 'wave') {
- shapes20.push('oval');
- shapes21.push('oval');
- }
+ carteAC.splice(0,1,this.selectedHS0[0]);
+ carteAC.splice(1,1,this.selectedHS0[2]);
+ carteBD.splice(0,1,this.selectedHS0[1]);
+ carteBD.splice(1,1,this.selectedHS0[3]);
- if (shapes1[0] === 'wave' && shapes1[4] === 'diamond' && shapes1[5] === 'rectangle') {
- shapes20.push('oval');
- shapes21.push('oval');
- }
- if (shapes1[0] === 'wave' && shapes1[4] === 'rectangle' && shapes1[5] === 'diamond') {
- shapes20.push('oval');
- shapes21.push('oval');
- }
+ carteAD.splice(0,1,this.selectedHS0[0]);
+ carteAD.splice(1,1,this.selectedHS0[3]);
+ carteBC.splice(0,1,this.selectedHS0[1]);
+ carteBC.splice(1,1,this.selectedHS0[2]);
+
+ if (this.generateVirtualCard33(carteAB, carteCD)) {
+ return true;
}
- if (fills1[0] === fills1 [4] && fills1[0] === fills1 [5]) {
- fills20.push(fills1[0]);
- fills21.push(fills1[0]);
- } else {
- if (fills1[0] === 'solid' && fills1[4] === 'stripped' && fills1[5] === 'open') {
- fills20.push('quadrillage');
- fills21.push('quadrillage');
- }
+ if (this.generateVirtualCard33(carteAC, carteBD)) {
+ return true;
+ }
- if (fills1[0] === 'solid' && fills1[4] === 'open' && fills1[5] === 'stripped') {
- fills20.push('quadrillage');
- fills21.push('quadrillage');
- }
+ if (this.generateVirtualCard33(carteAD, carteBC)) {
+ return true;
+ }
- if (fills1[0] === 'stripped' && fills1[4] === 'open' && fills1[5] === 'solid') {
- fills20.push('quadrillage');
- fills21.push('quadrillage');
- }
- if (fills1[0] === 'stripped' && fills1[4] === 'solid' && fills1[5] === 'open') {
- fills20.push('quadrillage');
- fills21.push('quadrillage');
- }
+ return false;
- if (fills1[0] === 'open' && fills1[4] === 'stripped' && fills1[5] === 'solid') {
- fills20.push('quadrillage');
- fills21.push('quadrillage');
- }
- if (fills1[0] === 'open' && fills1[4] === 'solid' && fills1[5] === 'stripped') {
- fills20.push('quadrillage');
- fills21.push('quadrillage');
- }
+ },
+ validateHyperSet: function() {
+ var carteAB = [];
+ var carteCD = [];
+ var carteAC = [];
+ var carteBD = [];
+ var carteAD = [];
+ var carteBC = [];
- if (fills1[0] === 'solid' && fills1[4] === 'stripped' && fills1[5] === 'quadrillage') {
- fills20.push('open');
- fills21.push('open');
- }
+ carteAB.splice(0,1,this.selectedHS[0]);
+ carteAB.splice(1,1,this.selectedHS[1]);
+ carteCD.splice(0,1,this.selectedHS[2]);
+ carteCD.splice(1,1,this.selectedHS[3]);
- if (fills1[0] === 'solid' && fills1[4] === 'quadrillage' && fills1[5] === 'stripped') {
- fills20.push('open');
- fills21.push('open');
- }
+ carteAC.splice(0,1,this.selectedHS[0]);
+ carteAC.splice(1,1,this.selectedHS[2]);
+ carteBD.splice(0,1,this.selectedHS[1]);
+ carteBD.splice(1,1,this.selectedHS[3]);
- if (fills1[0] === 'quadrillage' && fills1[4] === 'solid' && fills1[5] === 'stripped') {
- fills20.push('open');
- fills21.push('open');
- }
- if (fills1[0] === 'quadrillage' && fills1[4] === 'stripped' && fills1[5] === 'solid') {
- fills20.push('open');
- fills21.push('open');
- }
+ carteAD.splice(0,1,this.selectedHS[0]);
+ carteAD.splice(1,1,this.selectedHS[3]);
+ carteBC.splice(0,1,this.selectedHS[1]);
+ carteBC.splice(1,1,this.selectedHS[2]);
- if (fills1[0] === 'stripped' && fills1[4] === 'quadrillage' && fills1[5] === 'solid') {
- fills20.push('open');
- fills21.push('open');
- }
- if (fills1[0] === 'stripped' && fills1[4] === 'solid' && fills1[5] === 'quadrillage') {
- fills20.push('open');
- fills21.push('open');
- }
- if (fills1[0] === 'solid' && fills1[4] === 'open' && fills1[5] === 'quadrillage') {
- fills20.push('stripped');
- fills21.push('stripped');
- }
+ if (this.generateVirtualCard34(carteAB, carteCD)) {
+ return true;
- if (fills1[0] === 'solid' && fills1[4] === 'quadrillage' && fills1[5] === 'open') {
- fills20.push('stripped');
- fills21.push('stripped');
- }
+ }
+ else if (this.generateVirtualCard34(carteAC, carteBD)){
+ return true;
+ }
+ else if (this.generateVirtualCard34(carteAD, carteBC)) {
+ return true;
+ }
+ else{
+ return false;
+ }
- if (fills1[0] === 'quadrillage' && fills1[4] === 'solid' && fills1[5] === 'open') {
- fills20.push('stripped');
- fills21.push('stripped');
- }
- if (fills1[0] === 'quadrillage' && fills1[4] === 'open' && fills1[5] === 'solid') {
- fills20.push('stripped');
- fills21.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[4] === 'quadrillage' && fills1[5] === 'solid') {
- fills20.push('stripped');
- fills21.push('stripped');
- }
- if (fills1[0] === 'open' && fills1[4] === 'solid' && fills1[5] === 'quadrillage') {
- fills20.push('stripped');
- fills21.push('stripped');
- }
+ },
+ validateHyperSet1: function() {
+ var carteAB = [];
+ var carteCD = [];
+ var carteAC = [];
+ var carteBD = [];
+ var carteAD = [];
+ var carteBC = [];
- if (fills1[0] === 'stripped' && fills1[4] === 'open' && fills1[5] === 'quadrillage') {
- fills20.push('solid');
- fills21.push('solid');
- }
+ carteAB.splice(0,1,this.selectedHS1[0]);
+ carteAB.splice(1,1,this.selectedHS1[1]);
+ carteCD.splice(0,1,this.selectedHS1[2]);
+ carteCD.splice(1,1,this.selectedHS1[3]);
- if (fills1[0] === 'stripped' && fills1[4] === 'quadrillage' && fills1[5] === 'open') {
- fills20.push('solid');
- fills21.push('solid');
- }
+ carteAC.splice(0,1,this.selectedHS1[0]);
+ carteAC.splice(1,1,this.selectedHS1[2]);
+ carteBD.splice(0,1,this.selectedHS1[1]);
+ carteBD.splice(1,1,this.selectedHS1[3]);
- if (fills1[0] === 'quadrillage' && fills1[4] === 'stripped' && fills1[5] === 'open') {
- fills20.push('solid');
- fills21.push('solid');
- }
- if (fills1[0] === 'quadrillage' && fills1[4] === 'open' && fills1[5] === 'stripped') {
- fills20.push('solid');
- fills21.push('solid');
- }
+ carteAD.splice(0,1,this.selectedHS1[0]);
+ carteAD.splice(1,1,this.selectedHS1[3]);
+ carteBC.splice(0,1,this.selectedHS1[1]);
+ carteBC.splice(1,1,this.selectedHS1[2]);
- if (fills1[0] === 'open' && fills1[4] === 'quadrillage' && fills1[5] === 'stripped') {
- fills20.push('solid');
- fills21.push('solid');
- }
- if (fills1[0] === 'open' && fills1[4] === 'stripped' && fills1[5] === 'quadrillage') {
- fills20.push('solid');
- fills21.push('solid');
- }
+ if (this.generateVirtualCard35(carteAB, carteCD)) {
+ return true;
}
- if (numbers1[0] === numbers1[4] && numbers1[0] === numbers1[5]) {
- numbers20.push(numbers1[0]);
- numbers21.push(numbers1[0]);
- } else {
- if (numbers1[0] === 1 && numbers1[4] === 2 && numbers1[5] === 3) {
- numbers20.push(4);
- numbers21.push(4);
- }
+ else if (this.generateVirtualCard35(carteAC, carteBD)) {
+ return true;
+ }
- if (numbers1[0] === 1 && numbers1[4] === 3 && numbers1[5] === 2) {
- numbers20.push(4);
- numbers21.push(4);
- }
+ else if (this.generateVirtualCard35(carteAD, carteBC)) {
+ return true;
+ }
+ else{
+ return false;
+ }
- if (numbers1[0] === 2 && numbers1[4] === 1 && numbers1[5] === 3) {
- numbers20.push(4);
- numbers21.push(4);
- }
- if (numbers1[0] === 2 && numbers1[4] === 3 && numbers1[5] === 1) {
- numbers20.push(4);
- numbers21.push(4);
- }
- if (numbers1[0] === 3 && numbers1[4] === 1 && numbers1[5] === 2) {
- numbers20.push(4);
- numbers21.push(4);
- }
- if (numbers1[0] === 3 && numbers1[4] === 2 && numbers1[5] === 1) {
- numbers20.push(4);
- numbers21.push(4);
- }
+ },
- if (numbers1[0] === 1 && numbers1[4] === 2 && numbers1[5] === 4) {
- numbers20.push(3);
- numbers21.push(3);
- }
+ validateHyperSet2: function() {
- if (numbers1[0] === 1 && numbers1[4] === 4 && numbers1[5] === 2) {
- numbers20.push(3);
- numbers21.push(3);
- }
- if (numbers1[0] === 2 && numbers1[4] === 1 && numbers1[5] === 4) {
- numbers20.push(3);
- numbers21.push(3);
- }
- if (numbers1[0] === 2 && numbers1[4] === 4 && numbers1[5] === 1) {
- numbers20.push(3);
- numbers21.push(3);
- }
+ var carteABC = [];
+ var carteDEF = [];
- if (numbers1[0] === 4 && numbers1[4] === 1 && numbers1[5] === 2) {
- numbers20.push(3);
- numbers21.push(3);
- }
- if (numbers1[0] === 4 && numbers1[4] === 2 && numbers1[5] === 1) {
- numbers20.push(3);
- numbers21.push(3);
- }
+ var carteABD = [];
+ var carteCEF = [];
+ var carteABE = [];
+ var carteCDF = [];
- if (numbers1[0] === 1 && numbers1[4] === 3 && numbers1[5] === 4){
- numbers20.push(2);
- numbers21.push(2);
- }
+ var carteABF = [];
+ var carteCDE = [];
- if (numbers1[0] === 1 && numbers1[4] === 4 && numbers1[5] === 3) {
- numbers20.push(2);
- numbers21.push(2);
- }
+ var carteACD = [];
+ var carteBEF = [];
- if (numbers1[0] === 3 && numbers1[4] === 1 && numbers1[5] === 4) {
- numbers20.push(2);
- numbers21.push(2);
- }
- if (numbers1[0] === 3 && numbers1[4] === 4 && numbers1[5] === 1) {
- numbers20.push(2);
- numbers21.push(2);
- }
+ var carteACE = [];
+ var carteBDF = [];
- if (numbers1[0] === 4 && numbers1[4] === 1 && numbers1[5] === 3) {
- numbers20.push(2);
- numbers21.push(2);
- }
- if (numbers1[0] === 4 && numbers1[4] === 3 && numbers1[5] === 1) {
- numbers20.push(2);
- numbers21.push(2);
- }
+ var carteACF = [];
+ var carteBDE = [];
+ var carteADE = [];
+ var carteBCF = [];
- if (numbers1[0] === 2 && numbers1[4] === 3 && numbers1[5] === 4) {
- numbers20.push(1);
- numbers21.push(1);
- }
+ var carteADF = [];
+ var carteBCE = [];
- if (numbers1[0] === 2 && numbers1[4] === 4 && numbers1[5] === 3) {
- numbers20.push(1);
- numbers21.push(1);
- }
+ var carteAEF = [];
+ var carteBCD = [];
- if (numbers1[0] === 3 && numbers1[4] === 2 && numbers1[5] === 4) {
- numbers20.push(1);
- numbers21.push(1);
- }
- if (numbers1[0] === 3 && numbers1[4] === 4 && numbers1[5] === 2) {
- numbers20.push(1);
- numbers21.push(1);
- }
- if (numbers1[0] === 4 && numbers1[4] === 2 && numbers1[5] === 3) {
- numbers20.push(1);
- numbers21.push(1);
- }
- if (numbers1[0] === 4 && numbers1[4] === 3 && numbers1[5] === 2) {
- numbers20.push(1);
- numbers21.push(1);
- }
- }
+ carteABC.splice(0, 1, this.selectedHS2[0]);
+ carteABC.splice(1, 1, this.selectedHS2[1]);
+ carteABC.splice(2, 1, this.selectedHS2[2]);
+ carteDEF.splice(0, 1, this.selectedHS2[3]);
+ carteDEF.splice(1, 1, this.selectedHS2[4]);
+ carteDEF.splice(2, 1, this.selectedHS2[5]);
+
+ carteABD.splice(0, 1, this.selectedHS2[0]);
+ carteABD.splice(1, 1, this.selectedHS2[1]);
+ carteABD.splice(2, 1, this.selectedHS2[3]);
+ carteCEF.splice(0, 1, this.selectedHS2[2]);
+ carteCEF.splice(1, 1, this.selectedHS2[4]);
+ carteCEF.splice(2, 1, this.selectedHS2[5]);
+
+ carteABE.splice(0, 1, this.selectedHS2[0]);
+ carteABE.splice(1, 1, this.selectedHS2[1]);
+ carteABE.splice(2, 1, this.selectedHS2[4]);
+ carteCDF.splice(0, 1, this.selectedHS2[2]);
+ carteCDF.splice(1, 1, this.selectedHS2[3]);
+ carteCDF.splice(2, 1, this.selectedHS2[5]);
+
+ carteABF.splice(0, 1, this.selectedHS2[0]);
+ carteABF.splice(1, 1, this.selectedHS2[1]);
+ carteABF.splice(2, 1, this.selectedHS2[5]);
+ carteCDE.splice(0, 1, this.selectedHS2[2]);
+ carteCDE.splice(1, 1, this.selectedHS2[3]);
+ carteCDE.splice(2, 1, this.selectedHS2[4]);
+ carteACD.splice(0, 1, this.selectedHS2[0]);
+ carteACD.splice(1, 1, this.selectedHS2[2]);
+ carteACD.splice(2, 1, this.selectedHS2[3]);
+ carteBEF.splice(0, 1, this.selectedHS2[1]);
+ carteBEF.splice(1, 1, this.selectedHS2[4]);
+ carteBEF.splice(2, 1, this.selectedHS2[5]);
+ carteACE.splice(0, 1, this.selectedHS2[0]);
+ carteACE.splice(1, 1, this.selectedHS2[2]);
+ carteACE.splice(2, 1, this.selectedHS2[4]);
+ carteBDF.splice(0, 1, this.selectedHS2[1]);
+ carteBDF.splice(1, 1, this.selectedHS2[3]);
+ carteBDF.splice(2, 1, this.selectedHS2[5]);
+ carteACF.splice(0, 1, this.selectedHS2[0]);
+ carteACF.splice(1, 1, this.selectedHS2[2]);
+ carteACF.splice(2, 1, this.selectedHS2[5]);
+ carteBDE.splice(0, 1, this.selectedHS2[1]);
+ carteBDE.splice(1, 1, this.selectedHS2[3]);
+ carteBDE.splice(2, 1, this.selectedHS2[4]);
+ carteADE.splice(0, 1, this.selectedHS2[0]);
+ carteADE.splice(1, 1, this.selectedHS2[3]);
+ carteADE.splice(2, 1, this.selectedHS2[4]);
+ carteBCF.splice(0, 1, this.selectedHS2[1]);
+ carteBCF.splice(1, 1, this.selectedHS2[2]);
+ carteBCF.splice(2, 1, this.selectedHS2[5]);
+ carteADF.splice(0, 1, this.selectedHS2[0]);
+ carteADF.splice(1, 1, this.selectedHS2[3]);
+ carteADF.splice(2, 1, this.selectedHS2[5]);
+ carteBCE.splice(0, 1, this.selectedHS2[1]);
+ carteBCE.splice(1, 1, this.selectedHS2[2]);
+ carteBCE.splice(2, 1, this.selectedHS2[4]);
+ carteAEF.splice(0, 1, this.selectedHS2[0]);
+ carteAEF.splice(1, 1, this.selectedHS2[4]);
+ carteAEF.splice(2, 1, this.selectedHS2[5]);
+ carteBCD.splice(0, 1, this.selectedHS2[1]);
+ carteBCD.splice(1, 1, this.selectedHS2[2]);
+ carteBCD.splice(2, 1, this.selectedHS2[3]);
+ if (this.generateVirtualCard44(carteABC, carteDEF)) {
+ return true;
- if(this.isSet4(colors2) && this.isSet4(shapes2) && this.isSet4(fills2) && this.isSet4(numbers2)){
- return this.isSet4(colors3)&& this.isSet4(shapes3) && this.isSet4(fills3)&& this.isSet4(numbers3);
}
+ else if (this.generateVirtualCard44(carteABD, carteCEF)) {
+ return true;
+ }
+ else if (this.generateVirtualCard44(carteABE, carteCDF)) {
+ return true;
- if(this.isSet4(colors4) && this.isSet4(shapes4) && this.isSet4(fills4) && this.isSet4(numbers4)){
- return this.isSet4(colors5)&& this.isSet4(shapes5)&& this.isSet4(fills5)&& this.isSet4(numbers5);
}
+ else if (this.generateVirtualCard44(carteABF, carteCDE)) {
+ return true;
- if(this.isSet4(colors6) && this.isSet4(shapes6) && this.isSet4(fills6) && this.isSet4(numbers6)){
- return this.isSet4(colors7)&& this.isSet4(shapes7)&& this.isSet4(fills7)&& this.isSet4(numbers7);
}
+ else if (this.generateVirtualCard44(carteACD, carteBEF)) {
+ return true;
- if(this.isSet4(colors8) && this.isSet4(shapes8) && this.isSet4(fills8) && this.isSet4(numbers8)){
- return this.isSet4(colors9)&& this.isSet4(shapes9)&& this.isSet4(fills9)&& this.isSet4(numbers9);
}
- if(this.isSet4(colors10) && this.isSet4(shapes10) && this.isSet4(fills10) && this.isSet4(numbers10)){
- return this.isSet(colors11)&& this.isSet(shapes11)&& this.isSet(fills11)&& this.isSet(numbers11);
+ if (this.generateVirtualCard44(carteACE, carteBDF)) {
+ return true;
+
}
- if(this.isSet4(colors12) && this.isSet4(shapes12) && this.isSet4(fills12) && this.isSet4(numbers12)){
- return this.isSet4(colors13)&& this.isSet4(shapes13)&& this.isSet4(fills13)&& this.isSet4(numbers13);
+ else if (this.generateVirtualCard44(carteACF, carteBDE)) {
+ return true;
+
}
- if(this.isSet4(colors14) && this.isSet4(shapes14) && this.isSet4(fills14) && this.isSet4(numbers14)){
- return this.isSet4(colors15)&& this.isSet4(shapes15)&& this.isSet4(fills15)&& this.isSet4(numbers15);
+ else if (this.generateVirtualCard44(carteADE, carteBCF)) {
+ return true;
+
}
- if(this.isSet4(colors16) && this.isSet4(shapes16) && this.isSet4(fills16) && this.isSet4(numbers16)){
- return this.isSet4(colors17)&& this.isSet4(shapes17)&& this.isSet4(fills17)&& this.isSet4(numbers17);
+ else if (this.generateVirtualCard44(carteADF, carteBCE)) {
+ return true;
+
}
- if(this.isSet4(colors18) && this.isSet4(shapes18) && this.isSet4(fills18) && this.isSet4(numbers18)){
- return this.isSet4(colors19)&& this.isSet4(shapes19)&& this.isSet4(fills19)&& this.isSet4(numbers19);
+ else if (this.generateVirtualCard44(carteAEF, carteBCD)) {
+ return true;
+
}
- if(this.isSet4(colors20) && this.isSet4(shapes20) && this.isSet4(fills20) && this.isSet4(numbers20)) {
- return this.isSet4(colors21) && this.isSet4(shapes21) && this.isSet4(fills21) && this.isSet4(numbers21);
+ else{
+ return false;
}
-
-
},
@@ -9419,7 +4476,7 @@ var Game = {
-};
+};;;