#!/usr/bin/perl
# become over-sensitised to women
# ooohhh become over-sensitised to women
use strict;
use warnings;
my ($poptotal, $days, $type) = @ARGV;
$poptotal ||= 1000;
$days ||= 1000;
$type ||= 1;
my $popref = createpop($poptotal, $type);
printfullness($days, $popref);
sub printfullness {
my ($days, $popref) = @_;
for my $day (0..$days-1) {
my $bleedingtotal = 0;
for my $female (@$popref) {
$bleedingtotal++ if isbleeding($female, $day);
}
print "$day $bleedingtotal\n"; }
}
sub createpop {
my ($total, $type) = @_;
my @pop = map {createdata
($type)} 1..$total; }
sub createdata {
my @data;
my @durations = (3, 4, 4, 4, 5, 5, 5, 6);
my $duration = $durations[rand(@durations)]; my @cycles = (25, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 33, 35);
my $cyclelength = $cycles[rand(@cycles)]; push @data, $cyclelength; my $start = rand($cyclelength); my @bleedingdays = map {$_ % $cyclelength} $start..$start + $duration - 1; push @data, $type ? \@bleedingdays : calcbleedingdays
($cyclelength, $start, $duration); }
sub calcbleedingdays {
my ($cyclelength, $start, $duration) = @_;
my @bleedingdays = map {$_ % $cyclelength} $start..$start + $duration - 1; }
sub isbleeding {
my ($self, $clock) = @_;
my $res = 0;
for (@{$self->[1]}) {
if ($_ == $clock % $self->[0]) {
$res = 1;
last;
}
}
}
sub mustbefedwithstick {
}
sub maynevertalktomales {
}