View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.5 | 2 ratings Rate this file 36 Downloads (last 30 days) File Size: 177 KB File ID: #34438 Version: 1.2
image thumbnail



Joren Heit (view profile)


03 Jan 2012 (Updated )

This is a digitalized version of the famous RISK board game.

| Watch this File

File Information

>> playrisk

This version of RISK incorporates (for as far as I am aware) all rules of the original boardgame. The (standard) map consists of 42 different territories which can be conquered or lost by throwing the dice. A total of 6 players can play the game, each having their own secret mission.

A short guide:

Each turn follows these steps:

- Reinforce your armies with extra troops, earned by either turning in a set of cards, or by having captured an entire continent.

- Attack OR Reinforce. Again, you may send additional troops into battle, but this will terminate your turn. If you choose to attack, you may capture new territories and add new cards to your inventory (accessed by right-clicking your scoreboard).

- Fortify your positions. When you have finished attacking or reinforcing, you may fortify your positions by moving troops from one territory to another. However, they can only travel across friendly terrain.

The game is over when one of the players completes his/her mission. This mission is revealed to each player at the start of the game and may be recalled by left-clicking the scoreboard.

To design this game, I first had to write a couple of simpler programs that allowed me to design the map. These are called designboard(), connect() and lines(). If you wish to design your own board (either more detailed or completely different), these functions may be used to help you.

Most of the M-files broken down into cells having titles to clarify their purpose. I hope that the code is somewhat readable this way.

Some notes:
I haven't thoroughly tested the game yet, since I haven't had the opportunity to play it seriously with more than 2 people. If you may find any errors/bugs, please inform me! Moreover, this was the first time for me to create a GUI from scratch without using Guide, any suggestions on improving the code are of course welcome!


Required Products Image Processing Toolbox
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
21 Apr 2016 mike smith

I really want to play this game with friends in my Matlab class but I don't know how to begin the game. Which/what file should I run to play the game?

Comment only
07 Mar 2016 Charlie Keyzor

Great game!
However i encountered a problem when playing multiplayer; when a player is defeated from the whole board the program continues to force the defeated player to place troops on there go despite the fact there is nowhere to place them, leading to an end of the game even though the other players haven't finished

Comment only
04 Apr 2012 Joren Heit

Joren Heit (view profile)

Nope :-) be my guest!

Comment only
02 Apr 2012 Zachary Danziger

Fun game - Risk is a classic and I always enjoy seeing remakes. Any plans to implement an AI?

Comment only
23 Mar 2012 Majid Al-Sirafi

wonderful work

Comment only
27 Jan 2012 Pradeep Joshi

Nice Work. Keep It Up.

05 Jan 2012 Joren Heit

Joren Heit (view profile)

Wow thanks! You have no idea how great it feels to get such a positive comment after having put this much effort into it :-)

Comment only
05 Jan 2012 Mingjing Zhang

Mingjing Zhang (view profile)

Great gaming experience plus well documented and organized code. The best GUI-based board game I have ever seen on this site. You should definitely make more masterpieces like this one!

04 Jan 2012 1.1

Updated description + required products (image processing toolbox)

04 Jan 2012 1.2

Fixed some bugs

Contact us