A magazine where the digital world meets the real world.
On the web
- Home
- Browse by date
- Browse by topic
- Enter the maze
- Follow our blog
- Follow us on Twitter
- Resources for teachers
- Subscribe
In print
What is cs4fn?
- About us
- Contact us
- Partners
- Privacy and cookies
- Copyright and contributions
- Links to other fun sites
- Complete our questionnaire, give us feedback
Search:
Texting Marakech: The Secret
The way to win at texting Marakech is to draw out a magic square from the numbers 0 to 9 so that all the rows, columns and diagonals add up to 15 (see below). Each time you make a move, you put a cross over the number you texted. Put an O over the numbers texted by your opponent. Because the square uses all the numbers from 1 to 9 and all the rows, columns and diagonals add up to 15, each line corresponds to a winning triple of numbers in the game. Spotted it yet - unlike your opponent, you are now just playing noughts and crosses...and that needs no maths at all!
Lets go through that game again:
So while your opponent is juggling numbers, you secretly play noughts and crosses. This is a common trick of computer science - work out a solution to one basic problem (here noughts and crosses) and then find ways to convert other similar problems (like the Marrakech game) into it. That way you reduce the amount of work you have to do...and if you are an entrepreneur too, out to make yourself rich, then you can sell essentially the same program repackaged to different people as apparently different products. Write a program that plays Noughts and Crosses and the repackaged core program can also be sold as a Marrakech playing program too. The only extra work is to write a new user interface, not the AI game itself.