In the code below, what does last
do in the while loop? I get that if the $matrix[$i][$j]{pointer}
variable equals "none"
it calls last
but what does it do?
Also why does the $matrix variable include score and pointer using curly braces? {score}
, I read this as the 3rd dimension in an array, but is this something else? Couldn't find anything on google about this. Thanks!
my @matrix;
$matrix[0][0]{score} = 0;
$matrix[0][0]{pointer} = "none";
#populate $matrix with more stuff
while (1) {
last if $matrix[$i][$j]{pointer} eq "none"; #<-what is this "last" doing?
#do some more stuff here
}