Advent of Code

I just have to share. I’ve been doing the adventofcode.com and it’s been really fun. The best part is each day, you get gold stars and it tells you, “That’s right!”. Other software just runs, and I always suspect it’s actually wrong.

Anyway, it’s been having me build this neat little “intcode” computer, and today it ran breakout. On the terminal! It was set on impossible, so we also had to program the paddle to be perfect. It was awesome!

Here’s a little gif of what it looked like while running (I’m not using curses, just clearing the screen and printing from scratch, so it sometimes jumps. It’s smoother IRL).

3 Likes

I feel vaguely dirty having used Excel to complete the first puzzle… :slight_smile:

There are two ways to play (at least):

  1. Try to make clean, effortless code that works the first time and impresses companies so that you might get hired in the future.
  2. Do whatever comes to mind, no maintainability, any tools, anything to get the job done. When you’re finished, the gold stars were all you were after anyway.

You can look at a lot of the solutions and tools used in reddit.com/r/adventofcode .They are all over the place. I think that’s really a testament to the quality of the puzzle.

2 Likes

Hey jeff I finished my computer programming degree back in 2003. I had to take like over 20 classes in java, c, c++, visual basic, databases a bunch of that actually. anyways. it was tedious. However, I really learned how to do the background stuff. They were not really teaching graphics. Just the visual and java stuff. Calling up the api or using the windows. I did learn how to incorporate a lot of database stuff. It came in real handy when i was working corrections.

1 Like

I didn’t do much programming in college, but I have done a lot on the job. Mostly C++ in Linux. Then I found Python. It’s really great for these puzzles. The gif I made was just fast output to the terminal with prints. I have made several programs with ncurses, which would have made that really smooth. I’ve also done a bunch of opengl, qt, gtk2, openscenegraph, etc. No way am I going to mess with that if I don’t have to though. This is supposed to be fun!

You know I was thinking I was missing something when I was in school. Thanks I now know I didnt. I am not really interested in making games or 3d games like WOW. I just like to be able to screw around with code when I feel like. Thanks for the link. I will be checking that stuff out for my Brain health. :smiley: In retirement that is :smiley:

At least in my work, which is heavy on physics and algorithms and simulation, there is a need for everyone to know at least some way to visualize what their code is doing. I don’t write GUIs for a living, but my living requires writing GUIs. At the end of the day, a good visualization of your software can be better at gaining support than results. There have been many contracts won with a video of the debugging GUI.

Luckily, they all work about the same. The api is always different, but you always need to worry about the same things.

I first learned to program when I was 13 on a tandy color computer 80 or a TRS 80. It was in basic. In High School in 86 I learned fortran and C inside of a few months. I soaked it up like a sponge. In College after I had several years working with PLC’s in the field as a tech and diag and repairing their unusual problems I started formal college up and learned OOP. Best time of my life in college was the programming track. I had 10 classes in the associates program and another 10 in the bachelors program. :smiley:

1 Like

Hey Jeff is there an outline pdf of the MPCNC Burly? I thought I saw one somewhere. I wanted to get a visual of what it may look like. I’m slicing all the parts at the moment and trying to decide what will be blue vs red. Thanks

I’m not sure what you’re looking for. There is a dxf outline (Ryan drew them at mrrf, so search for mrrf). But what you really want is the parts page. Each row has a color. That’s how Ryan splits up the colors in his prints:

https://www.v1engineering.com/blog/parts/

thanks thats exactly what I was looking for. the outline he had that was on his wall he had in the frame. I also saw it on other things ppl had lazered. Thanks bud. I appreciate the quick feedback. :smiley:

Maybe you were thinking of this?

1 Like

Yes and I have the parts all printed up and labeled on how many is needed. lol. Your nailed it. Those are what I was looking for. Thank y ou. I just printed them and I will add color and try to visualize what I am trying to achieve with the colors. :smiley: You know the type plan plan plan :smiley:

[sarcasm]Thanks for this, @jeffeb3 [/sarcasm]

I learned BASIC on an ATARI 800 back in the 80’s, then FORTRAN and Pascal in college, but I haven’t had access to any programming language (except VBA) for 25 years plus a career and family, so I haven’t done any programming. I purchased a RaspPi a few years ago, but again life and family kept me from really learning any Python, but I got excited when I saw AdventOfCode and thought it would be a great excuse to work through the puzzles and force myself to learn Python in the process.

I completed 2015 day 1 and day 2 pretty easily, but I spent ALL DAY yesterday on day 3 (mostly part 2)…I was 99% correct, but I was encoding the houses poorly so I corrupted my own data scheme.

All this to say, I thought “oh, I’ll just work on this puzzle for a bit,” and boom, the whole day was gone. OMG

[sincerity]I am actually enjoying this and I’m actually learning, which was the point, so Thank you.[/sincerity]
:+1:

That’s great. I had a lot of fun and I used python, which is not my daily language, but it is so enjoyable to me (my daily is C++).

There are some good answers in the subreddit, but it is a pandoras box, and you will see how quickly others handle it.

Processing seems like another good language to try them in.

My language of choice is python. Some C … If I have too. I do a lot of job automation and data sciency stuff. Python is perfect for all this stuff.
I like doing hackerrank, codewarz, and general CTF/hackathons. The company I work for hosts a lot.

I was pretty frustrated on the last puzzle I worked on…I cannot believe that Python doesn’t have the ability to make a simple array (2D table). I wasted a bunch of time investigting NumPy and still couldn’t get what I wanted, so I settled for making a Dictionary.

A 2D list is a list of lists.

1, 2
3, 4
array = [ [1, 2], [3, 4] ]

four = array[1][1]

This can get hairy quickly though. There are lots of ways to make it more manageable, but this is the brute force way of doing that.

I saw several examples like that, but I wanted read & write to the array, and I couldn’t find an example, which made me think I couldn’t

array[1][1]=new value

You can write to lists [], but not tuples (). :man_shrugging: