forked from root/public
lee
4 years ago
21 changed files with 329 additions and 286 deletions
@ -0,0 +1,62 @@
|
||||
## quadverifier |
||||
|
||||
### Instructions |
||||
|
||||
This raid is based on the `quad` functions. |
||||
|
||||
Create a program `quadVerifier` that takes a `string` as an argument and displays the name of the matching `quad` and its dimensions. |
||||
|
||||
- If the argument is not a `raid` the program should print `Not a Raid function`. |
||||
|
||||
- All answers must end with a newline (`'\n'`). |
||||
|
||||
- If there is more than one `quad` matches, the program must display them all alphabetically ordered and separated by a `||`. |
||||
|
||||
### Usage |
||||
|
||||
- If it's `quadA` |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ ls -l |
||||
-rw-r--r-- 1 student student nov 23 14:30 main.go |
||||
-rwxr-xr-x 1 student student nov 23 19:18 quadVerifier |
||||
-rwxr-xr-x 1 student student nov 23 19:50 quadA |
||||
-rwxr-xr-x 1 student student nov 23 19:50 quadB |
||||
-rwxr-xr-x 1 student student nov 23 19:50 quadC |
||||
-rwxr-xr-x 1 student student nov 23 19:50 quadD |
||||
-rwxr-xr-x 1 student student nov 23 19:50 quadE |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ ./quadA 3 3 | ./quadVerifier |
||||
[quadA] [3] [3] |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ |
||||
``` |
||||
|
||||
- If it's `quadC 1 1` : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ ./quadC 1 1 |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ ./quadD 1 1 |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ ./quadE 1 1 |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ ./quadC 1 1 | ./quadVerifier |
||||
[quadC] [1] [1] || [quadD] [1] [1] || [quadE] [1] [1] |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ |
||||
``` |
||||
|
||||
- If it's `quadC 1 2` : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ ./quadE 1 2 |
||||
A |
||||
C |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ ./quadC 1 2 |
||||
A |
||||
C |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ ./quadE 1 2 | ./quadVerifier |
||||
[quadC] [1] [2] || [quadE] [1] [2] |
||||
student@ubuntu:~/[[ROOT]]/quadverifier$ |
||||
``` |
@ -0,0 +1,73 @@
|
||||
#### Quadrangle verifier |
||||
|
||||
##### Try running the program: `"./quadA 3 3 | ./quadVerifier"` |
||||
|
||||
``` |
||||
[quadA] [3] [3] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./quadB 3 3 | ./quadVerifier"` |
||||
|
||||
``` |
||||
[quadB] [3] [3] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./quadC 1 1 | ./quadVerifier"` |
||||
|
||||
``` |
||||
[quadC] [1] [1] || [quadD] [1] [1] || [quadE] [1] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./quadE 1 2 | ./quadVerifier"` |
||||
|
||||
``` |
||||
[quadC] [1] [2] || [quadE] [1] [2] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./quadE 2 1 | ./quadVerifier"` |
||||
|
||||
``` |
||||
[quadD] [2] [1] || [quadE] [2] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./quadC 2 1 | ./quadVerifier"` |
||||
|
||||
``` |
||||
[quadC] [2] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./quadD 1 2 | ./quadVerifier"` |
||||
|
||||
``` |
||||
[quadD] [1] [2] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./quadE 1 1 | ./quadVerifier"` |
||||
|
||||
``` |
||||
[quadC] [1] [1] || [quadD] [1] [1] || [quadE] [1] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"echo 0 0 | ./quadVerifier"` |
||||
|
||||
``` |
||||
Not a Raid function |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
@ -1,42 +0,0 @@
|
||||
## raid2 |
||||
|
||||
### Instructions |
||||
|
||||
- Create a program that resolves a sudoku. |
||||
|
||||
- A valid sudoku has only one possible solution. |
||||
|
||||
### Usage |
||||
|
||||
#### Example 1: |
||||
|
||||
Example of output for one valid sudoku : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/raid2$ go build |
||||
student@ubuntu:~/[[ROOT]]/raid2$ ./raid2 ".96.4...1" "1...6...4" "5.481.39." "..795..43" ".3..8...." "4.5.23.18" ".1.63..59" ".59.7.83." "..359...7" | cat -e |
||||
3 9 6 2 4 5 7 8 1$ |
||||
1 7 8 3 6 9 5 2 4$ |
||||
5 2 4 8 1 7 3 9 6$ |
||||
2 8 7 9 5 1 6 4 3$ |
||||
9 3 1 4 8 6 2 7 5$ |
||||
4 6 5 7 2 3 9 1 8$ |
||||
7 1 2 6 3 8 4 5 9$ |
||||
6 5 9 1 7 4 8 3 2$ |
||||
8 4 3 5 9 2 1 6 7$ |
||||
student@ubuntu:~/[[ROOT]]/raid2$ |
||||
``` |
||||
|
||||
#### Example 2: |
||||
|
||||
Examples of output for invalid input or sudokus : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/raid2$ ./raid2 1 2 3 4 | cat -e |
||||
Error$ |
||||
student@ubuntu:~/[[ROOT]]/raid2$ ./raid2 | cat -e |
||||
Error$ |
||||
student@ubuntu:~/[[ROOT]]/raid2$ ./raid2 ".96.4...1" "1...6.1.4" "5.481.39." "..795..43" ".3..8...." "4.5.23.18" ".1.63..59" ".59.7.83." "..359...7" | cat -e |
||||
Error$ |
||||
student@ubuntu:~/[[ROOT]]/raid2$ |
||||
``` |
@ -1,62 +0,0 @@
|
||||
## raid3 |
||||
|
||||
### Instructions |
||||
|
||||
This raid is based on the `raid1` functions. |
||||
|
||||
Create a program `raid3` that takes a `string` as an argument and displays the name of the matching `raid1` and its dimensions. |
||||
|
||||
- If the argument is not a `raid1` the program should print `Not a Raid function`. |
||||
|
||||
- All answers must end with a newline (`'\n'`). |
||||
|
||||
- If there is more than one `raid1` matches, the program must display them all alphabetically ordered and separated by a `||`. |
||||
|
||||
### Usage |
||||
|
||||
- If it's `raid1a` |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/raid3$ ls -l |
||||
-rw-r--r-- 1 student student nov 23 14:30 main.go |
||||
-rwxr-xr-x 1 student student nov 23 19:18 raid3 |
||||
-rwxr-xr-x 1 student student nov 23 19:50 raid1a |
||||
-rwxr-xr-x 1 student student nov 23 19:50 raid1b |
||||
-rwxr-xr-x 1 student student nov 23 19:50 raid1c |
||||
-rwxr-xr-x 1 student student nov 23 19:50 raid1d |
||||
-rwxr-xr-x 1 student student nov 23 19:50 raid1e |
||||
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1a 3 3 | ./raid3 |
||||
[raid1a] [3] [3] |
||||
student@ubuntu:~/[[ROOT]]/raid3$ |
||||
student@ubuntu:~/[[ROOT]]/raid3$ |
||||
student@ubuntu:~/[[ROOT]]/raid3$ |
||||
student@ubuntu:~/[[ROOT]]/raid3$ |
||||
``` |
||||
|
||||
- If it's `raidc 1 1` : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1c 1 1 |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1d 1 1 |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1e 1 1 |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1c 1 1 | ./raid3 |
||||
[raid1c] [1] [1] || [raid1d] [1] [1] || [raid1e] [1] [1] |
||||
student@ubuntu:~/[[ROOT]]/raid3$ |
||||
``` |
||||
|
||||
- If it's `raidc 1 2` : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1e 1 2 |
||||
A |
||||
C |
||||
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1c 1 2 |
||||
A |
||||
C |
||||
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1e 1 2 | ./raid3 |
||||
[raid1c] [1] [2] || [raid1e] [1] [2] |
||||
student@ubuntu:~/[[ROOT]]/raid3$ |
||||
``` |
@ -1,73 +0,0 @@
|
||||
#### Raid 3 |
||||
|
||||
##### Try running the program: `"./raid1a 3 3 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1a] [3] [3] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1b 3 3 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1b] [3] [3] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1c 1 1 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1c] [1] [1] || [raid1d] [1] [1] || [raid1e] [1] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1e 1 2 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1c] [1] [2] || [raid1e] [1] [2] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1e 2 1 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1d] [2] [1] || [raid1e] [2] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1c 2 1 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1c] [2] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1d 1 2 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1d] [1] [2] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1e 1 1 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1c] [1] [1] || [raid1d] [1] [1] || [raid1e] [1] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"echo 0 0 | ./raid3"` |
||||
|
||||
``` |
||||
Not a Raid function |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
@ -0,0 +1,42 @@
|
||||
## sudoku |
||||
|
||||
### Instructions |
||||
|
||||
- Create a program that resolves a sudoku. |
||||
|
||||
- A valid sudoku has only one possible solution. |
||||
|
||||
### Usage |
||||
|
||||
#### Example 1: |
||||
|
||||
Example of output for one valid sudoku : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/sudoku$ go build |
||||
student@ubuntu:~/[[ROOT]]/sudoku$ ./sudoku ".96.4...1" "1...6...4" "5.481.39." "..795..43" ".3..8...." "4.5.23.18" ".1.63..59" ".59.7.83." "..359...7" | cat -e |
||||
3 9 6 2 4 5 7 8 1$ |
||||
1 7 8 3 6 9 5 2 4$ |
||||
5 2 4 8 1 7 3 9 6$ |
||||
2 8 7 9 5 1 6 4 3$ |
||||
9 3 1 4 8 6 2 7 5$ |
||||
4 6 5 7 2 3 9 1 8$ |
||||
7 1 2 6 3 8 4 5 9$ |
||||
6 5 9 1 7 4 8 3 2$ |
||||
8 4 3 5 9 2 1 6 7$ |
||||
student@ubuntu:~/[[ROOT]]/sudoku$ |
||||
``` |
||||
|
||||
#### Example 2: |
||||
|
||||
Examples of output for invalid input or sudokus : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/sudoku$ ./sudoku 1 2 3 4 | cat -e |
||||
Error$ |
||||
student@ubuntu:~/[[ROOT]]/sudoku$ ./sudoku | cat -e |
||||
Error$ |
||||
student@ubuntu:~/[[ROOT]]/sudoku$ ./sudoku ".96.4...1" "1...6.1.4" "5.481.39." "..795..43" ".3..8...." "4.5.23.18" ".1.63..59" ".59.7.83." "..359...7" | cat -e |
||||
Error$ |
||||
student@ubuntu:~/[[ROOT]]/sudoku$ |
||||
``` |
@ -1,4 +1,4 @@
|
||||
#### Raid 2 |
||||
#### Sudoku |
||||
|
||||
##### Try running the program with the arguments: `"".96.4...1" "1...6...4" "5.481.39." "..795..43" ".3..8...." "4.5.23.18" ".1.63..59" ".59.7.83." "..359...7""` |
||||
|
Loading…
Reference in new issue