File tree 4 files changed +69
-3
lines changed
src/main/java/de/borisskert/sudoku/console
4 files changed +69
-3
lines changed Original file line number Diff line number Diff line change 1
1
```
2
+ Welcome to
2
3
.----------------. .----------------. .----------------. .----------------. .----------------. .----------------.
3
4
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
4
5
| | _______ | || | _____ _____ | || | ________ | || | ____ | || | ___ ____ | || | _____ _____ | |
@@ -21,5 +22,41 @@ mvn package
21
22
# Run console game
22
23
23
24
``` shell script
24
- mvn clean package
25
+ java -jar target/sudoku.jar
25
26
```
27
+
28
+ Game looks like:
29
+
30
+ ``` text
31
+ Width: 3
32
+ Height: 3
33
+ Level (1=easy, 2=medium, 3=hard): 2
34
+ Creating puzzle...
35
+ ╔═╤═╤═╦═╤═╤═╦═╤═╤═╗
36
+ ║ │ │ ║ │ │7║ │ │ ║
37
+ ╟─┼─┼─╫─┼─┼─╫─┼─┼─╢
38
+ ║ │ │ ║ │ │ ║ │ │ ║
39
+ ╟─┼─┼─╫─┼─┼─╫─┼─┼─╢
40
+ ║ │ │ ║ │2│1║ │ │6║
41
+ ╠═╪═╪═╬═╪═╪═╬═╪═╪═╣
42
+ ║ │8│ ║ │ │2║ │5│ ║
43
+ ╟─┼─┼─╫─┼─┼─╫─┼─┼─╢
44
+ ║ │ │ ║ │ │8║3│ │ ║
45
+ ╟─┼─┼─╫─┼─┼─╫─┼─┼─╢
46
+ ║ │ │ ║7│ │ ║ │ │ ║
47
+ ╠═╪═╪═╬═╪═╪═╬═╪═╪═╣
48
+ ║ │ │2║ │4│ ║ │6│8║
49
+ ╟─┼─┼─╫─┼─┼─╫─┼─┼─╢
50
+ ║7│ │8║ │1│9║ │ │5║
51
+ ╟─┼─┼─╫─┼─┼─╫─┼─┼─╢
52
+ ║ │ │ ║ │7│ ║ │ │ ║
53
+ ╚═╧═╧═╩═╧═╧═╩═╧═╧═╝
54
+
55
+ Columns: right to left, 1 to 9
56
+ Lines: top to bottom, 1 to 9
57
+ Values: 1 to 9
58
+ Type in 'SOLVE' to solve the puzzle
59
+ Column: _
60
+ Line: _
61
+ Value: _
62
+ ```
Original file line number Diff line number Diff line change 40
40
<artifactId >maven-surefire-plugin</artifactId >
41
41
<version >2.22.0</version >
42
42
</plugin >
43
+
44
+ <plugin >
45
+ <!-- https://stackoverflow.com/a/9689877 -->
46
+ <groupId >org.apache.maven.plugins</groupId >
47
+ <artifactId >maven-jar-plugin</artifactId >
48
+ <version >3.2.0</version >
49
+ <configuration >
50
+ <archive >
51
+ <manifest >
52
+ <mainClass >de.borisskert.sudoku.console.Application</mainClass >
53
+ </manifest >
54
+ </archive >
55
+ </configuration >
56
+ </plugin >
43
57
</plugins >
44
58
</build >
45
59
</project >
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ public class Application {
7
7
private static final Scanner scanner = new Scanner (System .in );
8
8
9
9
public static void main (String [] args ) {
10
+ printWelcomeMessage ();
11
+
10
12
int width = readWidth ();
11
13
int height = readHeight ();
12
14
Level level = readLevel ();
@@ -61,4 +63,19 @@ private static Level readLevel() {
61
63
62
64
return Level .from (level );
63
65
}
66
+
67
+ private static void printWelcomeMessage () {
68
+ System .out .println ("Welcome to" );
69
+ System .out .println (" .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. \n " +
70
+ "| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |\n " +
71
+ "| | _______ | || | _____ _____ | || | ________ | || | ____ | || | ___ ____ | || | _____ _____ | |\n " +
72
+ "| | / ___ | | || ||_ _||_ _|| || | |_ ___ `. | || | .' `. | || | |_ ||_ _| | || ||_ _||_ _|| |\n " +
73
+ "| | | (__ \\ _| | || | | | | | | || | | | `. \\ | || | / .--. \\ | || | | |_/ / | || | | | | | | |\n " +
74
+ "| | '.___`-. | || | | ' ' | | || | | | | | | || | | | | | | || | | __'. | || | | ' ' | | |\n " +
75
+ "| | |`\\ ____) | | || | \\ `--' / | || | _| |___.' / | || | \\ `--' / | || | _| | \\ \\ _ | || | \\ `--' / | |\n " +
76
+ "| | |_______.' | || | `.__.' | || | |________.' | || | `.____.' | || | |____||____| | || | `.__.' | |\n " +
77
+ "| | | || | | || | | || | | || | | || | | |\n " +
78
+ "| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |\n " +
79
+ " '----------------' '----------------' '----------------' '----------------' '----------------' '----------------'" );
80
+ }
64
81
}
Original file line number Diff line number Diff line change @@ -53,8 +53,6 @@ public void oneRound() {
53
53
System .out .println ("Solving..." );
54
54
puzzle .solve ();
55
55
}
56
-
57
- printPuzzle ();
58
56
}
59
57
60
58
public boolean isSolved () {
You can’t perform that action at this time.
0 commit comments