Slidding puzzle in Ocaml


#1

Hello everyone,

In order to familiarize myself with the Ocaml language for the pursuit of my studies, I set myself the goal of creating a sliding puzzle that will be in Ocaml.
Why sliding puzzle ? I fell back on old subjects from my university and one of them was:

"Make random moves on a sliding puzzle, then solve it by
program (and without cheating). Up to what size of sliding puzzle can you go before that your program is getting too slow?
http://maths.amatheurs.fr/index.php?page=taquin

Note: The Ocaml graphics.cma library is more than enough. "

The problem :
I do not see how to start or how to implement this, so I ask for your help.

Thank you in advance.


#2

The excellent book by Cousineau and Mauny covers this very problem in its “red donkey” variant, if I recall correctly. This book is IMHO one of the must-reads for OCaml (it was initially written for its Caml Light ancestor but little has changed when it comes to learning functional style basic data structuring and programming).


#3

For the Taquin puzzle here is a link:

http://pauillac.inria.fr/~quercia/cdrom/cours/index.html

(written in Caml-light…)


#4

The repository containing the programs that are used in the (Cousineau and Mauny) book is here now:

HINT: For people struggling with the Project 1 of the MOOC:

https://www.fun-mooc.fr/courses/course-v1:parisdiderot+56002+session03/courseware/Project/ProjectOption_1/

L’Ane Rouge (The Red Donkey) is an another name for Klotski.


#5

Thanks a lot, I’ll watch this all during the next week, I have a lot of work this week-end :hugs: