r/adventofcode • • Dec 04 '15

SOLUTION MEGATHREAD --- Day 4 Solutions ---

--- Day 4: The Ideal Stocking Stuffer ---

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

15 Upvotes

272 comments sorted by

View all comments

Show parent comment

1

u/Godspiral Dec 04 '15

dyadic gethash was added in 8.03 iirc

The version you used is faster when you don't want a hex result. Not sure if hexhash used.

without using rx,

nzeros =: (x#'0')
while. nzeros -.@-: x {. md5 hexhash y,":num ...

good job functionalizing it though. Explicit is probably faster in this case.

1

u/hoosierEE Dec 04 '15

Ah I see, gethash is in the jqtide locale. I was using jconsole from a terminal, so that locale wasn't loaded. Weird that MD5 would be in one and not the other though.