samedi 27 juin 2015

an explanation for the testing method and how it's work

    class func checkThreeInARow(slotRow: [Slot]) -> Bool {


        let slot1 = slotRow[0]
        let slot2 = slotRow[1]
        let slot3 = slotRow[2]

        if slot1.value == slot2.value - 1 && slot1.value == slot3.value - 2 {

            return true
        }
        else if slot1.value == slot2.value + 1 && slot2.value == slot3.value + 2 {
            return true
        }
        else {
            return false
        }

and here is the link for the complete app http://ift.tt/1JqonzT i didn't underestand from where the "slot1.value" will get a value

Aucun commentaire:

Enregistrer un commentaire