choice between two RNGs

This commit is contained in:
Al Beano 2016-07-19 14:14:11 +01:00
parent 58e1f66319
commit cd457755cb
4 changed files with 12 additions and 0 deletions

View File

@ -16,6 +16,7 @@ use MarkovBot::Commands;
use MarkovBot::MarkovChain;
use MarkovBot::Redis;
use Encode qw(encode decode);
use if (config("rng") eq "mt"), "Math::Random::MT::Perl" => qw(rand);
sub said {
my $self = shift;

View File

@ -12,6 +12,7 @@ use lib $Bin;
use MarkovBot::Config;
use MarkovBot::Redis;
use Encode qw(decode encode);
use if (config("rng") eq "mt"), "Math::Random::MT::Perl" => qw(rand);
sub markov( $ ) {
# markov - given two starting words, returns a markov chain result

View File

@ -21,3 +21,10 @@ irc_port: 6697
irc_channel: "#baz"
irc_nickname: shithead-ng
irc_nickname2: shithead
#
# RNG to use
# This can be "rand" for perl's built in rand() function
# Or "mt" to use the Math::Random::MT::Perl module (recommended)
#
rng: rand

View File

@ -6,3 +6,6 @@ requires "YAML::Tiny" => "0";
requires "POE::Component::SSLify" => "0";
requires "Scalar::Util" => "0";
requires "Encode" => "0";
requires "if" => "0";
recommends "Math::Random::MT::Perl" => "0";