Commit a9a0bbe3 authored by Alexandre Meyer's avatar Alexandre Meyer
parents 3be394b1 6f242131
/target/
/.idea/
/cleancode.iml
package io.soat.names.meaningfulcontext;
/**
* On veut afficher un message de stats récapitulatif suivant la valeur "count" passée en paramètre
*
* @see : Clean code page 28.
*/
public class Michelle_Name_Choice_Algo_Rot {
private void printGuessStatistics(char candidate, int count){
private void printGuessStatistics(char candidate, int count) {
String number;
String verb;
String pluralModifier;
......
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.soat</groupId>
<artifactId>cleancode</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>cleancode</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
package io.soat.names.disinformation.game;
import java.util.ArrayList;
import java.util.List;
public class Michelle_GameOfLife_communicate_intent_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_GameOfLife_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_GameOfLife_communicate_intent_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