Fix lint errors

This commit is contained in:
Heikki Aitakangas
2022-04-02 05:16:48 +03:00
parent dc3b083587
commit 233289af56
2 changed files with 56 additions and 58 deletions
+2 -2
View File
@@ -864,12 +864,12 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
//prev[y] = new Array(width).fill(undefined) as [undefined];
}
function validPosition(y: number, x: number) {
function validPosition(y: number, x: number): boolean {
return y >= 0 && y < height && x >= 0 && x < width && data[y][x] == 0;
}
// List in-bounds and passable neighbors
function* neighbors(y: number, x: number) {
function* neighbors(y: number, x: number): Generator<[number, number]> {
if(validPosition(y - 1, x)) yield [y - 1, x]; // Up
if(validPosition(y + 1, x)) yield [y + 1, x]; // Down
if(validPosition(y, x - 1)) yield [y, x - 1]; // Left