tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
12
Task/Queue-Usage/Perl-6/queue-usage-2.pl6
Normal file
12
Task/Queue-Usage/Perl-6/queue-usage-2.pl6
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
my @queue = < a >;
|
||||
|
||||
@queue.push('b', 'c'); # [ a, b, c ]
|
||||
|
||||
say @queue.shift; # a
|
||||
say @queue.pop; # c
|
||||
|
||||
say @queue.perl; # [ b ]
|
||||
say @queue.elems; # 1
|
||||
|
||||
@queue.unshift('A'); # [ A, b ]
|
||||
@queue.push('C'); # [ A, b, C ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue