ch4 progress
This commit is contained in:
parent
331f3ed17c
commit
a16d53070c
5
ch4/ex4-1.raku
Normal file
5
ch4/ex4-1.raku
Normal file
|
@ -0,0 +1,5 @@
|
|||
sub MAIN (
|
||||
$word #= string to count the characters of
|
||||
) {
|
||||
say $word.chars;
|
||||
}
|
7
ch4/ex4-2.raku
Normal file
7
ch4/ex4-2.raku
Normal 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
9
ch4/ex4-3.raku
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue