giggs' blog

How I got into programming

Spacechem

I was introduced to programming thanks to Zachtronics games. The first I played was Spacechem in 2011. I didn’t think much of it at the time and quickly set it aside. This still baffles me to this day, I must have been in a really bad place back then.
In the spring of 2016, I was nearing the end of my studies and finally had a bit more time on my hand. I got pretty deep into Spacechem, finished it and tried to top the friends leaderboard everywhere.
In 2017, when Opus Magnum came out, biggiemac42 pointed me to the Zachtronics unofficial Discord server after I’d posted a record on reddit. I went back to chasing Spacechem records with the great people there. These guys were all programmers, and I was introduced to the notion that Spacechem was in fact very much like programming.

Project Euler

Seeing how much I enjoyed Spacechem, I wanted to try some actual programming. I’d read about project Euler. My friend Hubert mentioned Python was a beginner friendly language. It also had the name of an animal, not just an obscure letter like C, so it seemed like a good idea to me. I remember reading the first couple of lessons from practicepython.org before going in. It seems I solved about 20 problems at the time (fall 2017), but I don’t remember any of them. I did stumble upon this bit of code I wrote then, which definitely shows immense untapped talent:

Zachtronics assembly

In 2018, between June and September, I was very fortunate to participate in play-testing the upcoming Zachtronics game EXAPUNKS. I didn’t know anything about it when I joined, and was initially very intimidated by the fact that this was actual programming. An actual, assembly-like language, with a documentation and everything! As I’d never played TIS-100 or Shenzhen I/O, partly because of their reputation of being difficult games, I almost dropped out. I thought I’d be useless as a play-tester.

Instead, in those months I clocked in 300+ hours playtesting EXAPUNKS, I completed TIS-100 and got halfway through the second campaign in Shenzhen I/O (I also took part in the Spacechem summer tournament). This was on top of work, so I can only assume sleep was an afterthought.
I definitely loved those programming challenges, but them being a game was still the greater part of it being enjoyable to me.

Advent of code

My friend Oswald tried to get me into real programming in 2019 with Advent of Code. Apparently, I only completed 5 days before giving up. I don’t remember much of this, I assume I got frustrated that there were so many rules I didn’t know about (tsk, no condensed manual for a real-world language…) and didn’t feel like putting in the effort to learn more.

November 2020, Oswald motivated our gang to play Advent of Code with him. I’d completed the second Shenzhen I/O campaign during the first lockdown and felt that if I could complete the infamous Harvester puzzle (and it’s original, harder version) I could do anything! This time I actually put in the effort to learn new stuff when it was needed. Luckily, AoC 2020 was slightly easier than previous years and I managed to complete every puzzle within 24h of it being released. I even did the first one in the EXAPUNKS sandbox! I completed all puzzles from year 2015 after that, and a third of year 2016 in January 2021.

In December 2021, though I didn’t intend to, I did all AoC puzzles again (and for good measure, finished year 2016 after that).

Stepping beyond puzzles

Early 2022, I coded a bad Wordle solver, as well as a couple parsers for my bank statements that drastically cut my time spent bookkeeping for work. I also wrote a useless program that spits out the Discord message to display a Wordle result from a heavily standardized screenshot, just because I’d tried to tell my friend Sam that this was how I typed in the results and he didn’t believe I could do it.

I was growing dissatisfied with my work and needed a project, maybe something that would look good on a resume in case I decided to stumble on another career path.
My friends (all professional programmers) were very supportive. I was told I had the skills but lacked specific knowledge that could be learned easily if I took the time. Oswald kindly composed a curriculum of interesting courses and books that might be useful in case I didn’t know where to start.
All I knew was Python, so I chose the CS 212 class on Udacity from Peter Norvig. Though the Udacity UX isn’t very good, I definitely recommend the course for beginner to intermediate programmers like me.

My first project

Around this time, Oswald recruited us to start a programming club. Every week, we gather in a Discord call and talk about what kind of programming stuff we did at work (for those whose work it is) or in our spare time. Having finished the CS 212 class, I discussed with the club whether to try AoC 2017 in C or C++ or do a more serious project in Python. I wanted to try a bigger project, something “real-world”, but didn’t have any idea of something to get into.
Again, Oswald remembered Peter Norvig had a Sudoku solver on his webpage. So maybe I could do one and then compare with his!

It’s worth mentioning that Neil was starting to get into AI projects at this time and mentioned it in the programming club. I learned about the existence of TensorFlow and PyTorch.

I like Sudokus, and it seemed like something I could definitely handle. Later that evening, Hubert and I had a friendly competition speed-solving the daily challenge from sudoku.com, and he mentioned something along the lines of having AR glasses that showed the solution of a Sudoku when you looked at it.

And there it was. My first project would not be a simple sudoku solver, but a program that is shown an image of a Sudoku grid and spits out the solution! I was pretty confident I could code a solver, and I’d just learned about PyTorch, which is used for AI, right? So, digit recognition should be doable in Python! This was really appealing to me, worst case scenario I can’t do it but I’ll still learn a ton.

The solver part was easy enough, though the approach I used was inefficient (see upcoming dedicated article). Then, in a couple of days I stitched together bits of codes I found on StackOverflow to get a grid parser that can accurately print out some grids from screenshots of the daily Washington post Sudokus. I didn’t even need to use PyTorch, as Tesseract has a Python implementation.

It can most likely get correct results on screenshots from elsewhere, but it’s obvious to me that if I want to get something that’s both reliable and fast, I need to properly understand the methods used and do some actual coding myself, not just plumbing together libraries and making clever dumb fixes.

This is what prompted me to start this blog. I wanted to document the process. I’m hoping this will help me reflect on my learning experience and refine it. If, incidentally, this helps or entertains someone else, even better!

#programming