49
SOLUTION MEGATHREAD-🎄- 2019 Day 4 Solutions -🎄-(self.adventofcode)
submitted 6 years, 1 month ago* (edited 7 minutes after) by daggerdragon to /r/adventofcode (134.8k)
since 6 years, 1 month ago
4 of 4
Tip Reveddit Real-Time can notify you when your content is removed.
your account history
Tip Check if your account has any removed comments.
view my removed comments you are viewing a single comment's thread.
view all comments


Factor
Edit: I made a version that's 80 times faster (10 ms vs. 800 ms). Because I generate monotonically increasing numbers directly, rather than filtering them from the natural numbers.
I mean, how can people not love how this looks, I don't know, I might be just strange, but this is a beauty.
I'm thinking of maybe going through some of the easier ones in factor when this calendar is finished, I think being familiar with what kinds of words actualy exists :)
Heh, thanks.
One of my favorite things about Factor is due to the fact that everything is just words, even
[, the way you write programs is unambiguous. What's the syntax? Whitespace between words. Done.(The same applies to Forth, of course, but it's a little too imperative for my tastes until you extend it, at which time it becomes hard to share your code in a setting like this because you've essentially created a dialect.)
I like not having to fuss with whether I should write
a=21ora = 21or(2 - (1 + 1) )or(2-(1+1))or[first2 =]or[ first2 = ].The same sort of thing applies to evaluation order. No order of operations, no using syntax to change the way things are evaluated (unless you really want to).
It's hard for me to use anything else after experiencing this kind of simplicity.
I'd love to see any Factor programs you write! You did pretty well with it last year from what I remember.
Yeah, I've been playing around with some different forths and the simplicity is for sure something that I like a lot about it as well.
Also the help system for factor is really good, it's usually possible to find things within the help window without having to rely on external sources which is nice :)
The only thing that usually breaks down for me is when I have to construct something larger, because I'm not yet used to how to put together something larger with the blocks that I have accessible to me. But it's something that I'm looking forward to learning.
Yeah, I'll try to be posting them over here again when I do, maybe some older years, I'm not sure yet. It just will take some time to get into remembering the vocabulary again :)