Skip to main content

C'est la Z

Category: Advent of Code

Advent 2023 Day 15 - hash tables

Haven't written up the last few days but I thought today's Advent of Code problem was worth a few words. I might still go back and write up a few other ones, and who knows if I'll finish any more problems - Is stopped around here last year. We'll see. I liked today's challenge because it was a nice introduction to hash tables. Specifically, to solve the problem, you implement a simple open hash table.
# COMMENTS

Advent 2023 Day 08 2 - checking the data

I wanted to add a bit to yesterday's post. Yesterday I wrote that for part 2 I just counted the cycles from each starting point. If you looked at my code you'd notice that I didn't actually do that. If you recall, nodes were identified by 3 letter codes. All nodes that end in an A like AAA or BBA are start nodes and all nodes that end in a Z are end nodes and we had to find the step, when starting simultaneously at all start nodes, that they all get to end nodes.
# COMMENTS

Advent 2023 Day 08 - Ghost paths

Today's puzzle was just what I needed this morning. Made me think, but not too much :-). You can find the problem here. Part 1 was pretty straightforward. You had a set of locations and for each location you could go left or right. So, for example, if node AAA is defined as AAA = (BBB,CCC) then, if your next instruction was L or left, you'd go to BBB, if it was R, then CCC.
# COMMENTS

Advent 2023 Day 06 - multiple approaches to a problem

I haven't and probably won't write up problems 2 through 5 and to be honest, don't know how many days I'll go on solving this year. I thought that today's problem was interesting enough for a write up so if you're interested, keep reading. Here's a link to the problem: https://adventofcode.com/2023/day/6 And my solution(s) are here. What I liked about today's problem is that there are various, let's say levels to the solution(s).
# COMMENTS

Advent of Code 2023 Day 01

It's that time again. Advent of Code 2023. A new two part programming problem each day from now through December 25th. Since 2015 I've looked forward to the event, taken part, and posted at least a few write ups here on my blog. I figured this year would be the same. Of course, it does end up putting a crunch in my routine. Usually each morning I wake up, work out, usually a run unless the weather's bad, have my coffee, do the puzzle, read blogs and other content over breakfast and then I'm ready for the rest of my day.
# COMMENTS

Advent 2022 - day 3 - sets

Day 3 ended up being a quick one. That is, as long as your language supports set operations. You can do it without set operations but it's easier if you've got them. Part 1 Input is a file of text where each line is an input. You have to read each line, split it in half and then find the common letter between the left and right halves and then apply their scoring rules on that letter.
# COMMENTS

Advent of Code 2022 - Days 1 and 2

It's Advent of Code season again. Every day a new two part programming challenge and once again I'm taking part. At least until grading and other end of term obligations end up eating my lunch. I wasn't planning on writing anything up but the first two days looked like nice problems for CS1 or even CS0 students and since my friend Steve was writing up his take, I thought I'd at least comment on the first two.
# COMMENTS

A Teacher Looks at Advent of Code 2020 - Day 1

So, yesterday I was chatting with my daughter. She was talking with her team and for some reason one of them pulled out an interview question from their company's question bank. Turns out it was today's Advent of Code problem. As with past years, I'm going to try to solve the problems in Clojure but if I can will talk Python when I talk about solutions. Part 1 of the problem basically asks for you to find a pair of numbers in an array that sum to a specific value.
# COMMENTS

Multi Stage Assignments - the good and the bad - Advent of Code

In the real world you're usually not building your own projects from scratch. Much more frequently you're working on a team and you and other players come and go over time. This is in stark contrast to most CS educational experiences where students typically complete relatively small assignments from beginning to end. One of my biggest fears way back when as I was about to graduate college was when I woke up one night in a cold sweath "oh crap - in a couple of weeks I'm going to have to actually produce good code.
# COMMENTS

Advent 2019 Day 8 - addendum - generating inputs

As I said in my last post, day 8 would be a nice project or lesson in an APCS-A or college CS1 class. Another nice problem would be to write a program to generate an image in the format required by the question. Alternatively, a teacher doing day 8 with their classes might want to generate a bunch of images for the students to test their decoders on. I thought I'd write one to see how appropriate it would be for the students.
# COMMENTS