Compteur HS4x4 plus modes HS 4x5 et 5x5

master
readhame 5 years ago
parent 4382af5b34
commit aa21f70ddd

@ -132,7 +132,9 @@
<workItem from="1595252250296" duration="15000" />
<workItem from="1595260179440" duration="1355000" />
<workItem from="1595326918655" duration="7239000" />
<workItem from="1595344550924" duration="1025000" />
<workItem from="1595344550924" duration="1649000" />
<workItem from="1595405934952" duration="11919000" />
<workItem from="1595425032126" duration="2254000" />
</task>
<servers />
</component>
@ -176,18 +178,18 @@
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="623" height="498" key="SwitcherDM/0.0.1920.1040@0.0.1920.1040" timestamp="1595243925469" />
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1595344579763">
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1595425843105">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1595344579763" />
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1595425843105" />
<state x="701" y="162" key="refactoring.ChangeSignatureDialog" timestamp="1593090265720">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="701" y="162" key="refactoring.ChangeSignatureDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1593090265720" />
<state x="616" y="240" key="run.anything.popup" timestamp="1595246369969">
<state x="616" y="240" key="run.anything.popup" timestamp="1595418794489">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="616" y="240" key="run.anything.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1595246369969" />
<state x="616" y="240" key="run.anything.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1595418794489" />
<state x="202" y="435" key="vcs.readOnlyHandler.ReadOnlyStatusDialog" timestamp="1592990595770">
<screen x="0" y="0" width="1920" height="1040" />
</state>

@ -240,11 +240,54 @@ class Deck {
}
}
}
}elseif ($changes === 'dealHS3') {
$colors = array('green', 'red', 'purple', 'lightblue');
$shapes = array('oval', 'diamond', 'wave', 'rectangle');
$fills = array('solid', 'stripped', 'open','quadrillage');
$borders = array ('plein','point','rond','zigzag');
$numbers = array(1, 2, 3, 4);
$index3 = 1;
foreach ($colors as $color) {
foreach ($shapes as $shape) {
foreach ($fills as $fill) {
foreach ($borders as $border){
foreach ($numbers as $number) {
$cardAttributes = new CardAttributes($color, $shape, $fill, $border, $number, $index3);
$card = new Card($cardAttributes, $this);
$index3++;
}
}
}
}
}
} elseif ($changes === 'dealHS4') {
$colors = array('green', 'red', 'purple', 'lightblue', 'yellow');
$shapes = array('oval', 'diamond', 'wave', 'rectangle','triangle');
$fills = array('solid', 'stripped', 'open', 'quadrillage','pointille');
$borders = array('plein', 'point', 'rond', 'zigzag','hachure');
$numbers = array(1, 2, 3, 4, 5);
$index4 = 1;
foreach ($colors as $color) {
foreach ($shapes as $shape) {
foreach ($fills as $fill) {
foreach ($borders as $border) {
foreach ($numbers as $number) {
$cardAttributes = new CardAttributes($color, $shape, $fill, $border,$number, $index4);
$card = new Card($cardAttributes, $this);
$index4++;
}
}
}
}
}
}
}
public function removeSet($cards) {
}
private function shuffle() {
shuffle($this->cards);
@ -275,4 +318,7 @@ class Deck {
public function sixMore() {
return array_chop($this->cards, 6);
}
public function eightMore() {
return array_chop($this->cards, 8);
}
}

@ -25,13 +25,13 @@ if (isset($_GET['action']) && $_GET['action'] == 'deal') {
$_SESSION['deck2'] = new Deck($_GET['action']);
$_SESSION['game2'] = new Game($_SESSION['deck2']);
$game = $_SESSION['game2'];
echo json_encode($game->start(40));
echo json_encode($game->start(36));
} else if (isset($_GET['action']) && $_GET['action'] == 'deal3') {
$_SESSION['deck3'] = new Deck($_GET['action']);
$_SESSION['game3'] = new Game($_SESSION['deck3']);
$game = $_SESSION['game3'];
echo json_encode($game->start(50));
echo json_encode($game->start(40));
} else if (isset($_GET['action']) && $_GET['action'] == 'deal4') {
$_SESSION['deck4'] = new Deck($_GET['action']);
@ -64,11 +64,22 @@ if (isset($_GET['action']) && $_GET['action'] == 'deal') {
$_SESSION['deckHS2'] = new Deck($_GET['action']);
$_SESSION['gameHS2'] = new Game($_SESSION['deckHS2']);
$game = $_SESSION['gameHS2'];
echo json_encode($game->start(40));
echo json_encode($game->start(20));
}else if (isset($_GET['action']) && $_GET['action'] == 'dealHS3') {
$_SESSION['deckHS3'] = new Deck($_GET['action']);
$_SESSION['gameHS3'] = new Game($_SESSION['deckHS3']);
$game = $_SESSION['gameHS3'];
echo json_encode($game->start(24));
}else if (isset($_GET['action']) && $_GET['action'] == 'dealHS4') {
$_SESSION['deckHS4'] = new Deck($_GET['action']);
$_SESSION['gameHS4'] = new Game($_SESSION['deckHS4']);
$game = $_SESSION['gameHS4'];
echo json_encode($game->start(24));
}
else if (isset($_GET['action']) && $_GET['action'] == 'submit'){
$deck = $_SESSION['deck'];
echo json_encode($deck->threeMore());
@ -107,4 +118,12 @@ else if (isset($_GET['action']) && $_GET['action'] == 'submitHS1'){
else if (isset($_GET['action']) && $_GET['action'] == 'submitHS2'){
$deck = $_SESSION['deckHS2'];
echo json_encode($deck->sixMore());
}
else if (isset($_GET['action']) && $_GET['action'] == 'submitHS3'){
$deck = $_SESSION['deckHS3'];
echo json_encode($deck->sixMore());
}
else if (isset($_GET['action']) && $_GET['action'] == 'submitHS4'){
$deck = $_SESSION['deckHS4'];
echo json_encode($deck->eightMore());
}

@ -129,7 +129,7 @@ h1 {
.game-boardHS2 {
margin-top: -0.5%;
margin-left: 17%;
margin-left: 1%;
height: 800px;
width: 800px;
transform: rotate(90deg);

@ -67,8 +67,8 @@
<button class="game-button text" id="playSimpleHSet" onclick="showGameHS();">Hyper SET! 3*4</button>
<button class="game-button text" id="playSimpleHSetLast" onclick="showGameHS1();">Hyper SET! 3*5</button>
<button class="game-button text" id="playHSetFour" onclick="showGameHS2();">Hyper SET! 4*4</button>
<button class="game-button text" id="playSimpleHSetFive" onclick="showGameHS3();">(à venir)</button>
<button class="game-button text" id="playHSetFive" onclick="showGameHS4();">(à venir)</button>
<button class="game-button text" id="playSimpleHSetFive" onclick="showGameHS3();">Hyper SET! 4*5</button>
<button class="game-button text" id="playHSetFive" onclick="showGameHS4();">Hyper SET! 5*5</button>
</div>
</div>
@ -207,7 +207,29 @@
<div class="game-boardHS2" data-display="game-boardHS2"></div>
</div>
<div id='gameHS3' class="wrapper" style="display: none;">
<h1>HyperSet 4x5 à tester + compteur+ images </h1>
<div class=" back-btn small-btn">
<img class="small-btn" onclick="goSelectModeHyperSet3()" src="vues/images/previous.png">
</div>
<p>Nombre de carte = 6; Nombre de critères = 5</p>
<p>HyperSets found: <span data-display="scoreHS3" class="score">0</span></p>
<p>Number of HyperSets: <span data-display="nbSetsHS3" class="nbSets"></span></p>
<div class="game-boardHS3" data-display="game-boardHS3"></div>
</div>
<div id='gameHS4' class="wrapper" style="display: none;">
<h1>HyperSet 5x5 à tester + compteur+ images </h1>
<div class=" back-btn small-btn">
<img class="small-btn" onclick="goSelectModeHyperSet4()" src="vues/images/previous.png">
</div>
<p>Nombre de carte = 8; Nombre de critères = 5</p>
<p>HyperSets found: <span data-display="scoreHS4" class="score">0</span></p>
<p>Number of HyperSets: <span data-display="nbSetsHS4" class="nbSets"></span></p>
<div class="game-boardHS3" data-display="game-boardHS4"></div>
</div>

@ -93,8 +93,14 @@ function showGameHS2(){
document.getElementById('gameHS2').style.display='block';
document.getElementById('selectModeHyperSet').style.display='none';
}
function showGameHS3(){
document.getElementById('gameHS3').style.display='block';
document.getElementById('selectModeHyperSet').style.display='none';
}
function showGameHS4(){
document.getElementById('gameHS4').style.display='block';
document.getElementById('selectModeHyperSet').style.display='none';
}
@ -247,3 +253,11 @@ function goSelectModeHyperSet2(){
document.getElementById('gameHS2').style.display='none';
document.getElementById('selectModeHyperSet').style.display='block';
}
function goSelectModeHyperSet3(){
document.getElementById('gameHS3').style.display='none';
document.getElementById('selectModeHyperSet').style.display='block';
}
function goSelectModeHyperSet4(){
document.getElementById('gameHS4').style.display='none';
document.getElementById('selectModeHyperSet').style.display='block';
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save