Skip to content

Instantly share code, notes, and snippets.

@JustThisGuyAZ
Last active July 16, 2018 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustThisGuyAZ/da906dc837f8c664e10a3e17b9748d22 to your computer and use it in GitHub Desktop.
Save JustThisGuyAZ/da906dc837f8c664e10a3e17b9748d22 to your computer and use it in GitHub Desktop.
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