1- export  type  CharacterArray  =  string [ ] [ ] 
2- 
3- interface  CoordinateBase  { 
4-   x : number ; 
5-   y : number ; 
6- } 
7- 
8- interface  Coordinate  extends  CoordinateBase  { 
9-   direction : 1  |  - 1 ; 
10- } 
11- 
12- interface  CoordinateData  { 
13-   xDirection : 1  |  - 1 ; 
14-   yDirection : 1  |  - 1 ; 
15-   data : CharacterArray 
16- } 
1+ import  type  { 
2+   Coordinate , 
3+   Point , 
4+   CoordinateData 
5+ }  from  '@/aoc/point/types.js' 
176
187/** 
198 * Finds the `WORD` input parameter in the vertical directions (up/down) from an (x,y) coordinate 
@@ -23,11 +12,11 @@ interface CoordinateData {
2312 * @param  coord.direction {number} Up or down letter-checking direction 
2413 *   - `-1` for "up" going to (0,0) 
2514 *   - `1` for "down" going to (N,N) from the `coord` 
26-  * @param  fullData {CharacterArray } 2D array of strings consisting of letters per item 
15+  * @param  fullData {string[][] } 2D array of strings consisting of letters per item 
2716 * @param  WORD {string} Word to find 
2817 * @returns  {boolean } Flag indicating the existence of the `WORD` 
2918 */ 
30- export  const  checkVertical  =  ( coord : Coordinate ,  fullData : CharacterArray ,  WORD : string ) : boolean  =>  { 
19+ export  const  checkVertical  =  ( coord : Coordinate ,  fullData : string [ ] [ ] ,  WORD : string ) : boolean  =>  { 
3120  let  yIndex  =  coord . y 
3221  let  subWord  =  '' 
3322
@@ -79,11 +68,11 @@ export const checkHorizontal = (coord: Coordinate, rowData: string[], WORD: stri
7968 * @typedef  param {CoordinateData} Direction and data object 
8069 * @param  param.xDirection {number} `-1` for "left" going to (0,0) or `1` for "right" going to (N,N) from the `coord` 
8170 * @param  param.yDirection {number} `-1` for "up" going to (0,0) or `1` for "down" going to (N,N) from the `coord` 
82-  * @param  param.data {CharacterArray } 2D string array containing the input text 
71+  * @param  param.data {string[][] } 2D string array containing the input text 
8372 * @returns  {boolean } Flag indicating the existence of the `WORD` 
8473 * @param  WORD {string} Word to find 
8574 */ 
86- export  const  checkDiagonal  =  ( coord : CoordinateBase ,  param : CoordinateData ,  WORD : string ) : boolean  =>  { 
75+ export  const  checkDiagonal  =  ( coord : Point ,  param : CoordinateData ,  WORD : string ) : boolean  =>  { 
8776  let  xIndex  =  coord . x 
8877  let  yIndex  =  coord . y 
8978  let  subWord  =  '' 
0 commit comments