hyperset 3x5

master
readhame 5 years ago
parent bed1053955
commit 2bf9988cd7

@ -109,7 +109,8 @@
<workItem from="1593683259701" duration="5974000" />
<workItem from="1593698220416" duration="8218000" />
<workItem from="1593708007166" duration="214000" />
<workItem from="1593763430814" duration="11979000" />
<workItem from="1593763430814" duration="12646000" />
<workItem from="1594028438581" duration="7116000" />
</task>
<servers />
</component>
@ -153,10 +154,10 @@
<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="1593600080207" />
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1593763443297">
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1594028438540">
<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="1593763443297" />
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1594028438540" />
<state x="701" y="162" key="refactoring.ChangeSignatureDialog" timestamp="1593090265720">
<screen x="0" y="0" width="1920" height="1040" />
</state>

@ -197,6 +197,49 @@ class Deck {
}
}
}elseif ($changes === 'dealHS1') {
$colors = array('green', 'red', 'purple');
$shapes = array('oval', 'diamond', 'wave');
$fills = array('solid', 'stripped', 'open');
$borders = array('plein', 'point', 'rond');
$numbers = array(1, 2, 3);
$index1 = 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, $index1);
$card = new Card($cardAttributes, $this);
$index1++;
}
}
}
}
}
}elseif ($changes === 'dealHS2') {
$colors = array('green', 'red', 'purple', 'lightblue');
$shapes = array('oval', 'diamond', 'wave', 'rectangle');
$fills = array('solid', 'stripped', 'open','quadrillage');
$numbers = array(1, 2, 3,4);
$border = 'simple';
$index2 = 1;
foreach ($colors as $color) {
foreach ($shapes as $shape) {
foreach ($fills as $fill) {
foreach ($numbers as $number) {
$cardAttributes = new CardAttributes($color, $shape, $fill,$border, $number, $index2);
$card = new Card($cardAttributes, $this);
$index2++;
}
}
}
}
}
}
public function removeSet($cards) {
@ -229,4 +272,7 @@ class Deck {
public function fiveMore() {
return array_chop($this->cards, 5);
}
public function sixMore() {
return array_chop($this->cards, 6);
}
}

@ -55,9 +55,20 @@ if (isset($_GET['action']) && $_GET['action'] == 'deal') {
$_SESSION['gameHS0'] = new Game($_SESSION['deckHS0']);
$game = $_SESSION['gameHS0'];
echo json_encode($game->start(20));
}else if (isset($_GET['action']) && $_GET['action'] == 'dealHS1') {
$_SESSION['deckHS1'] = new Deck($_GET['action']);
$_SESSION['gameHS1'] = new Game($_SESSION['deckHS1']);
$game = $_SESSION['gameHS1'];
echo json_encode($game->start(55));
}else if (isset($_GET['action']) && $_GET['action'] == 'dealHS2') {
$_SESSION['deckHS2'] = new Deck($_GET['action']);
$_SESSION['gameHS2'] = new Game($_SESSION['deckHS2']);
$game = $_SESSION['gameHS2'];
echo json_encode($game->start(55));
}
else if (isset($_GET['action']) && $_GET['action'] == 'submit'){
$deck = $_SESSION['deck'];
echo json_encode($deck->threeMore());
@ -89,3 +100,11 @@ else if (isset($_GET['action']) && $_GET['action'] == 'submitHS0'){
$deck = $_SESSION['deckHS0'];
echo json_encode($deck->fourMore());
}
else if (isset($_GET['action']) && $_GET['action'] == 'submitHS1'){
$deck = $_SESSION['deckHS1'];
echo json_encode($deck->fourMore());
}
else if (isset($_GET['action']) && $_GET['action'] == 'submitHS2'){
$deck = $_SESSION['deckHS2'];
echo json_encode($deck->sixMore());
}

@ -86,6 +86,14 @@ h1 {
width: 800px;
transform: rotate(90deg);
}
.game-boardHS1 {
margin-top: -5%;
margin-left: 50%;
height: 800px;
width: 800px;
transform: rotate(90deg);
}
.shape {
display: inline-block;

@ -60,8 +60,8 @@
<div class="game-button-mode">
<button class="game-button text" id="playSimpleH" onclick="showGameHS0();">Hyper SET! 3*3</button>
<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! 4*4</button>
<button class="game-button text" id="playHSetFour" onclick="showGameHS2();">(à venir)</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>
</div>
@ -177,7 +177,7 @@
<div class="game-board" data-display="game-boardHS0"></div>
</div>
<div id='gameHS1' class="wrapper" style="display: none;">
<h1>HyperSet 3x3 </h1>
<h1>HyperSet 3x5 </h1>
<div class=" back-btn small-btn">
<img class="small-btn" onclick="goSelectModeHyperSet1()" src="vues/images/previous.png">
</div>
@ -185,9 +185,20 @@
<p>HyperSets found: <span data-display="scoreHS1" class="score">0</span></p>
<p>Number of HyperSets: <span data-display="nbSetsHS1" class="nbSets"></span></p>
<div class="game-board" data-display="game-boardHS1"></div>
<div class="game-boardHS1" data-display="game-boardHS1"></div>
</div>
<div id='gameHS2' class="wrapper" style="display: none;">
<h1>HyperSet 4x4 </h1>
<div class=" back-btn small-btn">
<img class="small-btn" onclick="goSelectModeHyperSet2()" src="vues/images/previous.png">
</div>
<p>Nombre de carte = 6; Nombre de critères = 4</p>
<p>HyperSets found: <span data-display="scoreHS2" class="score">0</span></p>
<p>Number of HyperSets: <span data-display="nbSetsHS2" class="nbSets"></span></p>
<div class="game-boardHS1" data-display="game-boardHS2"></div>
</div>

@ -89,6 +89,12 @@ function showGameHS1(){
document.getElementById('gameHS1').style.display='block';
document.getElementById('selectModeHyperSet').style.display='none';
}
function showGameHS2(){
document.getElementById('gameHS2').style.display='block';
document.getElementById('selectModeHyperSet').style.display='none';
}
@ -237,3 +243,7 @@ function goSelectModeHyperSet1(){
document.getElementById('gameHS1').style.display='none';
document.getElementById('selectModeHyperSet').style.display='block';
}
function goSelectModeHyperSet2(){
document.getElementById('gameHS2').style.display='none';
document.getElementById('selectModeHyperSet').style.display='block';
}

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