Advent of Code 2023

386 views
Skip to first unread message

Nivethan T

unread,
Nov 30, 2023, 10:32:14 AM11/30/23
to Pick and MultiValue Databases
The Advent of Code (It's a coding puzzle each day until Christmas) is going to be starting up and I think it might be fun to do it in Pick.

I'll post my answers in this thread and hopefully we can get a group going here. :)

Nivethan T

unread,
Nov 30, 2023, 10:35:01 AM11/30/23
to Pick and MultiValue Databases
Forgot to link the site, sorry!


You will need to log in with one of the following:

[GitHub] [Google] [Twitter] [Reddit]

Nivethan T

unread,
Dec 1, 2023, 1:53:59 PM12/1/23
to Pick and MultiValue Databases
Day 1 has started!

My own answer:

I like using the multivalue aware functions like OCONVS and LENS.

Part 2 has a trick so if you get stuck you can check the subreddit or post here.

Optimus01010101

unread,
Dec 2, 2023, 12:54:09 PM12/2/23
to Pick and MultiValue Databases
Thanks for the tip in your code. I didn't get the second part without the help.

For day 2, I did get both parts. Like you, I love OCONV, but I also love CHANGE

Nivethan T

unread,
Dec 2, 2023, 8:01:12 PM12/2/23
to Pick and MultiValue Databases
Here is day 2 :)


I would have liked to have used something like MAXIMUM to find the max of each multivalue set. Similar to how we have MULS to multiply 2 multivalue lists together.

I also have a feeling part 1 could have been done using a FILE and maybe doing a select though I'm having trouble thinking it through.

Might be a fun challenge for someone to try and do these challenges with just the database and SELECTs!

Nivethan T

unread,
Dec 3, 2023, 11:20:54 AM12/3/23
to Pick and MultiValue Databases
Day 3!


This is all about adjacency checking on a board. Bit of a pain to write out all the code.

Weekend puzzles are usually harder so things should get a bit easier tomorrow. (hopefully)

Optimus01010101

unread,
Dec 3, 2023, 4:55:43 PM12/3/23
to Pick and MultiValue Databases
Well Niventhan, you solution is much more elegent than mine. I should have thought along the lines you did, but alas I did not.

Despite the bruttish way I did it, I did solve both parts.

Nivethan T

unread,
Dec 3, 2023, 9:20:16 PM12/3/23
to Pick and MultiValue Databases
The link 404s so here is another link :)


If it works, it works! 

I'm glad someone else is doing this as well. Having a varied corpus of BASIC will be handy for someone in the future.

Nivethan T

unread,
Dec 4, 2023, 9:29:31 AM12/4/23
to Pick and MultiValue Databases
Day 4 was definitely an easier one.


Depending on your implementation part 2 could take awhile to run if things are inefficient.

Optimus01010101

unread,
Dec 4, 2023, 10:13:57 AM12/4/23
to Pick and MultiValue Databases
sorry about that. But, it's day 4, so I need to get started. ;)

Optimus01010101

unread,
Dec 4, 2023, 12:56:24 PM12/4/23
to Pick and MultiValue Databases
Well Nivethan, logic wise, it seems that we are both on the same page for both parts of the puzzle.

My code is the same number of lines, but I straight lined it, while you uses of GOSUBS works as well.

One difference, I prefer dynamic arrays for a puzzle like this. I only use dimension arrays, when I need them to hold something like records or even file pointers. It just seems easier.

Also, I'm working on a system with QM. So I don't know if the functionality of TRIM is the same on other DB's?

Nivethan T

unread,
Dec 5, 2023, 9:55:32 AM12/5/23
to Pick and MultiValue Databases
Well Day 5 was a mission.

Part 1 wasn't too bad though this was the first puzzle I had to really sit down and map.

I haven't finished part 2 as the brute force answer was taking too long. Even after letting it run for 8 hours! (I'll post a link to my answer once I give up/get the answer)

Some tips and hints at:

Nivethan T

