diff --git a/src/activities/nine_men_morris/NineMenMorris.qml b/src/activities/nine_men_morris/NineMenMorris.qml index 127570202..74b546550 100644 --- a/src/activities/nine_men_morris/NineMenMorris.qml +++ b/src/activities/nine_men_morris/NineMenMorris.qml @@ -1,579 +1,593 @@ /* GCompris - NineMenMorris.qml * * Copyright (C) 2016 Pulkit Gupta * * Authors: * Pulkit Gupta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import "../../core" import "nine_men_morris.js" as Activity import "." ActivityBase { id: activity property bool twoPlayer: false onStart: focus = true onStop: {} pageComponent: Image { id: background anchors.fill: parent source: Activity.url + "background.svg" sourceSize.width: Math.max(parent.width, parent.height) fillMode: Image.PreserveAspectCrop signal start signal stop Component.onCompleted: { activity.start.connect(start) activity.stop.connect(stop) } // Add here the QML items you need to access in javascript QtObject { id: items property Item main: activity.main property alias dragPointsModel: dragPointsModel property alias dragPoints: dragPoints property alias player1: player1 property alias firstInitial: firstInitial property alias firstPlayerPieces: firstPlayerPieces property alias firstPlayerPiecesModel: firstPlayerPiecesModel property alias firstPieceNumberCount: firstPieceNumber.count property alias player1background: player1background.visible property alias player1_score: player1_score.text property alias player1turn: player1turn property alias player1shrink: player1shrink property alias player1image: player1image property alias changeScalePlayer1: changeScalePlayer1 property alias rotateKonqi: rotateKonqi property alias player2: player2 property alias secondInitial: secondInitial property alias secondPlayerPieces: secondPlayerPieces property alias secondPlayerPiecesModel: secondPlayerPiecesModel property alias secondPieceNumberCount: secondPieceNumber.count property alias player2background: player2background.visible property alias player2_score: player2_score.text property alias player2turn: player2turn property alias player2shrink: player2shrink property alias player2image: player2image property alias changeScalePlayer2: changeScalePlayer2 property alias rotateTux: rotateTux property bool gameDone property int turn property bool playSecond property bool firstPhase property bool pieceBeingMoved property alias bar: bar property alias bonus: bonus property alias instructionTxt: instruction.text property alias tutorialSection: tutorialSection } onStart: Activity.start(items, twoPlayer) onStop: Activity.stop() Image { id: board source: Activity.url + "board.svg" sourceSize.width: Math.min(background.height - 1.4 * player1.height - 1.2 * bar.height, background.width - 2.2 * firstInitial.width) + z: 2 anchors { verticalCenter: parent.verticalCenter horizontalCenter: parent.horizontalCenter verticalCenterOffset : -0.25 * player1.height } Repeater { id: dragPoints model: dragPointsModel delegate: point Component { id: point DragPoint { id: dragPoint x: posX * parent.width - width / 2 y: posY * parent.height - height / 2 index: myIndex firstPhase: items.firstPhase pieceBeingMoved: items.pieceBeingMoved } } } } ListModel { id: dragPointsModel } Rectangle { id: firstInitial anchors { left: player1.left top: player1.bottom topMargin: player1.height * 0.5 } width: player1.width * 1.2 height: player1.height * 1.2 visible: items.firstPhase + z: 2 opacity: 0.8 radius: 10 border.width: 2 border.color: "black" gradient: Gradient { GradientStop { position: 0.0; color: "#6b4723" } GradientStop { position: 0.9; color: "#996633" } GradientStop { position: 1.0; color: "#AAA" } } Repeater { id: firstPlayerPieces model: firstPlayerPiecesModel delegate: firstPieceInitial Component { id: firstPieceInitial Piece { id: firstPiece state: "1" firstPhase: items.firstPhase sourceSize.height: Math.min(firstInitial.height * 0.8, firstInitial.width * 0.4) x: firstInitial.width * 0.06 anchors.verticalCenter: firstInitial.verticalCenter chance: items.turn % 2 playSecond: items.playSecond gameDone: items.gameDone pieceBeingMoved: items.pieceBeingMoved } } } GCText { id: firstPieceNumber anchors { verticalCenter: parent.verticalCenter right: parent.right rightMargin: parent.width * 0.1 } + z: 2 fontSize: mediumSize color: "white" style: Text.Outline styleColor: "black" horizontalAlignment: Text.AlignHCenter property int count: 9 text: "X%1".arg(count) } } ListModel { id: firstPlayerPiecesModel } Rectangle { id: secondInitial anchors { right: player2.right top: player2.bottom topMargin: player2.height * 0.5 } width: firstInitial.width height: firstInitial.height + z: 2 visible: items.firstPhase opacity: 0.8 radius: 10 border.width: 2 border.color: "black" gradient: Gradient { GradientStop { position: 0.0; color: "#6b4723" } GradientStop { position: 0.9; color: "#996633" } GradientStop { position: 1.0; color: "#AAA" } } Repeater { id: secondPlayerPieces model: secondPlayerPiecesModel delegate: secondPieceInitial Component { id: secondPieceInitial Piece { id: secondPiece state: "2" firstPhase: items.firstPhase sourceSize.height: Math.min(secondInitial.height * 0.8, secondInitial.width * 0.4) x: secondInitial.width * 0.06 anchors.verticalCenter: secondInitial.verticalCenter chance: items.turn % 2 playSecond: items.playSecond gameDone: items.gameDone pieceBeingMoved: items.pieceBeingMoved } } } GCText { id: secondPieceNumber anchors { verticalCenter: parent.verticalCenter right: parent.right rightMargin: parent.width * 0.1 } + z: 2 fontSize: mediumSize color: "white" style: Text.Outline styleColor: "black" horizontalAlignment: Text.AlignHCenter property int count: 9 text: "X%1".arg(count) } } ListModel { id: secondPlayerPiecesModel } // Instruction section starts GCText { id: instruction anchors { horizontalCenter: parent.horizontalCenter top: parent.top topMargin: 5 } fontSizeMode: Text.Fit minimumPixelSize: 10 color: "white" style: Text.Outline styleColor: "black" horizontalAlignment: Text.AlignHLeft width: implicitWidth height: implicitHeight - z: 2 + z: 3 } Rectangle { id: instructionContainer anchors.top: instruction.top anchors.horizontalCenter: parent.horizontalCenter width: instruction.width + 20 height: instruction.height + 2 + z: 2 opacity: 0.8 radius: 10 border.width: 2 border.color: "black" gradient: Gradient { GradientStop { position: 0.0; color: "#000" } GradientStop { position: 0.9; color: "#666" } GradientStop { position: 1.0; color: "#AAA" } } } // Instruction section ends // Player scores section start Rectangle { id: player2 height: Math.min(background.height / 10, Math.min(background.width / 9, bar.height * 0.9)) width: height * 11 / 8 anchors { top: background.top topMargin: 5 right: background.right rightMargin: 5 } radius: 5 + z: 2 state: "second" Image { id: player2background source: Activity.url + "score_2.svg" sourceSize.height: parent.height * 0.93 anchors.centerIn: parent Image { id: player2image source: Activity.url + "TuxBlack.svg" sourceSize.height: parent.height * 0.8 x: parent.width * 0.05 anchors.verticalCenter: parent.verticalCenter } GCText { id: player2_score anchors.verticalCenter: parent.verticalCenter x: parent.width * 0.65 color: "#2a2a2a" fontSize: mediumSize } } states: [ State { name: "first" PropertyChanges { target: player2image source: Activity.url + "TuxBlack.svg" } PropertyChanges { target: player2 color: "#49bbf0" } }, State { name: "second" PropertyChanges { target: player2 color: "transparent" } PropertyChanges { target: player2image source: Activity.url + "TuxBlack.svg" } }, State { name: "win" PropertyChanges { target: player2image source: Activity.url + "win.svg" } PropertyChanges { target: player2 color: "#f7ec5d" } } ] transform: Scale { id: changeScalePlayer2 property real scale: 1 origin.x: player2.width origin.y: 0 xScale: scale yScale: scale } } Rectangle { id: player1 height: Math.min(background.height / 10, Math.min(background.width / 9, bar.height * 0.9)) width: height * 11 / 8 anchors { top: background.top topMargin: 5 left: background.left leftMargin: 5 } radius: 5 + z: 2 state: "second" Image { id: player1background source: Activity.url + "score_1.svg" sourceSize.height: parent.height * 0.93 anchors.centerIn: parent Image { id: player1image source: Activity.url + "KonqiWhite.svg" sourceSize.height: parent.height * 0.8 x: parent.width * 0.05 anchors.verticalCenter: parent.verticalCenter } GCText { id: player1_score anchors.verticalCenter: parent.verticalCenter color: "#2a2a2a" x: parent.width * 0.65 fontSize: mediumSize } } states: [ State { name: "first" PropertyChanges { target: player1image source: Activity.url + "KonqiWhite.svg" } PropertyChanges { target: player1 color: "#f07c49" } }, State { name: "second" PropertyChanges { target: player1 color: "transparent" } PropertyChanges { target: player1image source: Activity.url + "KonqiWhite.svg" } }, State { name: "win" PropertyChanges { target: player1image source: Activity.url + "win.svg" } PropertyChanges { target: player1 color: "#f7ec5d" } } ] transform: Scale { id: changeScalePlayer1 property real scale: 1 xScale: scale yScale: scale } } // Player scores section ends // Animation section start PropertyAnimation { id: player1turn target: changeScalePlayer1 properties: "scale" from: 1.0 to: 1.4 duration: 500 onStarted:{ player1.state = "first" player2.state = "second" rotateTux.stop() player2image.rotation = 0 rotateKonqi.start() player2shrink.start() } onStopped: {Activity.shouldComputerPlay()} } PropertyAnimation { id: player1shrink target: changeScalePlayer1 properties: "scale" from: 1.4 to: 1.0 duration: 500 } PropertyAnimation { id: player2turn target: changeScalePlayer2 properties: "scale" from: 1.0 to: 1.4 duration: 500 onStarted:{ player1.state = "second" player2.state = "first" rotateKonqi.stop() player1image.rotation = 0 rotateTux.start() player1shrink.start() } onStopped: {Activity.shouldComputerPlay()} } PropertyAnimation { id: player2shrink target: changeScalePlayer2 properties: "scale" from: 1.4 to: 1.0 duration: 500 } SequentialAnimation { id: rotateKonqi loops: Animation.Infinite NumberAnimation { target: player1image property: "rotation" from: -30; to: 30 duration: 750 easing.type: Easing.InOutQuad } NumberAnimation { target: player1image property: "rotation" from: 30; to: -30 duration: 750 easing.type: Easing.InOutQuad } } SequentialAnimation { id: rotateTux loops: Animation.Infinite NumberAnimation { target: player2image property: "rotation" from: -30; to: 30 duration: 750 easing.type: Easing.InOutQuad } NumberAnimation { target: player2image property: "rotation" from: 30; to: -30 duration: 750 easing.type: Easing.InOutQuad } } // Animation section ends - Tutorial { - id: tutorialSection - source: Activity.url + "background.svg" - tutorialDetails: Activity.tutorialInstructions - onSkipPressed: { + Image { + id: tutorialImage + source: Activity.url + "background.svg" + anchors.fill: parent + z: 5 + Tutorial { + id: tutorialSection + tutorialDetails: Activity.tutorialInstructions + onSkipPressed: { Activity.initLevel() - } - } + tutorialImage.z = 0 + } + } + } DialogHelp { id: dialogHelp onClose: home() } Bar { id: bar content: BarEnumContent { value: twoPlayer ? (help | home | reload) : items.tutorialSection.visible ? (help | home) : (help | home | level | reload)} onHelpClicked: { displayDialog(dialogHelp) } onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: activity.home() onReloadClicked: { Activity.reset() } } Bonus { id: bonus } } } diff --git a/src/activities/oware/Oware.qml b/src/activities/oware/Oware.qml index a3a918408..889fa9b1d 100644 --- a/src/activities/oware/Oware.qml +++ b/src/activities/oware/Oware.qml @@ -1,265 +1,273 @@ /* GCompris - Oware.qml * * Copyright (C) 2017 Divyam Madaan * * Authors: * Frederic Mazzarol (GTK+ version) * Divyam Madaan (Qt Quick port) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" import "oware.js" as Activity import "." ActivityBase { id: activity onStart: focus = true onStop: {} pageComponent: Image { id: background anchors.fill: parent source: "qrc:/gcompris/src/activities/guesscount/resource/backgroundW01.svg" signal start signal stop Component.onCompleted: { activity.start.connect(start) activity.stop.connect(stop) } // Add here the QML items you need to access in javascript QtObject { id: items property Item main: activity.main property alias background: background property alias bar: bar property alias bonus: bonus property alias cellGridRepeater: cellGridRepeater property bool playerOneTurn: true property int playerOneScore: 0 - property int playerOneSeeds: 0 property int playerTwoScore: 0 - property int playerTwoSeeds: 0 + property alias playerOneLevelScore: playerOneLevelScore + property alias playerTwoLevelScore: playerTwoLevelScore } onStart: { Activity.start(items) } onStop: { Activity.stop() } Image { id: board source: Activity.url + "/owareBoard.png" anchors.centerIn: parent z: 2 width: parent.width * 0.7 height: width * 0.4 } Grid { id: boardGrid columns: 6 rows: 2 anchors.horizontalCenter: board.horizontalCenter anchors.top: board.top z: 2 Repeater { id: cellGridRepeater model: 12 Rectangle { color: "transparent" height: board.height/2 width: board.width * (1/6.25) property var circleRadius: width property int value GCText { - text: index + text: value color: "white" anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter } Repeater { id: grainRepeater model: value Image { id: grain source: Activity.url + "grain2.png" height: circleRadius * 0.2 width: circleRadius * 0.2 x: circleRadius/2 + Activity.getX(circleRadius/6, index,value) y: circleRadius/2 + Activity.getY(circleRadius/5, index,value) //To move the seeds from one hole to other on button click. Not working :( states: State { name: "move" when: buttonClick.containsPress PropertyChanges { target: grain scale: 1.1 } } } } } } } ListView { id: rowButton width: boardGrid.width height: boardGrid.height * 0.25 orientation: ListView.Horizontal model: 6 anchors.horizontalCenter: board.horizontalCenter anchors.top: board.bottom interactive: false z: 2 delegate: Item { height: parent.height width: boardGrid.width/6 Image { id: valueImage source: Activity.url + "button" + (index + 1) + ".png" anchors.fill: parent MouseArea { id: buttonClick - anchors.fill:parent + anchors.fill: parent hoverEnabled: true onClicked: { - if(items.playerOneTurn) + if(items.playerOneTurn && (Activity.house[index] != 0)) { Activity.sowSeeds(index) - else + items.playerOneLevelScore.endTurn() + items.playerTwoLevelScore.beginTurn() + } + else if(Activity.house[11-index] != 0) { Activity.sowSeeds(11 - index) + items.playerTwoLevelScore.endTurn() + items.playerOneLevelScore.beginTurn() + } items.playerOneTurn = !items.playerOneTurn } } } } } Image { id: tutorialImage source: "qrc:/gcompris/src/activities/guesscount/resource/backgroundW01.svg" anchors.fill: parent z: 5 Tutorial { id:tutorialSection tutorialDetails: Activity.tutorialInstructions onSkipPressed: { Activity.initLevel() tutorialImage.z = 0 + playerOneLevelScore.beginTurn() } } } ScoreItem { id: playerOneLevelScore player: 1 height: Math.min(background.height/7, Math.min(background.width/7, bar.height * 1.05)) width: height * 11/8 anchors { top: background.top topMargin: 5 left: background.left leftMargin: 5 } playerImageSource: "qrc:/gcompris/src/activities/align4-2players/resource/player_1.svg" backgroundImageSource: "qrc:/gcompris/src/activities/align4-2players/resource/score_1.svg" } ScoreItem { id: playerTwoLevelScore player: 2 height: Math.min(background.height/7, Math.min(background.width/7, bar.height * 1.05)) width: height * 11/8 anchors { top: background.top topMargin: 5 right: background.right rightMargin: 5 } playerImageSource: "qrc:/gcompris/src/activities/align4-2players/resource/player_2.svg" backgroundImageSource: "qrc:/gcompris/src/activities/align4-2players/resource/score_2.svg" + playerScaleOriginX: playerTwoLevelScore.width } Image { id: playerOneScoreBox height: board.height * 0.4 width: height source:Activity.url+"/score.png" anchors.verticalCenter: parent.verticalCenter anchors.right: board.left GCText { id: playerOneScoreText color: "white" anchors.centerIn: parent fontSize: smallSize text: items.playerOneScore horizontalAlignment: Text.AlignHCenter wrapMode: TextEdit.WordWrap } } Image { id: playerTwoScore height: board.height * 0.4 width: height source:Activity.url+"/score.png" anchors.verticalCenter: parent.verticalCenter anchors.left: board.right GCText { id: playerTwoScoreText color: "white" anchors.centerIn: parent fontSize: smallSize text: items.playerTwoScore horizontalAlignment: Text.AlignHCenter wrapMode: TextEdit.WordWrap } } DialogHelp { id: dialogHelp onClose: home() } Bar { id: bar content: BarEnumContent { value: tutorialSection.visible ? (help | home) : (help | home | level | reload)} onHelpClicked: { displayDialog(dialogHelp) } onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: activity.home() onReloadClicked: Activity.initLevel() } Bonus { id: bonus } } } diff --git a/src/activities/oware/oware.js b/src/activities/oware/oware.js index dddb91160..a6b0b28bc 100644 --- a/src/activities/oware/oware.js +++ b/src/activities/oware/oware.js @@ -1,164 +1,164 @@ /* GCompris - oware.js * * Copyright (C) 2017 Divyam Madaan * * Authors: * Frederic Mazzarol (GTK+ version) * Divyam Madaan (Qt Quick port) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ .pragma library .import QtQuick 2.6 as Quick var currentLevel = 0 var numberOfLevel = 4 var items var url = "qrc:/gcompris/src/activities/oware/resource/" // house variable is used for storing the count of all the seeds as we play. var house = [] -var scoreHouse = [] +var scoreHouse = [0,0] var nextPlayer var tutorialInstructions = [ { "instruction": qsTr("At the beginning of the game four seeds are placed in each house. Players take turns by moving the seeds"), "instructionImage" : "qrc:/gcompris/src/activities/oware/resource/tutorial1.png" }, { "instruction": qsTr("In each turn, a player chooses one of the six houses under his or her control. The player removes all seeds from this house, and distributes them, dropping one in each house counter-clockwise from the original house, in a process called sowing."), "instructionImage": "qrc:/gcompris/src/activities/oware/resource/tutorial2.png" }, { "instruction": qsTr("After a turn, if the last seed was placed into an opponent's house and brought its total to two or three, all the seeds in that house are captured and placed in the player's scoring house (or set aside if the board has no scoring houses). If the previous-to-last seed also brought the total seeds in an opponent's house to two or three, these are captured as well, and so on."), "instructionImage": "qrc:/gcompris/src/activities/oware/resource/tutorial3.png" } ] function start(items_) { items = items_ currentLevel = 0 initLevel() } function stop() { } function initLevel() { for(var i = 11; i >= 0; i--) house[i] = 4 setValues() items.bar.level = currentLevel + 1 } function nextLevel() { if(numberOfLevel <= ++currentLevel ) { currentLevel = 0 } initLevel(); } function previousLevel() { if(--currentLevel < 0) { currentLevel = numberOfLevel - 1 } initLevel(); } function getX(radius,index,value){ var step=(2 * Math.PI) * index/value; return radius * Math.cos(step); } function getY(radius,index,value){ var step = (2 * Math.PI) * index/value; return radius * Math.sin(step); } -function setValues() { +function setValues() {/* print("after..") for(var i = 0; i < house.length; i++) { print(house[i]) - } + }*/ for(var i = 6, j = 0; i < 12, j < 6; j++, i++) items.cellGridRepeater.itemAt(i).value = house[j] for(var i = 0, j = 11; i < 6, j > 5; j--, i++) items.cellGridRepeater.itemAt(i).value = house[j] } function sowSeeds(index) { - print("Before...") - for(var i = 0; i < house.length; i++) - print(house[i]) - // player is the current player - var currentPlayer = items.playerOneTurn ? 1 : 2 + var currentPlayer = items.playerOneTurn ? 1 : 0 var nextIndex = index // The seeds are sown until the picked seeds are equal to zero while(house[index]) { nextIndex = (nextIndex + 1)%12 // If there are more than or equal to 12 seeds than we don't sow the in the pit from where we picked the seeds. if(index == nextIndex) { nextIndex = (nextIndex + 1)%12 } // Decrement the count of seeds and sow it in the nextIndex house[index]--; house[nextIndex]++; } // The nextIndex now contains the seeds in the last pit sown. var capture = []; - // The opponent's seeds are captured if they are equal to 2 or 3 - if (((house[nextIndex] == 2 || house[nextIndex] == 3) ) && ((currentPlayer * 6 <= nextIndex) && (j < (currentPlayer * 6 + 6)))) - capture[j%6] = true; - + print(currentPlayer) + print("index",nextIndex) + if (((house[nextIndex] == 2 || house[nextIndex] == 3) ) && ((currentPlayer == 1 && nextIndex > 5 && nextIndex < 12) || (currentPlayer == 0 && nextIndex >= 0 && nextIndex < 6))) { + capture[nextIndex%6] = true; + } /* The seeds previous to the captured seeds are checked. If they are equal to 2 or 3 then they are captured until a pit arrives which has more than 3 seeds or 1 seed. */ while (capture[nextIndex % 6] && nextIndex % 6) { nextIndex--; - if (house[nextIndex] == 2 || house[nextIndex] == 3) + if (house[nextIndex] == 2 || house[nextIndex] == 3) { capture[nextIndex % 6] = true; + } } var allSeedsCaptured = true; /* Now we check if all the seeds in opponents houses are captured or not. If any of the house is left with seeds we allSeedsCaptured as false */ for (var j = currentPlayer * 6; j < (currentPlayer * 6 + 6); j++) { if (!capture[j % 6] && house[j]) allSeedsCaptured = false; } // Now capture the seeds for the houses for which capture[houseIndex] = true if all seeds are not captured if (!allSeedsCaptured) { for (var j = currentPlayer * 6; j < (currentPlayer * 6 + 6); j++) { /* If opponent's houses capture is true we set the no of seeds in that house as 0 and give the seeds to the opponent. */ if (capture[j%6]) { - scoreHouse[nextPlayer] += house[j]; + scoreHouse[nextPlayer] = scoreHouse[nextPlayer] + house[j]; house[j] = 0; } } } - - // Now we check if the player has any more seeds or not - var playerSideEmpty = true; - for (var j = nextPlayer * 6; j < (nextPlayer * 6 + 6); j++) { - // If any of the pits in house is not empty we set playerSideEmpty as false - if (house[j]) { - playerSideEmpty = false; - break; - } - } - + items.playerTwoScore = (nextPlayer == 1) ? scoreHouse[1] : items.playerTwoScore + items.playerOneScore = (nextPlayer == 0) ? scoreHouse[0] : items.playerOneScore +// +// // Now we check if the player has any more seeds or not +// var playerSideEmpty = true; +// for (var j = nextPlayer * 6; j < (nextPlayer * 6 + 6); j++) { +// // If any of the pits in house is not empty we set playerSideEmpty as false +// if (house[j]) { +// playerSideEmpty = false; +// break; +// } +// } +// print(scoreHouse[nextPlayer]) nextPlayer = currentPlayer setValues() }