Code covered by the BSD License  

Highlights from
RISK

image thumbnail

RISK

by

 

03 Jan 2012 (Updated )

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

AddBtn(button, ~, game, patch, Buffer)
function AddBtn(button, ~, game, patch, Buffer)

Nadd = get(button, 'UserData');
new = get(Buffer, 'UserData') - Nadd;

set(Buffer, 'UserData', new)

idx = str2double(get(patch, 'Tag'));
N = get(game.board(idx).Text, 'UserData');
set(game.board(idx).Text, 'String', num2str(N + Nadd), ...
                          'UserData', N + Nadd);
                      
delete(get(button, 'Parent')) %8

Contact us