Merge pull request #1034 from NeroBurner/twos_comparison_warning

Twos: fix warning about extra paranthesis
This commit is contained in:
JF 2022-03-14 21:21:11 +01:00 committed by GitHub
commit fc374562dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,7 @@ bool Twos::placeNewTile() {
}
bool Twos::tryMerge(TwosTile grid[][4], int& newRow, int& newCol, int oldRow, int oldCol) {
if ((grid[newRow][newCol].value == grid[oldRow][oldCol].value)) {
if (grid[newRow][newCol].value == grid[oldRow][oldCol].value) {
if ((newCol != oldCol) || (newRow != oldRow)) {
if (!grid[newRow][newCol].merged) {
unsigned int newVal = grid[oldRow][oldCol].value *= 2;