Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit dea4890

Browse files
committed
hw1: conway docs pdf generated.
1 parent 4adef22 commit dea4890

File tree

6 files changed

+39
-31
lines changed

6 files changed

+39
-31
lines changed

ConWaysGame/compile-pdf.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pandoc header-includes.yaml manuals/manual.md -o manuals/manual.pdf --pdf-engine=lualatex
2+
pandoc header-includes.yaml manuals/tests.md -o manuals/tests.pdf --pdf-engine=lualatex

ConWaysGame/header-includes.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
header-includes: |
3+
\usepackage{fontspec}
4+
\setmonofont{DejaVu Sans}
5+
---

ConWaysGame/manuals/manual.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
# Manual
1+
# Manual
22

3-
This is the manual of Conway Game of Life simulator usage.
3+
This is the user manual of Conway Game of Life simulator.
4+
You may find detail program usage and error message explanation here.
45

5-
## Inputs
6+
## Inputs
67

78
In this section, program usage will be presented, as well as input file format.
89

9-
### Command line
10+
### Command line
1011

11-
Please refer to `readme.md`, looking for commands for your OS. Here we will explain each argument and its usage.
12+
Please refer to `readme.md`, looking for commands for your OS. Here each argument will be explained in details.
1213

1314
#### `<input>`
1415

1516
The path to the seed file. The file format is defined below.
1617

17-
##### Input File format
18+
##### Input File format
1819

1920
- The first line contains, in order, the number of rows, and the number of columns in the grid, separated by a comma and a space. E.g., 5, 7 means that there are 5 rows and 7 columns in the grid. There are no spaces after the number of columns.
2021
- All lines starting from the second one contain the state of one row in the grid, starting with row #0. The state of each cell is designated with either 0 (cell is dead) or 1 (cell is alive). The states of individual cells are separated by a comma followed by a space (there is no comma and/or space after the last 0 or 1 in the line). For example, if the third line of the file (the second line of the grid part of the file) is 0, 0, 0, 1, 0, 0, 0 it corresponds to the following cell states in row[1]: row[1][0], row[1][1], row[1][2], row[1][4], row[1][5], and row[1][6] are dead, and row[1][3] is alive.
2122
- All lines end with the new line character.
2223

23-
###### Example
24+
###### Example
2425

2526
```
2627
5, 7
@@ -41,70 +42,74 @@ The path to the directory where results should be stored. If the directory does
4142
<seedFilename>.<currentStep>.txt
4243
```
4344

44-
##### Output File Format
45+
The `currentStep` will be started from `0`, the origin seed file, and will end in given `<step>` parameter.
46+
47+
##### Output File Format
48+
4549

4650
The output file example may be found at `tests/result/`. The format of the file is the same as the input file.
4751

48-
#### `<step>`
52+
53+
#### `<step>`
4954

5055
The number of step the simulation should run. This should be a positive integer.
5156

52-
## Errors
57+
## Errors
5358

5459
Here we have listed some possible errors when using the program and what could you do when you have encountered them.
5560
We have also provided some good and bad examples in next section.
5661

57-
### `Err: [io] Output path must be a directory`
62+
### `Err: [io] Output path must be a directory`
5863

5964
The specified `<output>` exists and is not a directory. Please specify another available location.
6065

61-
### `Err: [io] Failed to create output directory`
66+
### `Err: [io] Failed to create output directory`
6267

6368
The specified `<output>` does not exist, but program failed to create corresponded parents directories. Sometimes it may be system error, but please ensure the path enter is valid for your current OS.
6469

65-
### `Err: [input] step x is invalid`
70+
### `Err: [input] step x is invalid`
6671

6772
This happened when step is less than 0. Please specify a number equal to or larger than 0.
6873

69-
### `An error occur while processing files: `
74+
### `An error occur while processing files: `
7075

7176
An `IOException` occurs. Possibly due to non-existence of a specified file, or other system issue. Please read stack for more info.
7277

73-
### `Err: [input] unable to parse "x" as integer`
78+
### `Err: [input] unable to parse "x" as integer`
7479

7580
Either seed file row/col or step is not a valid integer representation. Please double check your input.
7681

77-
### `Err: [seedFile] unable to identify row/col of the map`
82+
### `Err: [seedFile] unable to identify row/col of the map`
7883

7984
The first line of the seed file doesn't follow the `row, col` format and can't be parsed.
8085

81-
### `Err: [seedFile] Invalid row/col, must be positive integer larger than 2`
86+
### `Err: [seedFile] Invalid row/col, must be positive integer larger than 2`
8287

8388
Row or column integer representation in the seedFile is invalid.
8489

85-
### `Err: [seedFile] Unexpected col length at row index x`
90+
### `Err: [seedFile] Unexpected col length at row index x`
8691

8792
When reading seed file, a row is missing some cell representation. Please check if your file is corrupted.
8893

89-
### `Err: [seedFile] Unexpected cell type x`
94+
### `Err: [seedFile] Unexpected cell type x`
9095

9196
When reading a specific cell in the seed file, program cannot recognize its status. Please refer to file format section for the correct types.
9297

93-
### `Cannot invoke "String.split(String)" because "<local1>" is null`
98+
### `Cannot invoke "String.split(String)" because "<local1>" is null`
9499

95100
Seed file is possibly empty. Please check if correct seed file is given.
96101

97-
## Examples Args
102+
## Examples Args
98103

99-
Please append the following with your OS command specify in `readme.md`
104+
Please append the following with commands corresponed to your OS specify in `readme.md`
100105

101106
```bash
102107
tests/example1.txt tests/result/example1 21
103108
tests/example2.txt tests/result/example2 5
104109
tests/example3.txt tests/result/example3 50
105110
```
106111

107-
### Bad Examples
112+
### Bad Examples
108113

109114
```bash
110115
... tests/invalid1.txt tests/result/example1 1

ConWaysGame/manuals/manual.pdf

57 KB
Binary file not shown.

ConWaysGame/manuals/tests.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
The following methods are used when testing the program.
44

5-
## United test
5+
## Unit Test
66

7-
A Java framework, JUnit5, has been used within the process. You may consult to `com.luox6.conway.test` for the test cases written.
7+
A Java framework, JUnit5, has been used within the process. You may consult to `com.luox6.conway.test` for the written test cases.
88

9-
### Included sections
9+
### Included Sections
1010

1111
- getters/setters
1212
- class constructor
@@ -22,13 +22,9 @@ You may use your favourite IDE integration with JUnit. Please consult [JUnit man
2222
However, if you would like to use `ConsoleLauncher`, after compiling the program following the instruction in `readme.md`, try the following command for unit test result.
2323

2424
```bash
25-
# The following bash command should run at project root directory
25+
$ # The following bash command should run at project root directory
2626
$ java -jar deps/junit-platform-console-standalone-1.7.0.jar -cp ./src --scan-class-path
27-
```
28-
29-
Success Output:
3027

31-
```
3228
Thanks for using JUnit! Support its development at https://junit.org/sponsoring
3329

3430

ConWaysGame/manuals/tests.pdf

60.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)