image thumbnail

The Take Away Game

version (10.9 KB) by Chris Riederer
Players take turns taking as many marbles as they want from 3 piles. The player who gets the last m


Updated 01 Aug 2005

No License

There are three piles of marbles. You take against the computer. You may take away as many marbles as you want from one pile each turn. Whoever gets the last marble wins. The rules are very simple, but there are many interesting underlying mathematical patterns. See if you can figure these out and try to win a game or two.

Cite As

Chris Riederer (2022). The Take Away Game (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R13SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!