[Community Puzzle] FreeCell

Creating this post manually since the bot failed to do it somehow.

https://www.codingame.com/training/hard/freecell

Send your feedback or ask for help here!

Created by @JBM , validated by @ffgth @Konstant and @VivienBillot
If you have any issues, feel free to ping them.

2 Likes

I really like the concept, and the game animation.
I haven’t tried to solve it yet, but sounds interesting!
Well done @JBM

On one hand: this is a lovely puzzle, with extra attention to details, such as debug visuals, so I am happy to see it hitting the puzzle pool.
On the other hand: One month after approval, community success rate is still 0%. I find it highly unlikely, that all 3 approvers forgot to cash in the extra 50 XP. Seems more like you are all caught red-handed here, acting against approval guidelines. Shame on you. If the quest map is so important for you, why not working a bit for it?

2 Likes

Looks like you have missed a crucial point …
Even the contributor didn’t solve it and didn’t get the 50 xp
:upside_down_face:

We were all waiting to approve until the option to disable autoplay was added (JBM agreed to do it at some point), but these guys materialized out of nowhere and approved.

2 Likes

3 options here:

  • disable autoplay and update the contrib (puzzle should get updated from the contrib). As far as I understood, that’s the main issue
  • 19 more players submit default code and rate the puzzle badly. The puzzle will be automatically removed by the bot
  • I delete the puzzle manually in DB and restore the contrib as WIP

What’s the best option according to you all?

1 Like

IMO the best solution would be to add a first turn where the user tells if he wants autoplay or not.
Then the game plays as usual with/without autoplay.

1 Like

This is preposterous.

The puzzle has no (actually reported) issue. The only problem is the moderation, and CG has repeatedly hammered “there is no issue in trusting the community”, so that’s not an issue either.

That it was approved before it reached the final set of features is sad disappoining a fact of life who cares, really, but neither permanent nor an actual issue. I moved it from WIP to Ready when it was ready, and it still is.

It’s got 0 solvers because THIS IS HARD PUZZLE. And this one happens to be a solo game with viewer, where people can’t copy-paste a solution from the contribution page. But, remember, no one would ever do that because we trust the community.

Autoplay is a red herring. You may like it or dislike it, but it doesn’t change jack shit about the problem’s ease of solvability.

I can understand that the people who actually worked at solving it and waited for the autoplay mode selection are angry. But their problem is not autoplay. Their problem is that others beat them to the punch.

3 Likes

For Test Case 5 (Hard Game), why doesn’t this solution work? It sticks at the 7th move (37) where the Ace of Spades doesn’t get autoplayed as expected.

1a 15 87 3b 3c 3d 37 4h 5h 15 16 83 81 b1 73 7b 7h 71 73 71 21 87 5h 53 58 56 51 75 65 68 a7 67 6a 41 46

1 Like

Thank you for reporting an actual bug (seems like only one move of autoplay happens).

Identifying the issue: 5 min.
Solving the bug: 5 min.
Figuring out how assembly generation works to build up a patched zip in the CG game format…


There are some things time can solve. For everything else, there is Apache Maven.


So more precisely, the bug was that a maximum of one round of autoplay was allowed after each move, where a round is the set of autoplay moves that are available from a given position independently of each other. Hindsight-obviously, when the moves are interdependent some are going to miss.

Thank you @Westicles for taking the time to hand-verify the solution database entries. This is now fixed.

1 Like

For the first test case and solution 72 26 72 75 27 7a 57 57 67 1b 3c b1 41 4h 4h 6h 41 3b 6d 56, I get this:

The game has crashed. Please contact the author and enclose the following error:

java.lang.RuntimeException: Internal error: accepting incompatible card on foundation
at re.desast.freecell.Foundation.acceptCard(Foundation.java:24)
at re.desast.freecell.Foundation.acceptCards(Foundation.java:36)
at re.desast.freecell.Move.performPlacement(Move.java:42)
at com.codingame.game.Referee.performAndViewMove(Referee.java:128)
at com.codingame.game.Referee.autoPlay(Referee.java:117)
at com.codingame.game.Referee.gameTurn(Referee.java:37)
at com.codingame.gameengine.core.GameManager.start(GameManager.java:122)
at com.codingame.gameengine.core.RefereeMain.start(RefereeMain.java:67)
at com.codingame.gameengine.core.RefereeMain.main(RefereeMain.java:50)

1 Like

Why is it that people only find the bugs after the puzzle has been moderated? O:-)

Thanks for the report, investigating.

ok then, I’m sorry for the misunderstanding. I thought this autoplay feature made the puzzle impossible to solve.

1 Like

How do you know without having a solution? There’s a “very hard” category too.
I gave it a try (not totally motivated as autoplay would add another task on top of solving the actual puzzle but still a somewhat serious attempt). My A* solver is far beyond the 1s (*) limit even on the easiest testcase.
Can you guarantee that the puzzle is solvable without tweaking for specific testcases?

(*) Try to win before reaching the turn or time limit. isn’t very specific, I just assume 1s for the first turn here.

1 Like

I don’t know much about an algorithmic solution, didn’t try at all, but I remember playing this game a lot 20 years ago and if you want to find a good heuristic, keep in mind that gaining a new empty column is really something worthy, so it must count a lot in your evaluation function.

I managed to solve it without hardcoding and using only the first turn. Nice job JBM, and I think it could be moved to very hard.

2 Likes

Good job!
Can you do it reliably, or did you need a few attempts?

I only pass all three about a third of the time, probably should debug it some more.

Well I haven’t fixed your latest reported bug yet either, so there’s that too.