Skip to Content
Personal Insights
Author's profile photo Jörgen Lindqvist

Preparing for Advent of Code 2023

This year, I once again intend to join the fun of solving programming puzzles in the Advent of Code event, using ABAP.

                                           |
                                          \|/
                                         --*--
                                          >o<
                                         >O<<<
                                        >>o>>*<
                                       >o<<<o<<<
                                      >>@>*<<O<<<
                                     >o>>@>>>o>o<<
                                    >*>>*<o<@<o<<<<
                                   >o>o<<<O<*>>*>>O<
                                      _ __| |__ _

 

Since 2015, the Advent of Code has been an annual advent calendar consisting of programming puzzles and challenges and runs from December 1st to 25th each year. While some puzzles may be more challenging than others, anyone with basic programming knowledge and some problem-solving skills can participate. It’s great fun and a way to get a short break from reality!

In 2020, I solved the puzzles in ABAP, albeit the hard way, using VSCode and transpiling ABAP into JavaScript. This year, things will be easier as I plan to use just the ‘ABAP Developer Edition 1909 docker’.

abap2UI5

To assist me in keeping track of the inputs, results and overall progress, I decided to give abap2UI5 a go and made myself a frontend app:

UI5%20frontend%20for%20the%20advent%20calendar%20and%20solution

UI5 frontend for the advent calendar and solution

abap2UI5 offers an interesting approach to UI5, and a super easy install using abapGit. Having a background in UI5 development is a great help when getting started, to have an understanding of the different controls and their parameters. I haven’t spent too much time on abap2UI5 yet, but I’ve experimented with some different controls, data bindings, and communications with the SAP backend. And especially for simple stuff like this, it’s great! Good stuff! Well done!

Join the Fun!

Anyway, I encourage you to participate in the fun. If you decide to, feel free to use my preparations found in my abap-advent-2023-template repo on GitHub. It includes:

  • Pre-prepared “empty” solution classes for each day, including:
    • A method for each expected part
    • An inherited generic ‘solve’ method that splits the input string into a table, calls each part’s solution method, and measures runtime (just for fun)
    • A local test class with test methods for each part
  • A UI5 frontend built in ABAP using abap2UI5, featuring:
    • A randomized tile layout for the days, like the paper advent calendars of old 🙂
    • A puzzle input area
    • Backend solution execution
    • Completion toggling
    • Storage of input data and completion flag
    • (Note: I designed this for single-user use, but expanding it should be relatively straightforward if needed)
    • (And you’ll need to install abap2UI5 to use the frontend)

Sharing Solutions

If you’re planning to share your solutions, I’d love to see them! You can find mine at https://github.com/joltdx/abap-advent-2023 when we get going!

Have fun!

Assigned Tags

      14 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Christian Guenter
      Christian Guenter

      Amazing!

      Author's profile photo Jörgen Lindqvist
      Jörgen Lindqvist
      Blog Post Author

      Thank you 😊

      Author's profile photo Gregor Wolf
      Gregor Wolf

      Great stuff Jörgen!

      Author's profile photo Jörgen Lindqvist
      Jörgen Lindqvist
      Blog Post Author

      Thank you 😊

      Author's profile photo Oblomov Dev
      Oblomov Dev

      Wow, such a nice use case for abap2UI5! Fantastic idea and great work! 🚀

      Author's profile photo Jörgen Lindqvist
      Jörgen Lindqvist
      Blog Post Author

      Thank you, yes abap2UI5 was perfect for this, to try it out on a "real" use case... 👍

      Author's profile photo Enno Wulff
      Enno Wulff

      Cool 😎💪

      I made a helper report old style: https://github.com/Ennowulff/advent-of-code-cockpit

      Author's profile photo Jörgen Lindqvist
      Jörgen Lindqvist
      Blog Post Author

      That's cool too 😎

      For ABAP solving, it really seems that a big hurdle is to get the input data into the system... 😅

      Author's profile photo Michael Keller
      Michael Keller

      Great! Working with abap2UI5 is my Christmas craft project 😉

      Author's profile photo Jörgen Lindqvist
      Jörgen Lindqvist
      Blog Post Author

      Awesome! 🥳

      Author's profile photo Witalij Rudnicki
      Witalij Rudnicki

      Nice to see that resolution!

      Cc Nabheet Madan , DJ Adams

      FYI: https://blogs.sap.com/tag/aoc2019/

      Good luck this year. I hope to join too (but not with ABAP).

      Author's profile photo Jörgen Lindqvist
      Jörgen Lindqvist
      Blog Post Author

      Thanks! Good luck and have fun! 👍

      Author's profile photo John Astill
      John Astill

      I was waiting for this to start again and completely missed the kickoff, already 2 days behind. In the past I have used shell, c, java. This year I decided to make it CAP services. Had I read this blog earlier I might have taken the ABAP approach too.

       

      Best of luck .... pfsblddnineoneighth ...

      Author's profile photo Jörgen Lindqvist
      Jörgen Lindqvist
      Blog Post Author

      Great, best of luck to you too!

       

      And yes, that oneight thing was a bit sneaky... 😅