News

Days 09, 10, 11, 12 and Tomorrow's Lecture; Reminder on Repos

Written on 12.12.2022 13:38 by Sven Rahmann

Good day everyone,

today is roughly half-time, and the problems get more complex and take longer to work on.

For day 09 (Friday), you may, of course, adapt the Point class shown in the lecture. You can adapt it to 2D (only x and y), and will need to implement subtraction (.__sub__(self, other) method). Being able to compute the maximum norm of a point is also helpful, max(abs(x), abs(y)). For part 2, you should implement part 1 in a way, such that you can just use a loop over different head-tail combinations. Consider re-writing part 1 if part 2 seems hard to do with your part 1 implementation.

Day 10 (Saturday) is straightforward in principle. However, you have to be careful to get the timing right. Note the careful wording of the problem: "during" a time step vs. "after" a time step. You may want to process the input file twice (separately for part 1 and part 2), because the two parts are doing quite different things. For part 2, you must actually print the screen contents of your 6 x 40 display and read off the letters by yourself; it makes no sense to do this programatically.

Day 11 (Sunday), part 1, is mainly a parsing challenge: You must correctly parse the information for each monkey from the text file. In principle, it can call be done with the split function. Remember that, for example line.split(":") splits at colons, while by default, just split() splits at whitespace. Otherwise, as always, it is recommended to verify that the example works with your code, as shown on the problem website.

Part 2, on the other hand, presents a completely new challenge. While Python supports arbitrary-size integers, the numbers will get so big that the computation will be extremely slow and not finish before the deadline (and/or exhaust all of your memory). However, it is not necessary to store the *exact* worry levels to get the correct test results for every monkey!

Day 12 (today, Monday) is a classical shortest-paths problem, which you can find in algorithms textbooks or on the internet. The first step is to build a directed graph from the input, G=(V,E) with a node set V and an edge set E. Edges connect nodes that can be reached from each other. Graphs will be covered in tomorrow's lecture, so it may help to wait until tomorrow after the lecture to get some basics.

IMPORTANT: We still have many repositories on gitlab that did not edit their README file according to the instructions. Remember:

  1. You must FORK Vu Lam's template repository (NOT request access to it)
  2. You must then edit the README according to instructions (here in the news). Use the EXACT provided format.
  3. You must be registered in the CMS here (you are if you are receiving news emails) AND your matriculation number in the CMS must match the number in the README.
  4. You must be registered on the course's private leaderboard in AoC.

If and only if ALL of these steps are followed, we can track your progress automatically.

 

Privacy Policy | Legal Notice
If you encounter technical problems, please contact the administrators.