Decision tables: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
m (→‎{{header|Perl}}: use v5.36)
Line 1,664: Line 1,664:


=={{header|Perl}}==
=={{header|Perl}}==
<syntaxhighlight lang="perl">use strict;
<syntaxhighlight lang="perl" line>use v5.36;

use warnings;
sub decide($q,$a) {
my @q = @{$q};
my %a = %{$a};
my($cnt,$bit) = (1,0);


sub decide {
our(@q,%a);
local *q = shift;
local *a = shift;
my $bit;
my $cnt = 1;
for my $prompt (@q) {
for my $prompt (@q) {
print "$prompt: ";
print "$prompt: ";
Line 1,690: Line 1,688:
'Printer does not print',
'Printer does not print',
);
);

my %answers = (
my %answers = (
0b00100000 => 'Check the power cable',
0b00100000 => 'Check the power cable',