Help language development. Donate to The Perl Foundation
Game::Covid19 - Play the COVID-19 game
use Game::Covid19; play(age => 64); # must specify age play(age => 34, :mask, :distancing); death-rate(age => 64);
Game::Covid19 is an implementation of a DND-type game that is based on CDC data and was posted by Stephen Richard Watson at:
It exports two subroutines:
play(age => 64);
play subroutine will play the game. You need to at least specify the
age named parameter. It will return your final constitution, with
0 indicating death. The following named parameters are optional:
constitution => 80,
A value of 1..100 indicating the state of your constitution, with
100 indicating fully healthy. Defaults to
A Boolean indicating whether or not you're wearing a mask. Defaults to
A Boolean indicating whether or not you're socially distancing. Defaults to
A Boolean indicating whether verbose play output is wanted. Defaults to
death-rate(age => 64);
death-rate sub will run the game many times and record how many times the game resulted in death, and use that to calculate a death-rate as a percentage.
It takes the same named parameters as the
play subroutine. Additional named parameters are:
times => 10000
The number of times the game should be played. Defaults to 10000.
Elizabeth Mattijsen [email protected]
Source can be located at: https://github.com/lizmat/Game-Covid19 . Comments and Pull Requests are welcome.
Copyright 2020, 2021 Elizabeth Mattijsen
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.