Lines Matching refs:piece

245 func rotate_piece(piece int) {
247 piece_def[piece][i] = rotate(piece_def[piece][i])
252 func flip_piece(piece int) {
254 piece_def[piece][i] = flip(piece_def[piece][i])
259 func calc_cell_indices(cell []int8, piece int, index int8) {
262 cell[i] = shift(cell[i-1], piece_def[piece][i-1])
267 func cells_fit_on_board(cell []int8, piece int) bool {
268 return !out_of_bounds(cell[0], piece_def[piece][0]) &&
269 !out_of_bounds(cell[1], piece_def[piece][1]) &&
270 !out_of_bounds(cell[2], piece_def[piece][2]) &&
271 !out_of_bounds(cell[3], piece_def[piece][3])
316 func record_piece(piece int, minimum int8, first_empty int8, piece_mask uint64) {
317 pieces[piece][minimum][piece_counts[piece][minimum]] = piece_mask
318 next_cell[piece][minimum][piece_counts[piece][minimum]] = first_empty
319 piece_counts[piece][minimum]++
356 func has_island(cell []int8, piece int) bool {
373 if c == 0 || (c == 5 && piece == 8) || (c == 40 && piece == 8) ||
374 (c%5 == 0 && piece == 0) {
387 func calc_six_rotations(piece, index int) { argument
390 if piece != 3 || rotation < 3 {
391 calc_cell_indices(cell, piece, int8(index))
392 if cells_fit_on_board(cell, piece) && !has_island(cell, piece) {
396 record_piece(piece, minimum, first_empty, piece_mask)
399 rotate_piece(piece)
405 for piece := 0; piece < 10; piece++ {
407 calc_six_rotations(piece, index)
408 flip_piece(piece)
409 calc_six_rotations(piece, index)
578 for piece := int8(0); piece < 10; piece++ {
579 var piece_no_mask uint16 = 1 << uint(piece)
584 max_rots := piece_counts[piece][cell]
585 piece_mask := pieces[piece][cell]
588 sol_nums[depth] = piece
597 if boardHasIslands(next_cell[piece][cell][rotation]) == 0 {
598 solve(depth+1, next_cell[piece][cell][rotation])