Acme-HidamariSketch

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

     # You can see the character information.
     my @characters = $hidamari->characters;

     # You can build a Hidamari-apartment.
     my $apartment = $hidamari->apartment;

     # You can knock on the room.
     my $yuno = $apartment->knock(201);

     # You can change the year.
     $hidamari->year('second');
     $apartment = $hidamari->apartment;

     # You also meet Sae and Hiro.
     my $hiro = $apartment->knock(101);
     my $sae  = $apartment->knock(102);

# DESCRIPTION

Hidamari Sketch is a Japanese manga that are loved by many people.

README.md  view on Meta::CPAN

    my @characters = $hidamari->characters;

## apartment

    my $apartment = $hidamari->apartment;

    my $yuno = $apartment->knock(201);

## year

    my $year = $hidamari->year('second');

# SEE ALSO

- Hidamari Sketch (Wikipedia - ja)

    http://ja.wikipedia.org/wiki/%E3%81%B2%E3%81%A0%E3%81%BE%E3%82%8A%E3%82%B9%E3%82%B1%E3%83%83%E3%83%81

- Hidamari Sketch (Wikipedia - en)

    http://en.wikipedia.org/wiki/Hidamari\_Sketch

eg/apartment.pl  view on Meta::CPAN

printf $apartment->knock(202)->{name_ja} . "\n";
printf $apartment->knock(203)->{name_ja} . "\n";
printf $apartment->knock(101)->{name_ja} . "\n";
printf $apartment->knock(103)->{name_ja} . "\n";

# 存在しない部屋はノックできないよ?
# $apartment->knock(104);

# 沙英さんとヒロさんがいない?
# なら時間を戻しましょう
$hidamari->year('second');
$apartment = $hidamari->apartment;

# これで沙英さんとヒロさんにも会えます
printf "\n[ 2å¹´ç›® ]\n";
printf $apartment->knock(201)->{name_ja} . "\n";
printf $apartment->knock(202)->{name_ja} . "\n";
printf $apartment->knock(203)->{name_ja} . "\n";
printf $apartment->knock(101)->{name_ja} . "\n";
printf $apartment->knock(102)->{name_ja} . "\n";
printf $apartment->knock(103)->{name_ja} . "\n";

eg/characters.pl  view on Meta::CPAN

    my $name     = $character->{name_ja}  ? $character->{name_ja}  : "undef";
    my $birthday = $character->{birthday} ? $character->{birthday} : "undef";
    my $sign     = $character->{sign}     ? $character->{sign}     : "undef";
    my $color    = $character->{color}    ? $character->{color}    : "undef";
    printf "name:        " . $name     . "\n";
    printf "birthday:    " . $birthday . "\n";
    printf "sign:        " . $sign     . "\n";
    printf "color:       " . $color    . "\n";
    printf "room_number:\n{\n";
    my $room_number = $character->{room_number};
    for my $year (qw/before first second third/) {
        if (defined $room_number->{$year}) {
            printf '  ' . $year . ': ' . $room_number->{$year} . "\n";
        }
        else {
            printf '  ' . $year . ": undef\n";
        };
    }
    printf "}\n";
}

lib/Acme/HidamariSketch.pm  view on Meta::CPAN

    Nori
    Nazuna
    Matsuri
    Riri
    Misato
);

my %year = (
    before => 0,   # 前年  (ゆの入学前)
    first  => 1,   # 1年目 (ゆの入学)
    second => 2,   # 2å¹´ç›®
    third  => 3,   # 3年目 (現在)
);

my $SINGLETON;


