Skip to content

Instantly share code, notes, and snippets.

@satan87
Created August 1, 2020 20:33
Show Gist options
  • Save satan87/608468889d21c70cc656fc584af80c6b to your computer and use it in GitHub Desktop.
Save satan87/608468889d21c70cc656fc584af80c6b to your computer and use it in GitHub Desktop.
func play() {
// We Check we are in Phase One
if phase == Phase.phase1 {
// We need to clean the result from previous turn
emptyTurnCombinationIfNecessary()
//We get a new random combination
var dice = Dice()
dice.roll()
let valueOne = dice.value
dice.roll()
let valueTwo = dice.value
dice.roll()
let valueThree = dice.value
let combination = Combination(one: valueOne, two: valueTwo, three: valueThree) // <- The part causing the problem.
lastlaunch = combination
turnCombination.append(combination)
changePlayer()
if turnCombination.count == numberOfPlayer {
endTurn()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment