viewing paste Unknown #20998 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#!/usr/bin/perl
 
use 5.010;
use strict;
use warnings;
 
 
my $rn = int(rand(3));
my $int = 0;
my @zustand;
my $loop = 1;
my $input;
my $value = 0;
while($loop > 0){
    say "Input Zustand! oder Stopp";
    $input = <STDIN>;
    chomp $input;
    if($input eq "Stopp"){
        $loop = 0;
    }else{
        $zustand[$loop - 1] = $input;
        $loop++;
    }
}
say "Wie ist Dein Name? ";
my $name = <STDIN>;
chomp $name;
say "Hallo $name, wie geht's Dir?";
while($int < @zustand){
    $value = $int + 1;
    say "$value. $zustand[$int]";
    $int++;
}
say "Bitte waehle eine der $value Zustaende! Mit 1 oder 2 oder 3 oder usw!";
$input = <STDIN>;
chomp $input;
my $rnm;
if($rn == 0){
    $rnm = "Dir geht es";
}elsif($rn == 1){
    $rnm = "Ich wusste es geht dir";
}elsif($rn == 2){
    $rnm = "Mir geht es auch";
}
say "$rnm $zustand[$input - 1]";
 
Viewed 657 times, submitted by Guest.