feat: premier jet de la conception basique du sudoku

This commit is contained in:
2024-12-25 20:53:25 +01:00
parent 270bf31ab0
commit 0c03f07345
8 changed files with 388 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
package sudoku;
public class Symbole {
private final String valeur;
public Symbole(String symbole) {
this.valeur = symbole;
}
// Factory methods pour différents types
public static Symbole of(String s) {
return new Symbole(s);
}
public static Symbole of(int n) {
return new Symbole(String.valueOf(n));
}
public static Symbole of(char c) {
return new Symbole(String.valueOf(c));
}
@Override
public String toString() {
return valeur;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
Symbole symbole = (Symbole) obj;
return valeur.equals(symbole.valeur);
}
}