File Exchange

image thumbnail


version (9.1 MB) by Joren Heit
Emulation of the map-building game Carcassonne, including 4 expansion packs


Updated 20 Apr 2012

View License

1) Download figstate.p:
2) Unzip and add figstate.p to the carcassonne/bin folder:
3) run!
>> carcassonne

This game contains the following packages:
I. Carcassonne (Basic set)
II. The River (Mini Expansion)
III. King & Scout (Mini Expansion)
IV. Inns & Cathedrals (Full Expansion)
V. Traders & Builders (Full Expansion)

There is an extensive manual to the game included in the "rules" folder by Matthew Harper. Also, I included a brief description of the rules in the carcassonne.m help.
a) help carcassonne
b) doc carcassonne
c) Main Menu -> About -> Help (F1)

Cite As

Joren Heit (2020). Carcassonne (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (10)

Inspiring. Thank you for your work - seeing new game submissions on the MATLAB exchange is very exciting when they are so well polished and thorough.

Joren Heit

@Pete & Sven: Your hints and tips have been incorporated in the game:
- flexible score system (lines 142-147)
- Undo-option instead of 1st confirmation dialog
- better scoreboard resizing
- clean exit (with confirmation dialog) out of the game

Thanks for your feedback!

Joren Heit

@Pete: For as far as I know (and according to my instruction manual of the original boardgame) a completed city doubles the points. Each tile of a completed city is thus rewarded with 2 points (4 if it has a shield). When the game finishes, the uncompleted cities are worth 1 point per tile.

I'm not (yet) considering adding extensions. Not only have I never played any extensions myself, but it's just a LOT of work to modify the game by adding new gameplay. Might be something for the future though.

Anyway, thanks for your reaction! Appreciate it!

Joren Heit

@Sven Meister: I'll see what I can do! Thanks for the tips and I'm glad you liked it :-)


First thanks for this game. I like board-games so I'm pleased to see one implemented in MatLab. What about copyrights??

About the game in my instruction it says that a town (city) made from 2blocks counts as 2 points not 4=2*2 points. Unless it was changed in some extensions it would be good to play by the rules from basic game.
Do you think about adding extensions ??

Sven Meister

Great job! Very nice game.

Some hints, you maybe could change:
- an undo-function instead of the confirmation-click after each move would be even better for gameplay (I know, very hard to implement..)
- what about a abort function to close the game while playing without errors?
- the resize behavior of the score board isn't that nice.. mayby you could fix it, so the aspect ratio stays the same even if the main figure is scaled to a smaller part of the Desktop

Joren Heit

Actually, that is what I did in my first submission. This was not allowed by Mathworks since they are p-files... What I could do is add the associated m-files to this submission and link directly to both p-files. Annoying.... :-P
Anyway, thanks for your comment!

I think this game is even better than your RISK game.I can't tell if there is any bug in the code since I don't know much about the rules of this game. However, based on what I see, the graphics and the interface is just amazing.

The only annoying part is that it is contingent on the maxfig+figstate functions which can only be downloaded from somewhere else. Is it possible to corporate them into your own zip file?


added King&Scout, Traders&Builders, new looks, various bugfixes

Added "The River" expansion, Game-Settings menu, removes maxfig-dependence, new layout

Dropbox produced a conflicted copy of 'main.m'. The old (incompatible) 'main.m' is now deleted. You can do this yourself: rename the conflicted copy.

Major update! Added expansion-pack (which required major changes in the algorithms) and Free-Mode.

updated randstream for future releases, easy modification of the point-values (see description), minor bugfixes + modifications

Better resizing-behaviour of the scoreboard, clean exits (replay option), added undo-button

minor bugfixes, updated description

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