4 kyu

Play Tetris : Shape anastomosis

Description:

Play Tetris : Shape anastomosis

About Tetris

Most people know that, so I ignore it, if you don't know, look here.

Task

Give you a "board" and a "block" ,find the shape anastomosis in the board, return its coordinates as a string. Example:

  Both board and block are given by 2D Array
  
     ■■■■
     ■□□■          □□
     ■□□■          □□    ===>    "[1,1],[1,2],[2,1],[2,2]"
     ■■■■
     board        block        its coordinates(if not found,return "")
  
    ■■■■■■
    ■■□□□■        □□□
    ■■□■■■        □■■    ===>    "[1,2],[1,3],[1,4],[2,2]"
    ■■■■■■
  
  please ignore the ■ in block, it's just to keep shape
  The returned string contains only the □'s coordinates
                 
    ■■●●●■              
    ■●□□□●     □□□
    ■●□●●■     □■■
    ■■●■■■
   
  Shape anastomosis means that the shape of the outer perimeter 
  is closed, look at the position of ● above

In addition, the returned coordinates are arranged in order from top to bottom, from left to right. If there are more than one to meet the conditions of the location, also in accordance with the above order.

Classic Games Series

Games
Puzzles

Stats:

CreatedFeb 20, 2016
PublishedFeb 21, 2016
Warriors Trained559
Total Skips60
Total Code Submissions1181
Total Times Completed93
JavaScript Completions93
Total Stars38
% of votes with a positive feedback rating97% of 45
Total "Very Satisfied" Votes42
Total "Somewhat Satisfied" Votes3
Total "Not Satisfied" Votes0
Total Rank Assessments4
Average Assessed Rank
4 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
5 kyu
Ad
Contributors
  • myjinxin2015 Avatar
  • kazk Avatar
  • gabbek Avatar
  • user8751232 Avatar
Ad