The hard truth is that I am lazy. Very lazy. Sometimes that’s good and sometimes it’s rather not. In this case it’s rather not. I want to be able to build mobile apps. Why is that? Well, sometimes I have some brain fart ideas and want to be able to prototype them quickly. Now the issue is, that the js package ecosystem is such a mess that I hate to touch it and therefore React Native is not really something I am keen on using. So what else can we use that’s nicely building cross-platform? Flutter. The issue with the laziness is now that I would really need to learn dart and I couldn’t convince myself so far beyond being able to read it and write some basic stuff.
[Read More]Getting Back in Shape
Go for dummies
Let me set the scene: I’ve worked a bunch of jobs recently that basically expected a lot of talking and very little getting actual stuff done. You know, it’s just part of the evolution of becoming more senior as an engineer. You don’t really get to make a bigger impact if you just stay in your little comfort zone coding small features and fixing bugs. You need to go out and talk to people. However, that’s a very wide topic and rather of a different day. In this post we’ll talk about getting back in shape with coding. The reality is, if you want to change jobs, it’s very likely that you’ll have to code and after completely messing up a coding interview rather recently, I figured that being super rusty, isn’t really helpful. For one, because it’s sad to not be able to just work things out in a snap, but on the other hand, it also is not doing yourself a favor in a live coding scenario when you’re under pressure. You want to be in your comfort zone, so you don’t get sweating.
[Read More]Advent of Code - Day 2
Day 2, another day, another challenge.
Part 1
Here’s the challenge:
--- Day 2: Cube Conundrum ---
You're launched high into the atmosphere! The apex of your trajectory just barely reaches the surface of a large island floating in the sky. You gently land in a fluffy pile of leaves. It's quite cold, but you don't see much snow. An Elf runs over to greet you.
The Elf explains that you've arrived at Snow Island and apologizes for the lack of snow. He'll be happy to explain the situation, but it's a bit of a walk, so you have some time. They don't get many visitors up here; would you like to play a game in the meantime?
As you walk, the Elf shows you a small bag and some cubes which are either red, green, or blue. Each time you play this game, he will hide a secret number of cubes of each color in the bag, and your goal is to figure out information about the number of cubes.
To get information, once a bag has been loaded with cubes, the Elf will reach into the bag, grab a handful of random cubes, show them to you, and then put them back in the bag. He'll do this a few times per game.
You play several games and record the information from each game (your puzzle input). Each game is listed with its ID number (like the 11 in Game 11: ...) followed by a semicolon-separated list of subsets of cubes that were revealed from the bag (like 3 red, 5 green, 4 blue).
For example, the record of a few games might look like this:
Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green
In game 1, three sets of cubes are revealed from the bag (and then put back again). The first set is 3 blue cubes and 4 red cubes; the second set is 1 red cube, 2 green cubes, and 6 blue cubes; the third set is only 2 green cubes.
The Elf would first like to know which games would have been possible if the bag contained only 12 red cubes, 13 green cubes, and 14 blue cubes?
In the example above, games 1, 2, and 5 would have been possible if the bag had been loaded with that configuration. However, game 3 would have been impossible because at one point the Elf showed you 20 red cubes at once; similarly, game 4 would also have been impossible because the Elf showed you 15 blue cubes at once. If you add up the IDs of the games that would have been possible, you get 8.
Determine which games would have been possible if the bag had been loaded with only 12 red cubes, 13 green cubes, and 14 blue cubes. What is the sum of the IDs of those games?
Oki doki. I’ll not lie, this probably would be easiest in bash as one-liner, but we want to do some proper coding so off we go.
[Read More]Advent of Code - Day 1
It’s the time of year again where you come together and… DO CODE CHALLENGEEEEEES!
Yes, Advent of Code is basically happening every year. With 24 cool challenges, in this case actually more, as we will find out. So I thought, why not get some coding done and then write a little thing about it. Actually, I got hooked by Polar Signal’s “Let’s Profile”, so kudos go there. I think it’s probably needless to say ,but I don’t, wouldn’t and can’t claim that my solutions are the best or fastest or whatever. They’re just my solutions, no more, no less.
[Read More]