choice between two RNGs
This commit is contained in:
parent
58e1f66319
commit
cd457755cb
|
@ -16,6 +16,7 @@ use MarkovBot::Commands;
|
||||||
use MarkovBot::MarkovChain;
|
use MarkovBot::MarkovChain;
|
||||||
use MarkovBot::Redis;
|
use MarkovBot::Redis;
|
||||||
use Encode qw(encode decode);
|
use Encode qw(encode decode);
|
||||||
|
use if (config("rng") eq "mt"), "Math::Random::MT::Perl" => qw(rand);
|
||||||
|
|
||||||
sub said {
|
sub said {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
|
@ -12,6 +12,7 @@ use lib $Bin;
|
||||||
use MarkovBot::Config;
|
use MarkovBot::Config;
|
||||||
use MarkovBot::Redis;
|
use MarkovBot::Redis;
|
||||||
use Encode qw(decode encode);
|
use Encode qw(decode encode);
|
||||||
|
use if (config("rng") eq "mt"), "Math::Random::MT::Perl" => qw(rand);
|
||||||
|
|
||||||
sub markov( $ ) {
|
sub markov( $ ) {
|
||||||
# markov - given two starting words, returns a markov chain result
|
# markov - given two starting words, returns a markov chain result
|
||||||
|
|
|
@ -21,3 +21,10 @@ irc_port: 6697
|
||||||
irc_channel: "#baz"
|
irc_channel: "#baz"
|
||||||
irc_nickname: shithead-ng
|
irc_nickname: shithead-ng
|
||||||
irc_nickname2: shithead
|
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
|
||||||
|
|
3
cpanfile
3
cpanfile
|
@ -6,3 +6,6 @@ requires "YAML::Tiny" => "0";
|
||||||
requires "POE::Component::SSLify" => "0";
|
requires "POE::Component::SSLify" => "0";
|
||||||
requires "Scalar::Util" => "0";
|
requires "Scalar::Util" => "0";
|
||||||
requires "Encode" => "0";
|
requires "Encode" => "0";
|
||||||
|
requires "if" => "0";
|
||||||
|
|
||||||
|
recommends "Math::Random::MT::Perl" => "0";
|
||||||
|
|
Loading…
Reference in New Issue