ch4 progress

This commit is contained in:
drudge 2023-11-21 07:44:50 -08:00
parent 331f3ed17c
commit a16d53070c
3 changed files with 21 additions and 0 deletions

5
ch4/ex4-1.raku Normal file
View file

@ -0,0 +1,5 @@
sub MAIN (
$word #= string to count the characters of
) {
say $word.chars;
}

7
ch4/ex4-2.raku Normal file
View file

@ -0,0 +1,7 @@
sub MAIN () {
my $bjort = "a";
while $bjort {
$bjort = prompt "Provide a string to count the chars";
say $bjort.chars;
}
}

9
ch4/ex4-3.raku Normal file
View file

@ -0,0 +1,9 @@
sub MAIN () {
loop {
my $answer = prompt "Provide string to check for presence of Hamad\n";
$answer.contains("Hamad") ??
say "Hamad detected" !!
say "No Hamad detected";
last if $answer.chars == 0;
}
}