Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8093

Teaching and learning resources • Re: Advent of Code 2024

$
0
0


So... Let me get it straight. You are going to train your rpi4 to bark the starting value of A register? :D :P :D

Quip aside. it does look interesting. As for me, I'm an old man, and AI stopped for me with Peter Norvig's PAIP Lisp book.
Much to my surprise the barking is not loud enough. My attempt at a genetic algorithm quickly finds a value for A that is almost self replicating except one entry is off by one. The wrong entry is different each time. Right now I'm using the method which avoids sorting. Maybe setting the threshold equal to the average wasn't such a good idea. I'll try sorting next.
I ran my code one more time before going to bed and by chance the genetic algorithm found a value for A that was exactly self replicating. Now the barking is very loud. Unfortunately, the value was too large to be accepted.

I may have to change the fitness function to select the smallest self-replicating value.
I did not have to worry about that, because the way my reverse engineering algorithm was designed. It starts adding remainders from 0-7 in that order. So the list of matches (1 - 3 possible matches) is processed with the smallest match first. If this smallest match fails, somewhere up the tree, the function will backtrack to the next (bigger) match, and so on. Therefore the result returned is always the smallest starting number.

Statistics: Posted by hrvoje064 — Sat Feb 15, 2025 2:50 am



Viewing all articles
Browse latest Browse all 8093

Trending Articles