Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
joltdx
Active Contributor
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 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!
14 Comments
ChristianGünter
Contributor
Amazing!
gregorw
Active Contributor
Great stuff Jörgen!
oblomov
Active Participant
Wow, such a nice use case for abap2UI5! Fantastic idea and great work! 🚀
ennowulff
Active Contributor
Cool 😎💪

I made a helper report old style: https://github.com/Ennowulff/advent-of-code-cockpit
joltdx
Active Contributor
That's cool too 😎

For ABAP solving, it really seems that a big hurdle is to get the input data into the system... 😅
joltdx
Active Contributor
Thank you, yes abap2UI5 was perfect for this, to try it out on a "real" use case... 👍
joltdx
Active Contributor
0 Kudos
Thank you 😊
joltdx
Active Contributor
0 Kudos
Thank you 😊
Michael_Keller
Active Contributor
Great! Working with abap2UI5 is my Christmas craft project 😉
joltdx
Active Contributor
Awesome! 🥳
Vitaliy-R
Developer Advocate
Developer Advocate
Nice to see that resolution!

Cc nabheetscn , dj.adams

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

Good luck this year. I hope to join too (but not with ABAP).
joltdx
Active Contributor
0 Kudos
Thanks! Good luck and have fun! 👍
johna691
Discoverer
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 ...
joltdx
Active Contributor
0 Kudos
Great, best of luck to you too!

 

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