Code covered by the BSD License  

Highlights from
Cribbage Suite

image thumbnail
from Cribbage Suite by Bryan
Cribbage Suite is a GUI interface designed to help teach and play the game of cribbage.

viewRecord.m
%viewRecord.m
%This Callback function is used when the CribbageSuite home-GUI's "View
%Records" button is pressed.
%
%viewRecord opens the current plot of the Head To Head records of the
%players.
%% Create temporary players to look up.
prompt = {'First Player:','Second Player:'};
dlg_title = 'Please enter your names: ';
num_lines = 1;
def = {'Player One','Player Two'};
answer = inputdlg(prompt,dlg_title,num_lines,def);
if size(answer) == 0
    return
end

player1temp = person;
player2temp = person;
set(player1temp,'name',answer{1});
set(player2temp,'name',answer{2});

%% Plot the results using the winnerRecord function.
winnerRecord(0,player1temp,player2temp,player1temp);

Contact us at files@mathworks.com