Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save masak/90211 to your computer and use it in GitHub Desktop.
Save masak/90211 to your computer and use it in GitHub Desktop.
when $.lintel_move {
# RAKUDO: Hoping these explicit int(...) conversions won't be
# necessary in the long run.
my Int $row_1 = int($<coords>[0]<row_number> - 1);
my Int $row_2 = int($<coords>[1]<row_number> - 1);
my Int $column_1
= int(ord($<coords>[0]<col_letter>) - ord('a'));
my Int $column_2
= int(ord($<coords>[1]<col_letter>) - ord('a'));
fail $reason if my $reason
= self.is-lintel-move-bad($row_1, $row_2,
$column_1, $column_2,
$color);
my $height = @!heights[$row_1][$column_1];
my $row_m = ($row_1 + $row_2 ) / 2;
my $column_m = ($column_1 + $column_2) / 2;
@pieces_to_put = $height, $row_1, $column_1,
$height, $row_m, $column_m,
$height, $row_2, $column_2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment