Oware: Fix two player

Authored by dmadaan on Jul 6 2017, 1:32 PM.

Description

Oware: Fix two player

Details

Committed
dmadaanJul 6 2017, 1:32 PM
Parents
R2:8fd419a55dca: Oware: Add AI by alpha beta pruning algorithm
Branches
Unknown
Tags
Unknown
Restricted Application added a subscriber: jjazeix. ยท View Herald TranscriptJul 6 2017, 1:32 PM
jjazeix added inline comments.Jul 9 2017, 9:00 AM
/src/activities/oware/Oware.qml
153

you can probably factorise and clean the function as you do the same for player 1 and 2 (only the index change?)

164

why does playerOneTurn change 4 times in the same function?

dmadaan marked an inline comment as done.Jul 9 2017, 10:15 PM
dmadaan added inline comments.
/src/activities/oware/Oware.qml
153

I didn't get this? Do you mean changing index - 6 in the function? (the index change is to make the indexes like a proper circular array because in grid in QML it works from left to right, I wanted it left to right for bottom row and right to left for top)

jjazeix added inline comments.Jul 10 2017, 8:46 AM
/src/activities/oware/Oware.qml
153

no, you can factorize the code, it's twice the same except for the index. You first need to compute the index depending on the case you are and only write once the code.