Acme::Hospital::Bed - The great new Acme::Hospital::Bed!
Version 0.04
Quick summary of what the module does.
Perhaps a little code snippet.
use Acme::Hospital::Bed; Acme::Hospital::Bed->start; ... Acme::Hospital::Bed->new( total_num_of_beds => 30, lifes => 5, names => [qw/tom richard joy/], phrases => [ [ "Hello, I am fine.", "I still have my mind after episode 1.", ], [ "Hello, I am still fine.", "I still have my mind after episode 2." ], [ "Hello, I am also fine.", "I still have my mind after episode 3." ], [ "Hello, I think I'm still fine.", "I still have my mind after watching and travelling through the world wide corruption." ], [ "Hello, I think you think I'm fine.", "I still have my mind after visiting my truest disbelievers." ], [ "Hello, am I still fine.", "I will then make my own judgement?", ], [ "Hello, do you still think I'm fine.", "Good luck?", ], [ "Hello, I don't feel so fine.", "Where is my mind?", ], [ "Hello, This is not fine.", "Where is my mind?", ], [ "Are you being dishonest?", ] ] )->start;
Acme::Hospital::Bed is a simple command line Q/A game.
The basic gameplay is the following:
A patient is generated with a random 'illness' level of 1 to 10 and a phrase that is associated to this level.
The player then decides y(yes) or n(no) to check the patient into a hospital bed.
If they guess correctly then the patient will be allocated a bed for the specified time, else the player will lose a life.
A correct guess is when the player decides yes and the patients level is greater than 5.
An incorrect guess is when the player decides yes and the patients level is lower than 5 or when the player decides no and the patients level is greater than 5.
During each turn, all rooms are deducted 1 nights stay. If a room reaches 0 then the patient is checked out and that room becomes available again.
To instantiate a new Acme::Hospital::Bed object.
Acme::Hospital::Bed->new( total_num_of_beds => 30, lifes => 5, names => [qw/tom richard harry/], phrases => [ [ 'Level 1 phrase' ], [...], [...], [...], [...], [...], [...], [...], [...], [ 'Level 10 phrase' ] ] )
Configure the total number of beds needed to win the game. The default is 20.
Configure the total number of lifes the player is allowed. The default is 3.
Configure the list of names used to generate patients. This is expected as an ArrayRef.
Configure the list of phrases for each 'health' level. This is expected as an ArrayRefs of ArraysRefs(aoa);
This method can be used to Start the game. You can either call this directly or after new.
Acme::Hospital::Bed->start; Acme::Hospital::Bed->new(%options)->start;
This method can also be used to start the game. If passed a true param it will return after the first itteration else it will loop untill the game is finished.
Acme::Hospital::Bed->new(%options)->next_patient(); ... Acme::Hospital::Bed->new(%options)->next_patient(1);
This method will return the number of available rooms left for the current game.
$ahb->available_rooms;
This method will itterate the current rooms arrayref, deducting the length of stay by 1 day and will remove (check out) any patients that have reached 0.
$ahb->check_patients_out
LNATION, <email at lnation.org>
<email at lnation.org>
Please report any bugs or feature requests to bug-acme-hospital-bed at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-Hospital-Bed. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-acme-hospital-bed at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Acme::Hospital::Bed
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Acme-Hospital-Bed
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Acme-Hospital-Bed
CPAN Ratings
https://cpanratings.perl.org/d/Acme-Hospital-Bed
Search CPAN
https://metacpan.org/release/Acme-Hospital-Bed
This software is Copyright (c) 2020 by LNATION.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Acme::Hospital::Bed, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::Hospital::Bed
CPAN shell
perl -MCPAN -e shell install Acme::Hospital::Bed
For more information on module installation, please visit the detailed CPAN module installation guide.