anchor.diff:  hint(History) ->
       {Board, _Captured, Color} = from_scratch(History),
       lists:flatmap(
  -      fun(I1) ->
  -              case getcell(Board, I1) of
  +      fun(SrcCoord) ->
  +              case getcell(Board, SrcCoord) of
                     {Color, _ChessmanType} ->
                         lists:flatmap(
  -                        fun(I2) ->
  -                                case is_valid(Board, I1, I2, History) of
  +                        fun(DstCoord) ->
  +                                case is_valid(Board, SrcCoord, DstCoord, History) of
                                       true ->
  -                                        [ind_enc(I1) ++ ind_enc(I2)];
  +                                        [ind_enc(SrcCoord) ++ ind_enc(DstCoord)];
                                       false ->
                                           []
                                   end
  -                        end, hint_for_cell_unsafe(Board, I1, History));
  +                        end, hint_for_cell_unsafe(Board, SrcCoord, History));
                     _ -> []
                 end
         end, all_cells()).
  
positive.code:             ?null
      end.
  
  %% @doc Search free cells in the given direction until enemy chessman
  %% or board end found. When the enemy chessman found the enemy
  %% coordinates will also be returned.
  
negative.code:                      History :: echessd_game:history()) ->
                              coord() | ?null.
  short_castling(Board, Color, History) ->
      castling(Board, Color, History, short_rook_coord(Color), {1, 0}).
  
  %% @doc
  -spec castling(Board :: board(), Color :: echessd_game:color(),
                 History :: echessd_game:history(),
                 RookCoord :: coord(), Delta :: delta()) ->
                        coord() | ?null.
  castling(Board, Color, History, RookCoord, Delta) ->
      case is_have_been_moved(History, RookCoord) of
          true ->
              ?null;
          _ ->
              KingStartCoord = king_start_coord(Color),
              EnemyColor = not_color(Color),
              KingStep1 = ind_inc(KingStartCoord, Delta),
              KingStep2 = ind_inc(KingStep1, Delta),
              case is_good_for_king(Board, KingStep1, EnemyColor)
                  andalso is_good_for_king(Board, KingStep2, EnemyColor) of
                  true ->
                      KingStep2;
                  false ->
                      ?null
              end
      end.
  
  %% @doc Check if cell is good for the king (not settled and not attacked
  %% by the enemy.
  -spec is_good_for_king(Board :: board(), Coord :: coord(),
                         EnemyColor :: echessd_game:color()) -> boolean().
  is_good_for_king(Board, Coord, EnemyColor) ->
      is_empty(Board, Coord) andalso
          not is_cell_attacked(Board, Coord, EnemyColor).
  
  %% @doc
  -spec king_start_coord(Color :: echessd_game:color()) -> coord().
  