r/adventofcode • u/daggerdragon • 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
View all comments
Show parent comment
1
u/Godspiral Dec 07 '15
a much cooler J solution (not my own),
i reads input to create 300 lines like:
where all of those words are defined functions, and , is a builtin. y =. y... reassigns in place the result from the line. (y is the right parameter name to all explicit functions)
3 : i creates a 300 line function from the data.
the through function creates a 1000 by 1000 matrix where the rectangle is set to 1, and off on toggle are all boolean functions.