Advent of Code

Anything relating to non Sinclair computers from the 1980's, 90's or even before.
Post Reply
User avatar
Oloturia
Manic Miner
Posts: 476
Joined: Sat Jan 15, 2022 9:11 pm

Advent of Code

Post by Oloturia »

Every year since 2015 a competition among the best coders of the world is held. Every day from 1st of December to the 25th a coding puzzle is meant to be solved in the less time possible, or at least to be solved at all. It starts easy, becomes quickly hard and usually ends unfathomable.

There are no rules about the programming language to use. Most people choose Python, C/C++, Java or Rust, but I've seen also programs in APL, COBOL, and other less known languages. Myself I've completed 2015, 2020, 2021 and 2022 in python and redone 2020 in C++, and sometimes I solve the problems also in Scratch. It's a nice training, after all.

I'm wondering about how a Spectrum could perform. Obviously it would be tricky to solve the problems that feature inputs of more than ~40Kb, but we maybe could use those larger eastern clones.

Someone dare to try?

https://adventofcode.com/
User avatar
flatduckrecords
Manic Miner
Posts: 787
Joined: Thu May 07, 2020 11:47 am
Location: Oban, Scotland
Contact:

Re: Advent of Code

Post by flatduckrecords »

I thought about it a couple of years ago, as an exercise to better understand Z80 assembly - but I very quickly (day 1 or 2!) got out of my depth and gave up. Maybe a higher level language would be more feasible. :ugeek:

I stumbled accross an alternative this morning though (and it sounds much more my speed):

December Adventure
https://eli.li/2022/12/9/december-adventure
One program (that you work on every day). If it’s done in less than 31 days, you start a new one immediately. If it’s not done in 31 days, you still count it 100% as a win because the goal wasn’t to finish it, it was to work on it.
So it’s more about “exploring and learning” at your own pace, rather than being first to finish or whatever.

Maybe next year we ought to have Advanced Lawnmovember to encourage lots of CSSCGC entries (since December is too late! Although that’s still cutting it fine for the poor reviewer!)
User avatar
bluespikey
Manic Miner
Posts: 954
Joined: Tue Jun 30, 2020 3:54 pm

Re: Advent of Code

Post by bluespikey »

Advent of code is seriously good stuff and a great way of learning, Python in my case. For the first few days, you'll generally find that Python has a special keyword that solves the problem in one blow. It almost feels like cheating.

Anyway, someone has done AoC in Spectrum basic before now.

User avatar
Oloturia
Manic Miner
Posts: 476
Joined: Sat Jan 15, 2022 9:11 pm

Re: Advent of Code

Post by Oloturia »

Usually my solutions can take up to several hours (the longest ones going overnight) on a 3 GHz CPU. I wondered how far the Spectrum can go.
It seems from Lex's (the youtuber) github that they reached day 14. Unfortunately I can't read assembly so I'm missing that part of awe.

(I think I'll stick to python even this year)
User avatar
arjun
Microbot
Posts: 151
Joined: Sat Sep 19, 2020 7:34 am
Location: India
Contact:

Re: Advent of Code

Post by arjun »

I'm doing it this year in Rust. Anyone doing AoC in z80 assembly has my deepest respect. Even with modern language tooling and features, AoC requires a ton of string parsing, type conversion (string to int and back being most common), and implementing data structures to deal with the tricky puzzles. And while you can do anything in assembly that you can do in a high level language, it's still a chore (which is why high level languages and libraries exist in the first place). How anyone is maintaining the pace for 25 days (or even part of it) is beyond me!
Post Reply