Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/Inverted-syntax/Raku/inverted-syntax-1.raku
Normal file
4
Task/Inverted-syntax/Raku/inverted-syntax-1.raku
Normal 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
|
||||
8
Task/Inverted-syntax/Raku/inverted-syntax-2.raku
Normal file
8
Task/Inverted-syntax/Raku/inverted-syntax-2.raku
Normal 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
|
||||
1
Task/Inverted-syntax/Raku/inverted-syntax-3.raku
Normal file
1
Task/Inverted-syntax/Raku/inverted-syntax-3.raku
Normal file
|
|
@ -0,0 +1 @@
|
|||
42 R= $_; say $_; # prints 42
|
||||
2
Task/Inverted-syntax/Raku/inverted-syntax-4.raku
Normal file
2
Task/Inverted-syntax/Raku/inverted-syntax-4.raku
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
my @a = 1,2,3;
|
||||
(1,2,3) R= my @a;
|
||||
2
Task/Inverted-syntax/Raku/inverted-syntax-5.raku
Normal file
2
Task/Inverted-syntax/Raku/inverted-syntax-5.raku
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
my @a <== 1,2,3;
|
||||
1,2,3 ==> my @a;
|
||||
7
Task/Inverted-syntax/Raku/inverted-syntax-6.raku
Normal file
7
Task/Inverted-syntax/Raku/inverted-syntax-6.raku
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
repeat {
|
||||
$_ = prompt "Gimme a number: ";
|
||||
} until /^\d+$/;
|
||||
|
||||
repeat until /^\d+$/ {
|
||||
$_ = prompt "Gimme a number: ";
|
||||
}
|
||||
3
Task/Inverted-syntax/Raku/inverted-syntax-7.raku
Normal file
3
Task/Inverted-syntax/Raku/inverted-syntax-7.raku
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
repeat until my $answer ~~ 42 {
|
||||
$answer = prompt "Gimme an answer: ";
|
||||
}
|
||||
4
Task/Inverted-syntax/Raku/inverted-syntax-8.raku
Normal file
4
Task/Inverted-syntax/Raku/inverted-syntax-8.raku
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
my $answer;
|
||||
repeat {
|
||||
$answer = prompt "Gimme an answer: ";
|
||||
} until $answer ~~ 42;
|
||||
Loading…
Add table
Add a link
Reference in a new issue