Show newer

glad i learned how to use a screen reader

was using my phone while it was in my mitten, with said mitten being in my pocket

because guess what

advent of code day 4 

gist.github.com/Archenoth/4256

loop continues to put in some work

i deffed both inputs in a let form since def isn't lexixal

also, reading in the data was the same number of lines of code that actually solving the problem took

this day is the first time i've broken out the extremely neat threading macros to make things more readable (the ->> and as-> calls)

part 2 was a cakewalk since i already had all the tools written for part 1

the most interesting part in this one was using destructuring results as a predicate for checking if any sheets remained, and returning the last one if they didn't

i'm probably not going to continue putting in the actual code into posts like this, but for the first three it seemed okay enough~

Show thread

re: advent of code, day 3 

gist.github.com/Archenoth/4256

day 3 part 1 was easy peasy, i could just use the clojure frequencies function on each column, and sort them by that to make my destructuring consistent!

(loop [[more? & rem] (first input)
col 0
gamma ""
epsilon ""]
(if-not more?
(* (Integer/parseInt gamma 2) (Integer/parseInt epsilon 2))
(let [[[e] [g]] (sort-by second (frequencies (map #(nth % col) input)))]
(recur rem (+ 1 col) (str gamma g) (str epsilon e)))))

in part 2 was harder to understand what to do, and i had to break the column generalization into a separate function that i didn't know what to call (so i just called it "magic", hee)

the idea here is that the function will extract the most and least common bit, and their counts, then based on the default, do the right thing for the oxygen and carbon values

i could do both at the same time since the function should never reduce the values below one row

(defn magic [col values default]
(let [colvals (map #(nth % col) values)
[[lc lcc] [mc mcc]] (sort-by second (frequencies colvals))
look-for (if (= lcc mcc) default (if (= default 1) mc lc))]
(filter #(= look-for (nth % col)) values)))

(loop [col 0
omatches input
cmatches input]
(if (and (= 1 (count omatches)) (= 1 (count cmatches)))
(let [oxygen (apply str (first omatches))
coscrub (apply str (first cmatches))]
(* (Integer/parseInt oxygen 2) (Integer/parseInt coscrub 2)))
(recur (+ 1 col) (magic col omatches 1) (magic col cmatches 0))))
Show thread

re: advent of code, day 2 

gist.github.com/Archenoth/4256

part one was literally just a case in a loop, not a lot interesting to say about that!

(loop [[[dir dist] & rem] input
horiz 0
depth 0]
(if-not dir
(* horiz depth)
(case dir
"forward" (recur rem (+ horiz dist) depth)
"down" (recur rem horiz (+ depth dist))
"up" (recur rem horiz (- depth dist)))))

part two was just a slightly different recur, so there's not a lot to say about that either

(loop [[[dir dist] & rem] input
aim 0
horiz 0
depth 0]
(if-not dir
(* horiz depth)
(case dir
"forward" (recur rem aim (+ horiz dist) (+ depth (* aim dist)))
"down" (recur rem (+ aim dist) horiz depth)
"up" (recur rem (- aim dist) horiz depth))))

also, this was when i decided to use clojure to read in the data itself too, since it seems like passing larger datasets in my version of ob-clojure seems to blow the class size limit since it just plops the entire data structure into a let

i fixed how ob-clojure handles passed-in lists, but i haven't yet fixed how it loads larger datasets (though i still need to sign the fsf papers if i want to contrib it back upstream anyway, which is kind of a hassle :s)

Show thread

re: advent of code, day 1 

gist.github.com/Archenoth/4256

there wasn't anything particularly tricky about this day; i just basically added to the accumulator whenever the two numbers differed in the right way

(loop [[num & rest] input
increases 0]
(if-not rest
increases
(recur rest (if (< num (first rest)) (+ 1 increases) increases))))

part 2 was a little more interesting because i broke out the # constant to avoid the addition from happening in the first run. also destructuring made it a cakewalk to grab any number of numbers for the window~

(loop [[a b c & _ :as all] input
last-sum #
increases 0]
(if-not c
increases
(let [sum (+ a b c)]
(if (< last-sum sum)
(recur (rest all) sum (+ increases 1))
(recur (rest all) sum increases)))))
Show thread

advent of code, days 1-3 

and so, i've finally thrown together some advent of code stuff!

gist.github.com/Archenoth/4256

i started pretty late, but i decided pretty quickly that I'm probably going to bias towards using clojure for these challenges, and so far everything has been solvable pretty easily with loop and recur!

you know you've been into it pretty hardcore when you realize you haven't noticed any christmas decorations until the last week

absolutely exhausted in theory

i'm definitely not complaining about the accuracy of my hypothesis though

oh hey #dev nerds

black socialists in america is working to design a better online meeting platform and could use help with money but also coding!

i'm not sure how i typoed "!timefor" as "!timefox", but i want to thank the ether for blessing me with that idea

abdl 

like, i once posted this picture in a kink-positive chat: awoo.space/@thingywott/1037782

and someone who wasn't an abdl said i looked stylish as heck??

nothing could have made me feel better then that, hahah

Show thread

abdl 

why is the best compliment someone can give when they see you in a diaper "they suit you!"?

i guess i feel like others look great in diapers! but even though i wear them, i'm still a little self-conscious that i look bad, and that compliment is just really reassuring!

like, what makes me feel comfy and cozy is also natural to others who know! and that it's not just acceptance on their part--but also positive thoughts??

i went to work today in a kigurumi, it's super-fun wearing them out!

i even high fived someone on the way back~

for realsies though, this article (and the roguelike radio episode linked in it) kick so much ass

Show thread

i initially got curious when i learned that there's a community of low-sight and blind roguelike players who can play these games with a screen reader

one of the more popular roguelikes, dungeon crawl: stone soup was a popular choice because of a lot of the accessibility features and tweaks made to streamline the game

and upon learning this, the crawl devs were both surprised, but also apparently started thinking of other ways to improve playability with screen readers

rockpapershotgun.com/playing-r

Show thread
Show older
Awoo Space

Awoo.space is a Mastodon instance where members can rely on a team of moderators to help resolve conflict, and limits federation with other instances using a specific access list to minimize abuse.

While mature content is allowed here, we strongly believe in being able to choose to engage with content on your own terms, so please make sure to put mature and potentially sensitive content behind the CW feature with enough description that people know what it's about.

Before signing up, please read our community guidelines. While it's a very broad swath of topics it covers, please do your best! We believe that as long as you're putting forth genuine effort to limit harm you might cause – even if you haven't read the document – you'll be okay!