#!/usr/bin/env perl
use strict;
use warnings;

use Game::Theory::TwoPersonMatrix;

my $n = shift || 100;

my $g = Game::Theory::TwoPersonMatrix->new(
    1 => { 1 => '0.5', 2 => '0.5' },
    2 => { 1 => '0.5', 2 => '0.5' },
    payoff1 => [ [3, 0], [5, 1] ],
    payoff2 => [ [3, 5], [0, 1] ],
);

my ( $player, $opponent );

for my $i ( 1 .. $n )
{
    my $p = [ values %{ $g->play() } ]->[0];
    $player   += $p->[0];
    $opponent += $p->[1];
}

print "Player = $player, Opponent = $opponent\n";