sub new {
    if ($SINGLETON) {
        return $SINGLETON;
    }

lib/Acme/HidamariSketch.pm  view on Meta::CPAN

    # You can see the character information.
    my @characters = $hidamari->characters;

    # You can build a Hidamari-apartment.
    my $apartment = $hidamari->apartment;

    # You can knock on the room.
    my $yuno = $apartment->knock(201);

    # You can change the year.
    $hidamari->year('second');
    $apartment = $hidamari->apartment;

    # You also meet Sae and Hiro.
    my $hiro = $apartment->knock(101);
    my $sae  = $apartment->knock(102);

=head1 DESCRIPTION

Hidamari Sketch is a Japanese manga that are loved by many people.

lib/Acme/HidamariSketch.pm  view on Meta::CPAN

    my @characters = $hidamari->characters;

=head2 apartment

    my $apartment = $hidamari->apartment;

    my $yuno = $apartment->knock(201);

=head2 year

    my $year = $hidamari->year('second');

=head1 SEE ALSO

=over 4

=item Hidamari Sketch (Wikipedia - ja)

http://ja.wikipedia.org/wiki/%E3%81%B2%E3%81%A0%E3%81%BE%E3%82%8A%E3%82%B9%E3%82%B1%E3%83%83%E3%83%81

=item Hidamari Sketch (Wikipedia - en)

lib/Acme/HidamariSketch/Hiro.pm  view on Meta::CPAN

our $VERSION = '0.05';


sub info {
    return (
        name_ja     => 'ヒロ',
        name_en     => 'hiro',
        nickname    => 'ヒロ',
        birthday    => '6/15',
        voice_by    => '後藤 邑子',
        room_number => {before => 203, first => 101, second => 101, third => undef},
        sign        => '双子座',
        color       => '#FFC0CB',    # ピンク
        course      => '美術科',
    );
}

1;

lib/Acme/HidamariSketch/Matsuri.pm  view on Meta::CPAN

our $VERSION = '0.05';


sub info {
    return ( 
        name_ja     => '茉里',
        name_en     => 'matsuri',
        nickname    => undef,
        birthday    => undef,
        voice_by    => undef,
        room_number => {before => undef, first => undef, second => undef, third => 101},
        sign        => undef,
        color       => undef,
        course      => '美術科',
    );
}

1;

lib/Acme/HidamariSketch/Misato.pm  view on Meta::CPAN

our $VERSION = '0.05';


sub info {
    return (
        name_ja     => 'みさと',
        name_en     => 'misato',
        nickname    => undef,
        birthday    => undef,
        voice_by    => '小清水 亜美',
        room_number => {before => 201, first => undef, second => undef, third => undef},
        sign        => undef,
        color       => undef,
        course      => '美術科',
    );
}

1;

lib/Acme/HidamariSketch/Miyako.pm  view on Meta::CPAN

our $VERSION = '0.05';


sub info {
    return (
        name_ja     => '宮子',
        name_en     => 'miyako',
        nickname    => '宮ちゃん',
        birthday    => '10/10',
        voice_by    => '水橋 かおり',
        room_number => {before => undef, first => 202, second => 202, third => 202},
        sign        => '天秤座',
        color       => '#FFFF00',   # イエロー
        course      => '美術科',
    );
}

1;

lib/Acme/HidamariSketch/Nazuna.pm  view on Meta::CPAN

our $VERSION = '0.05';


sub info {
    return (
        name_ja     => 'なずな',
        name_en     => 'nazuna',
        nickname    => 'なずな殿',
        birthday    => '1/7',
        voice_by    => '小見川 千明',
        room_number => {before => undef, first => undef, second => 203, third => 203},
        sign        => '山羊座',
        color       => '#F5F5F5',    # ホワイト
        course      => '普通科',
    );
}

1;

lib/Acme/HidamariSketch/Nori.pm  view on Meta::CPAN

our $VERSION = '0.05';


sub info {
    return (
        name_ja     => '乃莉',
        name_en     => 'nori',
        nickname    => qw/のりっぺ ノリスケ ノリコさん/,
        birthday    => '2/6',
        voice_by    => '原田 ひとみ',
        room_number => {before => undef, first => undef, second => 103, third => 103},
        sign        => '水瓶座',
        color       => '#89CEEB',   # ブルー
        course      => '美術科',
    );
}

1;

lib/Acme/HidamariSketch/Riri.pm  view on Meta::CPAN

our $VERSION = '0.05';


sub info {
    return (
        name_ja     => 'リリ',
        name_en     => 'riri',
        nickname    => undef,
        birthday    => undef,
        voice_by    => '白石 涼子',
        room_number => {before => 101, first => undef, second => undef, third => undef},
        sign        => undef,
        color       => undef,
        course      => '美術科',
    );
}

1;

lib/Acme/HidamariSketch/Sae.pm  view on Meta::CPAN

our $VERSION = '0.05';


sub info {
    return (
        name_ja     => '沙英',
        name_en     => 'sae',
        nickname    => 'さえ',
        birthday    => '11/3',
        voice_by    => '新谷 良子',
        room_number => {before => 102, first => 102, second => 102, third => undef},
        sign        => '蠍座',
        color       => '#800080',   # パープル
        course      => '美術科',
    );
}

1;

lib/Acme/HidamariSketch/Yuno.pm  view on Meta::CPAN

our $VERSION = '0.05';


sub info {
    return ( 
        name_ja     => 'ゆの',
        name_en     => 'yuno',
        nickname    => 'ゆのっち',
        birthday    => '5/5',
        voice_by    => '阿澄 佳奈',
        room_number => {before => undef, first => 201, second => 201, third => 201},
        sign        => '射手座',
        color       => '#FFA500',   # オレンジ
        course      => '美術科',
    );
}

1;

t/02_characters.t  view on Meta::CPAN

        is $characters[0]->{name_en},     'yuno';
        is $characters[0]->{nickname},    'ゆのっち';
        is $characters[0]->{voice_by},    '阿澄 佳奈';
        is $characters[0]->{birthday},    '5/5';
        is $characters[0]->{sign},        '射手座';
        is $characters[0]->{color},       '#FFA500';
        is_deeply 
            $characters[0]->{room_number}, {
                before => undef,
                first  => 201,
                second => 201,
                third  => 201,
            }
        ;
    };
    
    subtest '宮子' => sub {
        is $characters[1]->{name_ja},     '宮子';
        is $characters[1]->{name_en},     'miyako';
        is $characters[1]->{nickname},    '宮ちゃん';
        is $characters[1]->{voice_by},    '水橋 かおり';
        is $characters[1]->{birthday},    '10/10';
        is $characters[1]->{sign},        '天秤座';
        is $characters[1]->{color},       '#FFFF00';
        is_deeply 
            $characters[1]->{room_number}, {
                before => undef,
                first  => 202,
                second => 202,
                third  => 202,
            }
        ;
    };

    subtest 'ヒロ' => sub {
        is $characters[2]->{name_ja},     'ヒロ';
        is $characters[2]->{name_en},     'hiro';
        is $characters[2]->{nickname},    'ヒロ';
        is $characters[2]->{voice_by},    '後藤 邑子';
        is $characters[2]->{birthday},    '6/15';
        is $characters[2]->{sign},        '双子座';
        is $characters[2]->{color},       '#FFC0CB';
        is_deeply 
            $characters[2]->{room_number}, {
                before => 203, 
                first  => 101,
                second => 101,
                third  => undef,
            }
        ;
    };

    subtest '沙英' => sub {
        is $characters[3]->{name_ja},     '沙英';
        is $characters[3]->{name_en},     'sae';
        is $characters[3]->{nickname},    'さえ';
        is $characters[3]->{voice_by},    '新谷 良子';
        is $characters[3]->{birthday},    '11/3';
        is $characters[3]->{sign},        '蠍座';
        is $characters[3]->{color},       '#800080';
        is_deeply 
            $characters[3]->{room_number}, {
                before => 102, 
                first  => 102,
                second => 102,
                third  => undef,
            }
        ;
    };

    subtest '乃莉' => sub {
        is $characters[4]->{name_ja},        '乃莉';
        is $characters[4]->{name_en},        'nori';
        eq_array $characters[4]->{nickname},  qw/のりっぺ ノリスケ ノリコさん/;
        is $characters[4]->{voice_by},       '原田 ひとみ';
        is $characters[4]->{birthday},       '2/6';
        is $characters[4]->{sign},           '水瓶座';
        is $characters[4]->{color},          '#89CEEB';
        is_deeply 
            $characters[4]->{room_number}, {
                before => undef, 
                first  => undef,
                second => 103,
                third  => 103,
            }
        ;
    };

    subtest 'なずな' => sub {
        is $characters[5]->{name_ja},     'なずな';
        is $characters[5]->{name_en},     'nazuna';
        is $characters[5]->{nickname},    'なずな殿';
        is $characters[5]->{voice_by},    '小見川 千明';
        is $characters[5]->{birthday},    '1/7';
        is $characters[5]->{sign},        '山羊座';
        is $characters[5]->{color},       '#F5F5F5';
        is_deeply 
            $characters[5]->{room_number}, {
                before => undef, 
                first  => undef, 
                second => 203,
                third  => 203,
            }
        ;
    };

    subtest '茉里' => sub {
        is $characters[6]->{name_ja},     '茉里';
        is $characters[6]->{name_en},     'matsuri';
        is $characters[6]->{nickname},    undef;
        is $characters[6]->{voice_by},    undef;
        is $characters[6]->{birthday},    undef;
        is $characters[6]->{sign},        undef;
        is $characters[6]->{color},       undef;
        is_deeply 
            $characters[6]->{room_number}, {
                before => undef,
                first  => undef,
                second => undef, 
                third  => 101,
            }
        ;
    };

    subtest 'リリ' => sub {
        is $characters[7]->{name_ja},     'リリ';
        is $characters[7]->{name_en},     'riri';
        is $characters[7]->{nickname},    undef;
        is $characters[7]->{voice_by},    '白石 涼子';
        is $characters[7]->{birthday},    undef;
        is $characters[7]->{sign},        undef;
        is $characters[7]->{color},       undef;
        is_deeply 
            $characters[7]->{room_number}, {
                before => 101,
                first  => undef,
                second => undef, 
                third  => undef,
            }
        ;
    };

    subtest 'みさと' => sub {
        is $characters[8]->{name_ja},     'みさと';
        is $characters[8]->{name_en},     'misato';
        is $characters[8]->{nickname},    undef;
        is $characters[8]->{voice_by},    '小清水 亜美';
        is $characters[8]->{birthday},    undef;
        is $characters[8]->{sign},        undef;
        is $characters[8]->{color},       undef;
        is_deeply 
            $characters[8]->{room_number}, {
                before => 201,
                first  => undef,
                second => undef, 
                third  => undef,
            }
        ;
    };
};


done_testing;

t/04_year.t  view on Meta::CPAN


    # 沙英さんもヒロさんも卒業しちゃってる...
    is $apartment->knock(201)->{name_ja}, 'ゆの';
    is $apartment->knock(202)->{name_ja}, '宮子';
    is $apartment->knock(203)->{name_ja}, 'なずな';
    is $apartment->knock(101)->{name_ja}, '茉里';
    is $apartment->knock(103)->{name_ja}, '乃莉';


    # そんな時は2年目に戻してやると...
    $hidamari->year('second');
    $apartment = $hidamari->apartment;

    # 沙英さん、ヒロさんが帰ってくる!!
    is $apartment->knock(201)->{name_ja}, 'ゆの';
    is $apartment->knock(202)->{name_ja}, '宮子';
    is $apartment->knock(203)->{name_ja}, 'なずな';
    is $apartment->knock(101)->{name_ja}, 'ヒロ';
    is $apartment->knock(102)->{name_ja}, '沙英';
    is $apartment->knock(103)->{name_ja}, '乃莉';



( run in 3.988 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )