-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shibi Suriya
committed
Sep 30, 2023
1 parent
a757371
commit 6f8c4eb
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { NUMBER_OF_COLUMNS, NUMBER_OF_ROWS } from './constants'; | ||
import { generateKey, generateValue } from './utils'; | ||
|
||
const generateGridMap = () => { | ||
const hash = {}; | ||
for (let i = 0; i < NUMBER_OF_ROWS; i++) { | ||
for (let j = 0; j < NUMBER_OF_COLUMNS; j++) { | ||
hash[generateKey(i, j)] = generateValue(i, j); | ||
} | ||
} | ||
return hash; | ||
}; | ||
|
||
const GRID_MAP = generateGridMap(); | ||
export { GRID_MAP }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters