次のタイプのArrayListがあります。
class Move
{
int from, to;
}
fromプロパティには常に値があります。toプロパティが設定されていない場合、-1になります。私は次の配列を持っています:
int[][] history = new int[50][50];
ここで、ディメンションは、moveクラスの「from」および「to」に対応します。私の検索機能では、特定の条件に応じて、次のことを行う必要があります。
List<move> moves = board.getMoves();
for (int i = 0; i < moves.size(); i++)
history[move.from][move.to]++;
move.toも-1になる可能性があるため、2次元配列1の次元を増やしてから、次のようにします。
history[move.from+1][move.to+]++;
また、上記の移動リストと履歴配列に基づいて、対応する履歴インデックスのカウンターに応じて移動リストを降順で並べ替える必要があります。
これは可能ですか?