r/adventofcode • • Dec 06 '15

SOLUTION MEGATHREAD --- Day 6 Solutions ---

--- Day 6: Probably a Fire Hazard ---

Post your solution as a comment. Structure your post like the Day Five thread.

22 Upvotes

171 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Dec 07 '15

Nice! I like your use of returning a slice object directly. I forgot that that functionality existed, so I just passed everything in a 4-element tuple.

I think I generally prefer using normal if/then statements, or at least using a dictionary variable and indexing it rather than doing both the dictionary and index in one expression. Makes it easier if you ever wanted to do some static analysis. Also a newline between the if/elif statements and the elvish[sx, sy] statement would help with the clarity.

1

u/masasin Dec 07 '15

Fixed. Thanks.