Intro
This is a programming challenge to @yosoyignicion a Spanish programmer.
Dev.to keeps deleting my comments where I outline the puzzle.
So, I'll post the comment as an article.
If you want to have a good laugh at how bad things are behind the scenes, check out this PR.
The puzzle
There's a really simple funny little puzzle.
This puzzle is about implementing that puzzle.
Think of it like a Puzzle Inception.
Yup.
This is a puzzle...
... to sass you ...
into fixing/refactoring/rewriting an implementation of a literal puzzle game code.
So the story goes...
Once upon a time, there lived a puzzle on Github.
This puzzle was really fun, and was written in Java with SOLID, KISS and YAGNI and all kinds of big notions in mind.
The README of the puzzle explained how there's a:
- Black square, what the player can move either North/East/South/West,
- Black U-shape, which can be moved by the Black square
- Red U-shape, which can be moved by the Black square
- Blue U-shape, which can be moved by the Black square
These U-shapes also interact with eachother, can block eachother, drag eachother.
They can also block the Black square from entering a tile!
All of that information is in the README. This was just a TLDR.
So everything was going fine in the little kingdom...
Until one day...
The French arrived at the border with an ultimatum:
Erm...
Black, Red, Blue U-shapes are hardcoded.
You'll never be able to support arbitrary U-shapes.
I mean... even a configurable in-memory list can't work.
The entire thing is hardcoded.
Now we do not even care if it is Java.
It could be C++ for all we care.
We do not even care about the GUI or the graph search part.
Simply the business logic is so hardcoded that there's no way on Earth to...
... to support arbitrary amount of U-shapes.
You were brave...
But it is time to go home, for you.
We'll let you walk away brave Spaniards, to show you how merciful France is.
Leave this problem, and you can go back to your families, safe and sound.
Can you help me @yosoyignicion ?
I'm not good at Spanish.
Did the Spanish give up and go home?
Or did they take up arms against cyclomatic complexity?
Boring technical summary: Visit repo. Read README. Implement business logic in whatever language you like. Catch is: you have to support arbitrary U-shapes. Each one's open side can face North/East/South/West, and can have a size which is a natural number.
So, the question is, Spanish Jon Snow:
Would you do it, please pretty please?

Top comments (0)