Skip to content

Commit b3ee305

Browse files
committed
Improve sample documentation with header updates
1 parent 7f442ad commit b3ee305

File tree

6 files changed

+30
-11
lines changed

6 files changed

+30
-11
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A C++17-compatible header that provides useful functions which help with the sol
1818
## Usage
1919

2020
* Simply download the `src/sudoku_suite.h` file and move it to your project's directory.
21-
* Include the header file, as shown below in the examples, and use the functions you need!
21+
* Include the required header files, as shown below in the examples, and use the functions you need!
2222
* **NOTE:** The code is incompatible with pre-C++17 versions. While compiling, you'll have to compile with the `--std=c++17` flag.
2323
* For example; when using the clang compiler, the compile command would be `c++ --std=c++17 /path/to/file.cpp`
2424

@@ -51,7 +51,8 @@ There are **three functions** that Sudoku-Suite provides the developer, along wi
5151
#### Solving and validating Sudoku puzzle
5252
```
5353
#include<iostream>
54-
#include"/path/to/sudoku_suite.h"
54+
#include"/path/to/src/sudoku_solver.h"
55+
#include"/path/to/src/sudoku_validator.h"
5556
5657
int main() {
5758
sudoku::Grid grid({{
@@ -80,7 +81,7 @@ int main() {
8081
#### Generating a Sudoku puzzle
8182
```
8283
#include<iostream>
83-
#include"/path/to/sudoku_suite.h"
84+
#include"/path/to/src/sudoku_generator.h"
8485
8586
int main() {
8687
sudoku::Grid grid = sudoku::generate_puzzle();
@@ -93,7 +94,10 @@ int main() {
9394
#### Initialising and reusing Grid objects
9495
```
9596
#include<iostream>
96-
#include"/path/to/sudoku_suite.h"
97+
#include"/path/to/src/grid.h"
98+
99+
/* NOTE: If you only need to utilise the Grid object,
100+
* you can just import the "grid.h" header alone. */
97101
98102
int main() {
99103
//================
@@ -162,7 +166,10 @@ File: `sample1.txt`
162166

163167
```
164168
#include<iostream>
165-
#include"/path/to/sudoku_suite.h"
169+
#include"/path/to/src/grid.h"
170+
171+
/* NOTE: If you only need to utilise the Grid object,
172+
* you can just import the "grid.h" header alone. */
166173
167174
int main() {
168175
sudoku::Grid grid;
@@ -179,7 +186,10 @@ int main() {
179186
#### Operations on Grid objects
180187
```
181188
#include<iostream>
182-
#include"/path/to/sudoku_suite.h"
189+
#include"/path/to/src/grid.h"
190+
191+
/* NOTE: If you only need to utilise the Grid object,
192+
* you can just import the "grid.h" header alone. */
183193
184194
int main() {
185195

samples/initialising_grid_from_file.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/* Copyright 2023 Arjun Aravind */
2-
/* A basic example. */
2+
/* A basic example as seen in the project's README. */
33

44
#include<iostream>
55
#include"../src/sudoku_solver.h"
66

7+
/* NOTE: If you only need to utilise the Grid object,
8+
* you can just import the "grid.h" header alone. */
9+
710
int main() {
811
sudoku::Grid grid;
912
grid.set_initial_state_from_file("samples/sample1.txt");

samples/initialising_grids.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/* Copyright 2023 Arjun Aravind */
2-
/* A basic example. */
2+
/* A basic example as seen in the project's README. */
33

44
#include<iostream>
55
#include"../src/grid.h"
66

7+
/* NOTE: If you only need to utilise the Grid object,
8+
* you can just import the "grid.h" header alone. */
9+
710
int main() {
811
// Method 1: Use the constructor and pass in a
912
// 2D matrix of values.

samples/operations_on_grid_objects.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/* Copyright 2023 Arjun Aravind */
2-
/* A basic example. */
2+
/* A basic example as seen in the project's README. */
33

44
#include<iostream>
55
#include"../src/grid.h"
66

7+
/* NOTE: If you only need to utilise the Grid object,
8+
* you can just import the "grid.h" header alone. */
9+
710
int main() {
811
sudoku::Grid sample_grid_1({{
912
{{ 1, 7, 2, 5, 4, 9, 6, 8, 3 }},

samples/sudoku_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright 2023 Arjun Aravind */
2-
/* A basic example. */
2+
/* A basic example as seen in the project's README. */
33

44
#include<iostream>
55
#include"../src/sudoku_generator.h"

samples/sudoku_solver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright 2023 Arjun Aravind */
2-
/* A basic example. */
2+
/* A basic example as seen in the project's README. */
33

44
#include<iostream>
55
#include"../src/sudoku_solver.h"

0 commit comments

Comments
 (0)