Skip to content

Instantly share code, notes, and snippets.

@JustThisGuyAZ
Last active July 16, 2018 00:42
Exists test on multidimensional hash
my %node;
%node<1><2> = 1;
for 0..3 -> Int $x {
for 0..3 -> Int $y {
my Int $cost;
say "$x,$y";
$cost = %node<$x><y>:exists ?? 100 !! 1;
say $cost;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment