FSHF
FSHF
CC#
Created by FSHF on 5/23/2023 in #help
✅ How to make this loop
Thx
12 replies
CC#
Created by FSHF on 5/23/2023 in #help
✅ How to make this loop
I got it working
12 replies
CC#
Created by FSHF on 5/23/2023 in #help
✅ How to make this loop
case "Knight":
int[] rowOffsets = { 2, 2, -2, -2, 1, 1, -1, -1 };
int[] colOffsets = { 1, -1, 1, -1, 2, -2, 2, -2 };

for (int i = 0; i < rowOffsets.Length; i++)
{
int newRow = currentCell.RowNumber + rowOffsets[i];
int newCol = currentCell.ColumnNumber + colOffsets[i];

if (isSafe(newRow, newCol))
theGrid[newRow, newCol].LegalNextMove = true;
}

break;
case "Knight":
int[] rowOffsets = { 2, 2, -2, -2, 1, 1, -1, -1 };
int[] colOffsets = { 1, -1, 1, -1, 2, -2, 2, -2 };

for (int i = 0; i < rowOffsets.Length; i++)
{
int newRow = currentCell.RowNumber + rowOffsets[i];
int newCol = currentCell.ColumnNumber + colOffsets[i];

if (isSafe(newRow, newCol))
theGrid[newRow, newCol].LegalNextMove = true;
}

break;
this what i got
12 replies
CC#
Created by FSHF on 5/23/2023 in #help
✅ How to make this loop
would it work the same with this
12 replies
CC#
Created by FSHF on 5/23/2023 in #help
✅ How to make this loop
im using forms btw
12 replies
CC#
Created by FSHF on 5/23/2023 in #help
✅ How to make this loop
what would knightmove be?
12 replies
CC#
Created by FSHF on 5/23/2023 in #help
✅ How to make this loop
how would i set it up
12 replies