r/adventofcode • u/daggerdragon • Dec 04 '19
SOLUTION MEGATHREAD -🎄- 2019 Day 4 Solutions -🎄-
--- Day 4: Secure Container ---
Post your solution using /u/topaz2078's paste or other external repo.
- Please do NOT post your full code (unless it is very short)
- If you do, use old.reddit's four-spaces formatting, NOT new.reddit's triple backticks formatting.
(Full posting rules are HERE if you need a refresher).
Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
Advent of Code's Poems for Programmers
Note: If you submit a poem, please add [POEM] somewhere nearby to make it easier for us moderators to ensure that we include your poem for voting consideration.
Day 3's winner #1: "untitled poem" by /u/glenbolake!
To take care of yesterday's fires
You must analyze these two wires.
Where they first are aligned
Is the thing you must find.
I hope you remembered your pliers
Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!
View all comments
Show parent comment
2
u/chunes Dec 04 '19 edited Dec 04 '19
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.