Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,4 @@
if $guess == 6 { say "Wow! Lucky Guess!" } # Traditional
say 'Wow! Lucky Guess!' if $guess == 6; # Inverted
unless $guess == 6 { say "Huh! You Guessed Rong!" } # Traditional
say 'Huh! You Guessed Rong!' unless $guess == 6; # Inverted

View file

@ -0,0 +1,8 @@
while $i { --$i }
--$i while $i;
until $x > 10 { $x++ }
$x++ until $x > 10;
for 1..10 { .say if $_ %% 2 }
.say if $_ %% 2 for 1..10; # list comprehension

View file

@ -0,0 +1 @@
42 R= $_; say $_; # prints 42

View file

@ -0,0 +1,2 @@
my @a = 1,2,3;
(1,2,3) R= my @a;

View file

@ -0,0 +1,2 @@
my @a <== 1,2,3;
1,2,3 ==> my @a;

View file

@ -0,0 +1,7 @@
repeat {
$_ = prompt "Gimme a number: ";
} until /^\d+$/;
repeat until /^\d+$/ {
$_ = prompt "Gimme a number: ";
}

View file

@ -0,0 +1,3 @@
repeat until my $answer ~~ 42 {
$answer = prompt "Gimme an answer: ";
}

View file

@ -0,0 +1,4 @@
my $answer;
repeat {
$answer = prompt "Gimme an answer: ";
} until $answer ~~ 42;