@@ -75,7 +75,19 @@ L.#.L..#..
7575#.#L#L#.##`
7676)
7777
78- const testDataPart2 = testData . slice ( 0 , 2 )
78+ const testDataPart2 = [ testData [ 0 ] ]
79+ testDataPart2 . push (
80+ `#.##.##.##
81+ #######.##
82+ #.#.#..#..
83+ ####.##.##
84+ #.##.##.##
85+ #.#####.##
86+ ..#.#.....
87+ ##########
88+ #.######.#
89+ #.#####.##`
90+ )
7991testDataPart2 . push (
8092`#.LL.LL.L#
8193#LLLLLL.LL
@@ -171,14 +183,14 @@ describe('--- Day 11: Seating System ---', () => {
171183.........
172184#........
173185...#.....`
174- expect ( occupiedLineOfSite ( { x : 1 , y : 1 , seatMap : data } ) ) . to . equal ( 8 )
186+ expect ( occupiedLineOfSite ( { x : 3 , y : 4 , seatMap : parse ( data ) } ) ) . to . equal ( 8 )
175187 } )
176188 it ( 'cannot see occupied seats past an available seat' , ( ) => {
177189 const data =
178190`.............
179191.L.L.#.#.#.#.
180192.............`
181- expect ( occupiedLineOfSite ( { x : 3 , y : 4 , seatMap : data } ) ) . to . equal ( 0 )
193+ expect ( occupiedLineOfSite ( { x : 1 , y : 1 , seatMap : parse ( data ) } ) ) . to . equal ( 0 )
182194 } )
183195 it ( 'can look in all compass directions' , ( ) => {
184196 const data =
@@ -189,21 +201,22 @@ describe('--- Day 11: Seating System ---', () => {
189201##...##
190202#.#.#.#
191203.##.##.`
192- expect ( occupiedLineOfSite ( { x : 3 , y : 3 , seatMap : data } ) ) . to . equal ( 0 )
204+ expect ( occupiedLineOfSite ( { x : 3 , y : 3 , seatMap : parse ( data ) } ) ) . to . equal ( 0 )
193205 } )
194206 } )
195207 describe ( 'advance()' , ( ) => {
196208 it ( 'accepts visibility rules instead of proximity' , ( ) => {
197209 const results = testDataPart2 . map ( ( data ) => {
198210 return format (
199211 advance (
200- parse ( data ) , 'visible '
212+ parse ( data ) , 'visibility '
201213 )
202214 )
203215 } )
204216
205217 for ( let x = 1 ; x < testDataPart2 . length ; x ++ ) {
206218 console . debug ( 'Step' , x )
219+ console . debug ( results [ x - 1 ] )
207220 expect ( results [ x - 1 ] ) . to . equal ( testDataPart2 [ x ] )
208221 }
209222 const finalOccupancy = ( results [ results . length - 1 ] . match ( / # / g) || [ ] ) . length
0 commit comments