entry for one of 'Doug’s MATLAB Video Tutorials' puzzles

submission for a MATLAB puzzle based on LabPixies' flood game

You are now following this Submission

For the puzzle, see here: http://blogs.mathworks.com/videos/2009/07/28/puzzler-rules-of-the-new-game/

I have chosen for a flexible setup, the basic principle is this:

1. generate all possible boards for a number ('lookAheadMoves') of moves ahead.
2. use some criteria ('rankBoardMethod') to rank all possible outcomes
3. adjust the board with a number ('maxNewMoves') of the moves that lead to the highest ranked outcome
4. continue 1 to 3 until board is solved or maximum moves is reached

you can play around with the number of alternative boards created, and with the ranking method. If the number of alternative boards is very high, the algorithm is guaranteed to find the optimal solution. With a large number of colours (options) and a large board this becomes computationally infeasible.

see comments for examples

Cite As

T (2026). entry for one of 'Doug’s MATLAB Video Tutorials' puzzles (https://www.mathworks.com/matlabcentral/fileexchange/24932-entry-for-one-of-doug-s-matlab-video-tutorials-puzzles), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Strategy & Logic in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0