Skip to content

Instantly share code, notes, and snippets.

@JustThisGuyAZ
Created July 16, 2018 00:43
Show Gist options
  • Save JustThisGuyAZ/42a5fd31164144cdd017ade75565e5f3 to your computer and use it in GitHub Desktop.
Save JustThisGuyAZ/42a5fd31164144cdd017ade75565e5f3 to your computer and use it in GitHub Desktop.
Exists test
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