Enter the maze

A little bit of cs4fn

On the web

What is cs4fn?

Search:

Games and Puzzles: The Swap Puzzle

This puzzle is quite easy to do if you don't mind how many steps you take. A harder challenge is to do it in as few steps as possible. If you have really solved a puzzle though you should be able to do it again any time you like. You should know how you did it, not just stumbled over a solution.

If each time you make a move in a puzzle like this you write down what you did, then anyone can later follow your steps to solve it to. They don't have to be clever like you though. All the have to be able to do is follow instructions.

Computer Scientist's call instructions that get a job done like this an 'Algorithm'. Computers can only do things by following instructions written for them. A computer program is just a series of instructions written by a programmer that if followed gets a job done. It is an algorithm.

Writing a computer program is like solving puzzles. People who like this kind of puzzle make good programmers.

In this puzzle you must swap the positions of the red and black pieces.

They slide one space forward or backwards if the square is empty.

They can jump a single piece into a space beyond.

To 'solve' the puzzle you must write down the steps to follow to do it in as few moves as possible.


Your browser is ignoring the <APPLET> tag!