AI-ExpertSystem-Simple
view release on metacpan or search on metacpan
bin/simpleshell view on Meta::CPAN
while ( $x < 1 or $x > $number ) {
say_question($text);
for ( my $y = 1 ; $y <= $number ; $y++ ) {
say_something('response', " $y : ", $responses[$y - 1]);
}
if($tkinterface) {
say_something('response', '', '*');
} else {
print '** ';
}
$x = <STDIN>;
$x = 0 if $x !~ m#^[0-9]+$#;
}
return $responses[ $x - 1 ];
}
######################################################################
# The various ways of printing out a message
######################################################################
sub say_status { say_something('status', '>> ', shift) }
sub say_question { say_something('question', '', shift) }
sub say_something {
my ($tag1, $tag2, $text) = @_;
if($tkinterface) {
print "$tag1:$text\n";
} else {
print "$tag2$text\n";
}
}
######################################################################
# The various ways of printing out a message
######################################################################
sub process_log {
my ($prefix, $override) = @_;
$prefix = 'information' unless $prefix;
my @log = $s->log();
if($tkinterface or $override) {
( run in 0.692 second using v1.01-cache-2.11-cpan-de7293f3b23 )