puzzles you have to solve with programming in this case attempts made with OpenEdge 4GL
Approach I take is primnairly 'Make it work' and a little 'Make it right' see https://javascript.plainenglish.io/broken-window-theory-in-software-development-b239d2bb6b97 (thanks PeterA! )
As I'm solving a puzzle the 'Make it better' does not have my priority but ... ;)
Based on a rule in a project we made: Duplicate code once, duplicate it again but duplicate it for another time then take the effort to centralize and remove the duplication.