unread,
Dec 5, 2023, 6:00:52 PM12/5/23
to Pick and MultiValue Databases
Day 5, Part 1 only - I had hoped to last longer but I might be doing just part 1 puzzles from now on :(

Nivethan T

unread,
Dec 6, 2023, 9:53:43 AM12/6/23
to Pick and MultiValue Databases
Day 6 is thankfully much easier.


A little bit of math goes a long way here though other people were able to bruteforce the answer. It was taking too long for BASIC I think.

Optimus01010101

unread,
Dec 6, 2023, 2:42:35 PM12/6/23
to Pick and MultiValue Databases
Yeah, day 6 is magnitudes easier than day 5 part 2. I just gave up on that one.

I will say, my part 2 does sort of brute force, but it is under a minute on my system. However, Nivethan, you solution for part 2, again, puts me to shame.

This just validates what I've always said about PICK Basic: "There are an unlimited ways to code a program to skin a cat in PICK Basic"

Optimus01010101

unread,
Dec 7, 2023, 4:43:43 PM12/7/23
to Pick and MultiValue Databases
Ok, I guess I'm first with posting that I got both parts of DAY 7's puzzle.

Based on Reddit post, I had to use a different test data set than what was given in the AoC puzzle. This was b/c the data set was two small, and did not take into account what is called "edge cases", like determining if the hand is a full house.

Message has been deleted

Nivethan T

unread,
Dec 8, 2023, 1:59:10 AM12/8/23
to Pick and MultiValue Databases
I had a busy Thursday and so missed AOC 7 but! I did finish up 8 now.

Part 1 is straightforward but I cheated for Part 2 and got hints from reddit. I was able to solve it but I'm not convinced why the logic results in being able to solve the puzzle. It feels like there should be more.

I'll need to watch a video or something to see why the logic works.


Hopefully I'll be able to get some time over the weekend to catch up on  AOC 7.

Nivethan T

unread,
Dec 9, 2023, 2:45:59 AM12/9/23
to Pick and MultiValue Databases
Day 9 is a fun one.


The further I get from Day7  the more daunting it feels.

I swear there is a function that will generate a dynamic array of strings but I can seem to find it.

XS("0",3) would generate 0b0b0 (3 0s with attribute marks)

Nivethan T

unread,
Dec 10, 2023, 3:23:52 AM12/10/23
to Pick and MultiValue Databases
Day 7 might be my favorite day so far.

I'm pretty happy with my solution of simplifying the part 1 answer and then the part 2 answer falls out nicely. I think this could be cleaned up some more. I also ran headfirst into a mess because I was sorting the hands into real poker hands instead of breaking the ties in the order the hands started in.

Nivethan T

unread,
Dec 12, 2023, 12:39:36 AM12/12/23
to Pick and MultiValue Databases
Day 10 was a tough on that involved mapping. This is probably my least favourite day so far as it ate up quite a bit of my time.


Day 11 was all about shortest paths and this was a fun one to work out. I didn't math it out until part 2 but I'm pretty happy with how simple it got. I'm sure there's a trick that would blow this thing wide open.

Optimus01010101

unread,
Dec 15, 2023, 6:40:51 PM12/15/23
to Pick and MultiValue Databases
It's been a couple of days, so I just went ahead and went with today's puzzle.

I'm wondering if those who put it together, were thinking about PICK. I got done in under an hour.

Nivethan T

unread,
Dec 16, 2023, 4:07:15 PM12/16/23
to Pick and MultiValue Databases
Good to see you!

It's the busy season so I'll stick to the easier puzzles.

Day 14


Day 15 was a quick one


it looks like we hit the same pattern.

Nivethan T

unread,
Dec 18, 2023, 1:42:51 PM12/18/23
to Pick and MultiValue Databases
Day 16


I actually let the loop go forever and waited until the answer stabilized. I didn't figure out how to exit once the answer was found lool.

Nivethan T

unread,
Dec 20, 2023, 8:08:18 AM12/20/23
to Pick and MultiValue Databases
Day 19 Part 1


A bit of a mess, I wrote this without planning anything through.
Reply all
Reply to author
Forward
0 new messages