debut d'une ia par point
This commit is contained in:
@@ -75,12 +75,12 @@ public class GomokuBoard{
|
||||
return output;
|
||||
|
||||
}
|
||||
//-------------------Methods-------------------------
|
||||
/**
|
||||
* This method return a Map of number aligned cells.
|
||||
* @param cell A cell.
|
||||
* @return Map of number aligned cells.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This method return a Map of number aligned cells.
|
||||
* @param cell A cell.
|
||||
* @return Map of number aligned cells.
|
||||
*/
|
||||
public Map<Cardinal, Integer> countAlignedCells(GomokuCell cell){
|
||||
|
||||
Map<Cardinal, Integer> map = new HashMap<>();
|
||||
@@ -94,6 +94,23 @@ public class GomokuBoard{
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method return the number max of the aligned Cells.
|
||||
* @param mapColor A map of number aligned cells.
|
||||
* @return int, the number max of the aligned Cells.
|
||||
*/
|
||||
public int countMax(Map<Cardinal, Integer> mapColor){
|
||||
|
||||
Map<Cardinal, Integer> map = new HashMap<>();
|
||||
int max = 0;
|
||||
for (Map.Entry<Cardinal, Integer> entry : map.entrySet()) {
|
||||
if(entry.getValue() > max){
|
||||
max = entry.getValue();
|
||||
}
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
//------------------Overides--------------------------
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user