Skip to content

Commit 431867d

Browse files
committed
Assign %table elements to the empty array
This gets the (half-implemented) games/flashcard.p6 example working again.
1 parent 350297f commit 431867d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

games/flashcard.p6

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env perl6
22

3-
my %table = (:context<>, :text<>, :link<>, :item<>, :group<>);
3+
use v6;
4+
5+
my %table = (:context => (), :text => (), :link => (), :item => (), :group => ());
46
# item => ({ text => @text[0], context => %table{'context'}[0], score => 0 # },...)
57
# group = ({ 'link' => 1, itemA => item[0], itemB => item[1] } );
68

@@ -30,7 +32,7 @@ sub add-item () {
3032

3133
# add-group item_id-item_id link_id
3234
sub add-group () {
33-
35+
3436
}
3537

3638
# question: can there be multiple links between the same two items? multiple
@@ -41,4 +43,4 @@ sub add-group () {
4143
# really just the same? No, that's a good separation. Well, for now I can keep
4244
# them as scalars and make them lists if I want to later.
4345

44-
# vim: ft=perl6
46+
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)