Commit 8861dc5e authored by mavomo's avatar mavomo

Ajout exemples & contre exemples sur l intention

parent 63532094
package io.soat.names.disinformation.game;
import java.util.ArrayList;
import java.util.List;
public class Michelle_communicate_intent_GameOfLife_Rot {
private List<int[]> theList;
public List<int[]> getThem(){
List<int[]> list1 = new ArrayList<>();
for(int[] x : theList)
if (x[0] == 4)
list1.add(x);
return list1;
}
}
package io.soat.names.disinformation.game;
import java.util.ArrayList;
import java.util.List;
public class Michelle_communicate_intent_clean {
private static final int STATUS_VALUE = 0;
private static final int FLAGGED = 4;
private List<int[]> gameBoard;
public List<int[]> getFlaggedCells() {
List<int[]> flaggedCells = new ArrayList<>();
for (int[] cell : gameBoard)
if (cell[STATUS_VALUE] == FLAGGED)
flaggedCells.add(cell);
return flaggedCells;
}
}
package io.soat.names.disinformation.game;
import java.util.ArrayList;
import java.util.List;
public class Michelle_communicate_intent_GameOfLife_cleaner {
private List<Cell> gameBoard;
public List<Cell> getFlaggedCells() {
List<Cell> flaggedCells = new ArrayList<>();
for (Cell cell : gameBoard)
if (cell.isFlagged())
flaggedCells.add(cell);
return flaggedCells;
}
public class Cell {
private boolean flagged;
public boolean isFlagged() {
return flagged ;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment