forked from root/public
LEEDASILVA
5 years ago
committed by
GitHub
60 changed files with 6915 additions and 12 deletions
@ -0,0 +1,81 @@
|
||||
## addlinkednumbers |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
You have two numbers represented by a linked list, where each NodeAddL contains a single digit. |
||||
The digits are stored in reverse order, such that the 1’s digit is at the head of the list. |
||||
Write a function that adds the two numbers and returns the sum as a linked list |
||||
|
||||
### Expected function and structure |
||||
|
||||
```go |
||||
package main |
||||
|
||||
type NodeAddL struct { |
||||
Next *NodeAddL |
||||
Num int |
||||
} |
||||
|
||||
func AddLinkedNumbers(num1, num1 *NodeAddL) *NodeAddL { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
) |
||||
|
||||
func pushFront(node *NodeAddL, num int) *NodeAddL { |
||||
// ... |
||||
// Write yourself |
||||
} |
||||
|
||||
func main() { |
||||
// 3 -> 1 -> 5 |
||||
num1 := &NodeAddL{Num:5} |
||||
num1 = pushFront(num1, 1) |
||||
num1 = pushFront(num1, 3) |
||||
|
||||
// 5 -> 9 -> 2 |
||||
num2 := &NodeAddL{Num:2} |
||||
num2 = pushFront(num2, 9) |
||||
num2 = pushFront(num2, 5) |
||||
|
||||
// 9 -> 0 -> 7 |
||||
result := AddLinkedNumbers(num1, num2) |
||||
for tmp := result; tmp != nil; tmp = tmp.Next { |
||||
fmt.Print(tmp.Num) |
||||
if tmp.Next != nil { |
||||
fmt.Print(" -> ") |
||||
} |
||||
} |
||||
fmt.Println() |
||||
} |
||||
``` |
||||
|
||||
An its output: |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./main |
||||
9 -> 0 -> 7 |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -0,0 +1,66 @@
|
||||
## anagram |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
Write a function that returns `true` if two strings are anagrams, otherwise returns `false`. |
||||
Anagram is a string made by using the letters of another string in a different order. |
||||
|
||||
Only lower case characters will be given. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
package piscine |
||||
|
||||
func IsAnagram(str1, str2 string) bool { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
import ( |
||||
piscine ".." |
||||
"fmt" |
||||
) |
||||
|
||||
func main() { |
||||
test1 := piscine.IsAnagram("listen", "silent") |
||||
fmt.Println(test1) |
||||
|
||||
test2 := piscine.IsAnagram("alem", "school") |
||||
fmt.Println(test2) |
||||
|
||||
test3 := piscine.IsAnagram("neat", "a net") |
||||
fmt.Println(test3) |
||||
|
||||
test4 := piscine.IsAnagram("anna madrigal", "a man and a girl") |
||||
fmt.Println(test4) |
||||
} |
||||
``` |
||||
|
||||
Its output: |
||||
|
||||
```bash |
||||
$> go build |
||||
$> ./main |
||||
true |
||||
false |
||||
true |
||||
true |
||||
``` |
@ -0,0 +1,23 @@
|
||||
## ascii-art-web-export |
||||
|
||||
### Objectives |
||||
|
||||
You must follow the same [principles](https://github.com/01-edu/public/ascii-art-web.en.md) as the first subject. |
||||
|
||||
Ascii-art-web-export consists on making sure that it is possible to export the output of the web application, at least in one export format at your choice. |
||||
|
||||
- You should be able to export the result of the [ascii-art](https://github.com/01-edu/public/ascii-art.en.md) project implemented in the website. |
||||
- The file must be exported with the right permissions (read and write) for the user. |
||||
|
||||
This project will help you learn about : |
||||
|
||||
- The basics of export formats : |
||||
- Portable Document Format (PDF) |
||||
- Text File (TXT) |
||||
- [Here are some more exemples](https://en.wikipedia.org/wiki/Document_file_format) |
||||
- Ways to receive data. |
||||
- Ways to output data. |
||||
|
||||
### Instructions |
||||
|
||||
- The web server must export at least in one export format. |
@ -0,0 +1,218 @@
|
||||
#### Functional Project Questions |
||||
|
||||
##### Try passing as argument "hello". |
||||
``` |
||||
_ _ _ |
||||
| | | | | | |
||||
| |__ ___ | | | | ___ |
||||
| _ \ / _ \ | | | | / _ \ |
||||
| | | | | __/ | | | | | (_) | |
||||
|_| |_| \___| |_| |_| \___/ |
||||
|
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing as argument "HELLO". |
||||
``` |
||||
_ _ ______ _ _ ____ |
||||
| | | | | ____| | | | | / __ \ |
||||
| |__| | | |__ | | | | | | | | |
||||
| __ | | __| | | | | | | | | |
||||
| | | | | |____ | |____ | |____ | |__| | |
||||
|_| |_| |______| |______| |______| \____/ |
||||
|
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing as argument "HeLlo HuMaN". |
||||
``` |
||||
_ _ _ _ _ _ __ __ _ _ |
||||
| | | | | | | | | | | | | \/ | | \ | | |
||||
| |__| | ___ | | | | ___ | |__| | _ _ | \ / | __ _ | \| | |
||||
| __ | / _ \ | | | | / _ \ | __ | | | | | | |\/| | / _` | | . ` | |
||||
| | | | | __/ | |____ | | | (_) | | | | | | |_| | | | | | | (_| | | |\ | |
||||
|_| |_| \___| |______| |_| \___/ |_| |_| \__,_| |_| |_| \__,_| |_| \_| |
||||
|
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing as argument "1Hello 2There". |
||||
``` |
||||
_ _ _ _ _______ _ |
||||
_ | | | | | | | | ____ |__ __| | | |
||||
/ | | |__| | ___ | | | | ___ |___ \ | | | |__ ___ _ __ ___ |
||||
| | | __ | / _ \ | | | | / _ \ __) | | | | _ \ / _ \ | '__| / _ \ |
||||
| | | | | | | __/ | | | | | (_) | / __/ | | | | | | | __/ | | | __/ |
||||
|_| |_| |_| \___| |_| |_| \___/ |_____| |_| |_| |_| \___| |_| \___| |
||||
|
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing as argument "Hello\nThere". |
||||
``` |
||||
_ _ _ _ |
||||
| | | | | | | | |
||||
| |__| | ___ | | | | ___ |
||||
| __ | / _ \ | | | | / _ \ |
||||
| | | | | __/ | | | | | (_) | |
||||
|_| |_| \___| |_| |_| \___/ |
||||
|
||||
|
||||
_______ _ |
||||
|__ __| | | |
||||
| | | |__ ___ _ __ ___ |
||||
| | | _ \ / _ \ | '__| / _ \ |
||||
| | | | | | | __/ | | | __/ |
||||
|_| |_| |_| \___| |_| \___| |
||||
|
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing "{Hello & There #}" as argument. |
||||
``` |
||||
__ _ _ _ _ _______ _ _ _ __ |
||||
/ / | | | | | | | | ___ |__ __| | | _| || |_ \ \ |
||||
| | | |__| | ___ | | | | ___ ( _ ) | | | |__ ___ _ __ ___ |_ __ _| | | |
||||
/ / | __ | / _ \ | | | | / _ \ / _ \/\ | | | _ \ / _ \ | '__| / _ \ _| || |_ \ \ |
||||
\ \ | | | | | __/ | | | | | (_) | | (_> < | | | | | | | __/ | | | __/ |_ __ _| / / |
||||
| | |_| |_| \___| |_| |_| \___/ \___/\/ |_| |_| |_| \___| |_| \___| |_||_| | | |
||||
\_\ /_/ |
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing "hello There 1 to 2!" as argument. |
||||
``` |
||||
_ _ _ _______ _ _ _ |
||||
| | | | | | |__ __| | | _ | | ____ | | |
||||
| |__ ___ | | | | ___ | | | |__ ___ _ __ ___ / | | |_ ___ |___ \ | | |
||||
| _ \ / _ \ | | | | / _ \ | | | _ \ / _ \ | '__| / _ \ | | | __| / _ \ __) | | | |
||||
| | | | | __/ | | | | | (_) | | | | | | | | __/ | | | __/ | | \ |_ | (_) | / __/ |_| |
||||
|_| |_| \___| |_| |_| \___/ |_| |_| |_| \___| |_| \___| |_| \__| \___/ |_____| (_) |
||||
|
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing "MaD3IrA&LiSboN" as argument. |
||||
``` |
||||
__ __ _____ _____ _ _ _____ _ _ _ |
||||
| \/ | | __ \ _____ |_ _| /\ ___ | | (_) / ____| | | | \ | | |
||||
| \ / | __ _ | | | | |___ / | | _ __ / \ ( _ ) | | _ | (___ | |__ ___ | \| | |
||||
| |\/| | / _` | | | | | |_ \ | | | '__| / /\ \ / _ \/\ | | | | \___ \ | '_ \ / _ \ | . ` | |
||||
| | | | | (_| | | |__| | ___) | _| |_ | | / ____ \ | (_> < | |____ | | ____) | | |_) | | (_) | | |\ | |
||||
|_| |_| \__,_| |_____/ |____/ |_____| |_| /_/ \_\ \___/\/ |______| |_| |_____/ |_.__/ \___/ |_| \_| |
||||
|
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing "1a\"#FdwHywR&/()=" as argument. |
||||
``` |
||||
_ _ _ _ ______ _ _ _ _____ __ __ __ |
||||
_ ( | ) _| || |_ | ____| | | | | | | | __ \ ___ / / / / \ \ ______ |
||||
/ | __ _ V V |_ __ _| | |__ __| | __ __ | |__| | _ _ __ __ | |__) | ( _ ) / / | | | | |______| |
||||
| | / _` | _| || |_ | __| / _` | \ \ /\ / / | __ | | | | | \ \ /\ / / | _ / / _ \/\ / / | | | | ______ |
||||
| | | (_| | |_ __ _| | | | (_| | \ V V / | | | | | |_| | \ V V / | | \ \ | (_> < / / | | | | |______| |
||||
|_| \__,_| |_||_| |_| \__,_| \_/\_/ |_| |_| \__, | \_/\_/ |_| \_\ \___/\/ /_/ | | | | |
||||
__/ / \_\ /_/ |
||||
|___/ |
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing "{|}~" as argument. |
||||
``` |
||||
__ _ __ /\/| |
||||
/ / | | \ \ |/\/ |
||||
| | | | | | |
||||
/ / | | \ \ |
||||
\ \ | | / / |
||||
| | | | | | |
||||
\_\ | | /_/ |
||||
|_| |
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing "[\]^_ \`a" as argument. |
||||
``` |
||||
___ __ ___ /\ _ |
||||
| _| \ \ |_ | |/\| ( ) |
||||
| | \ \ | | \| __ _ |
||||
| | \ \ | | / _` | |
||||
| | \ \ | | | (_| | |
||||
| |_ \_\ _| | \__,_| |
||||
|___| |___| ______ |
||||
|______| |
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing "RGB" as argument. |
||||
``` |
||||
_____ _____ ____ |
||||
| __ \ / ____| | _ \ |
||||
| |__) | | | __ | |_) | |
||||
| _ / | | |_ | | _ < |
||||
| | \ \ | |__| | | |_) | |
||||
|_| \_\ \_____| |____/ |
||||
|
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing ":;<=>?@" as argument. |
||||
``` |
||||
__ __ ___ |
||||
_ _ / / ______ \ \ |__ \ ____ |
||||
(_) (_) / / |______| \ \ ) | / __ \ |
||||
< < ______ > > / / / / _` | |
||||
_ _ \ \ |______| / / |_| | | (_| | |
||||
(_) ( ) \_\ /_/ (_) \ \__,_| |
||||
|/ \____/ |
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing "\!\" #$%&'()*+,-./" as argument. |
||||
``` |
||||
__ _ _ _ _ _ _ _ __ _ __ __ _ __ |
||||
\ \ | | ( | ) _| || |_ | | (_) / / ___ ( ) / / \ \ /\| |/\ _ / / |
||||
\ \ | | V V |_ __ _| / __) / / ( _ ) |/ | | | | \ ` ' / _| |_ ______ / / |
||||
\ \ | | _| || |_ \__ \ / / / _ \/\ | | | | |_ _| |_ _| |______| / / |
||||
\ \ |_| |_ __ _| ( / / / _ | (_> < | | | | / , . \ |_| _ _ / / |
||||
\_\ (_) |_||_| |_| /_/ (_) \___/\/ | | | | \/|_|\/ ( ) (_) /_/ |
||||
\_\ /_/ |/ |
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing "ABCDEFGHIJKLMNOQPRSTUVWXYZ" as argument. |
||||
``` |
||||
____ _____ _____ ______ ______ _____ _ _ _____ _ _ __ _ __ __ _ _ ____ _____ ____ _____ _____ _______ _ _ __ __ __ __ __ __ __ __ ______ |
||||
/\ | _ \ / ____| | __ \ | ____| | ____| / ____| | | | | |_ _| | | | |/ / | | | \/ | | \ | | / __ \ | __ \ / __ \ | __ \ / ____| |__ __| | | | | \ \ / / \ \ / / \ \ / / \ \ / / |___ / |
||||
/ \ | |_) | | | | | | | | |__ | |__ | | __ | |__| | | | | | | ' / | | | \ / | | \| | | | | | | |__) | | | | | | |__) | | (___ | | | | | | \ \ / / \ \ /\ / / \ V / \ \_/ / / / |
||||
/ /\ \ | _ < | | | | | | | __| | __| | | |_ | | __ | | | _ | | | < | | | |\/| | | . ` | | | | | | ___/ | | | | | _ / \___ \ | | | | | | \ \/ / \ \/ \/ / > < \ / / / |
||||
/ ____ \ | |_) | | |____ | |__| | | |____ | | | |__| | | | | | _| |_ | |__| | | . \ | |____ | | | | | |\ | | |__| | | | | |__| | | | \ \ ____) | | | | |__| | \ / \ /\ / / . \ | | / /__ |
||||
/_/ \_\ |____/ \_____| |_____/ |______| |_| \_____| |_| |_| |_____| \____/ |_|\_\ |______| |_| |_| |_| \_| \____/ |_| \___\_\ |_| \_\ |_____/ |_| \____/ \/ \/ \/ /_/ \_\ |_| /_____| |
||||
|
||||
|
||||
|
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
##### Try passing "abcdefghijklmnopqrstuvwxyz" as argument. |
||||
``` |
||||
_ _ __ _ _ _ _ _ |
||||
| | | | / _| __ _ | | (_) (_) _ | | | | |
||||
__ _ | |__ ___ __| | ___ | |_ / _` | | |__ _ _ | | _ | | _ __ ___ _ __ ___ _ __ __ _ _ __ ___ | |_ _ _ __ __ __ __ __ __ _ _ ____ |
||||
/ _` | | '_ \ / __| / _` | / _ \ | _| | (_| | | _ \ | | | | | |/ / | | | '_ ` _ \ | '_ \ / _ \ | '_ \ / _` | | '__| / __| | __| | | | | \ \ / / \ \ /\ / / \ \/ / | | | | |_ / |
||||
| (_| | | |_) | | (__ | (_| | | __/ | | \__, | | | | | | | | | | < | | | | | | | | | | | | | (_) | | |_) | | (_| | | | \__ \ \ |_ | |_| | \ V / \ V V / > < | |_| | / / |
||||
\__,_| |_.__/ \___| \__,_| \___| |_| __/ | |_| |_| |_| | | |_|\_\ |_| |_| |_| |_| |_| |_| \___/ | .__/ \__, | |_| |___/ \__| \__,_| \_/ \_/\_/ /_/\_\ \__, | /___| |
||||
|___/ _/ | | | | | __/ / |
||||
|__/ |_| |_| |___/ |
||||
``` |
||||
###### Does it display the right graphical representation in ASCII as above? |
||||
|
||||
#### Basic |
||||
|
||||
###### +Does the project runs quickly and effectively? (Favoring recursive, no unnecessary data requests, etc) |
||||
###### +Does the code obey the [good practices](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md)? |
||||
|
||||
###### +Is there a test file for this code? |
||||
###### +Are the tests checking each possible case? |
||||
###### +Is the output of the program well structured? Does any letter seems to be out of line? |
||||
|
||||
#### Social |
||||
|
||||
###### +Did you learn anything from this project? |
||||
###### +Can it be open-sourced / be used for other sources? |
||||
###### +Would you recommend/nominate this program as an example for the rest of the school? |
@ -0,0 +1,115 @@
|
||||
## ascii-art |
||||
|
||||
### Objectives |
||||
|
||||
Ascii-art consists on receiving a `string` has an argument and outputting the `string` in a graphic representation of ASCII. |
||||
|
||||
- This project should handle numbers, letters, spaces, special characters and `\n`. |
||||
- Take a look on the ASCII manual. |
||||
|
||||
This project will help you learn about : |
||||
|
||||
- Client utilities. |
||||
- The Go file system(**fs**) API. |
||||
- Ways to receive data. |
||||
- Ways to output data. |
||||
- Manipulation of strings. |
||||
- Manipulation of structures. |
||||
|
||||
### Instructions |
||||
|
||||
- Your project must be written in **Go**. |
||||
- The code must respect the [**good practices**](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md). |
||||
- It is recommended that the code should present a **test file**. |
||||
|
||||
- It will be given some [**banner**](https://github.com/01-edu/public/blob/master/subjects/ascii-art/standard.txt) files with a specific graphical template representation of ASCII. The files are formatted in a way that it is not necessary to change them. |
||||
|
||||
### Banner Format |
||||
|
||||
- Each character has an height of 8 lines. |
||||
- Characters are separate by a new line `\n`. |
||||
- Here is an example of ' ', '!' and '"'(one dot represents one space) : |
||||
|
||||
```console |
||||
|
||||
...... |
||||
...... |
||||
...... |
||||
...... |
||||
...... |
||||
...... |
||||
...... |
||||
...... |
||||
|
||||
._.. |
||||
|.|. |
||||
|.|. |
||||
|.|. |
||||
|_|. |
||||
(_). |
||||
.... |
||||
.... |
||||
|
||||
._._.. |
||||
(.|.). |
||||
.V.V.. |
||||
...... |
||||
...... |
||||
...... |
||||
...... |
||||
...... |
||||
|
||||
etc |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
student@ubuntu:~/ascii-art$ go build |
||||
student@ubuntu:~/ascii-art$ ./ascii-art "hello" |
||||
_ _ _ |
||||
| | | | | | |
||||
| |__ ___ | | | | ___ |
||||
| _ \ / _ \ | | | | / _ \ |
||||
| | | | | __/ | | | | | (_) | |
||||
|_| |_| \___| |_| |_| \___/ |
||||
|
||||
|
||||
student@ubuntu:~/ascii-art$ ./ascii-art "HeLlO" |
||||
_ _ _ _ ____ |
||||
| | | | | | | | / __ \ |
||||
| |__| | ___ | | | | | | | | |
||||
| __ | / _ \ | | | | | | | | |
||||
| | | | | __/ | |____ | | | |__| | |
||||
|_| |_| \___| |______| |_| \____/ |
||||
|
||||
|
||||
student@ubuntu:~/ascii-art$ ./ascii-art "Hello There" |
||||
_ _ _ _ _______ _ |
||||
| | | | | | | | |__ __| | | |
||||
| |__| | ___ | | | | ___ | | | |__ ___ _ __ ___ |
||||
| __ | / _ \ | | | | / _ \ | | | _ \ / _ \ | '__| / _ \ |
||||
| | | | | __/ | | | | | (_) | | | | | | | | __/ | | | __/ |
||||
|_| |_| \___| |_| |_| \___/ |_| |_| |_| \___| |_| \___| |
||||
|
||||
|
||||
student@ubuntu:~/ascii-art$ ./ascii-art "1Hello 2There" |
||||
_ _ _ _ _______ _ |
||||
_ | | | | | | | | ____ |__ __| | | |
||||
/ | | |__| | ___ | | | | ___ |___ \ | | | |__ ___ _ __ ___ |
||||
| | | __ | / _ \ | | | | / _ \ __) | | | | _ \ / _ \ | '__| / _ \ |
||||
| | | | | | | __/ | | | | | (_) | / __/ | | | | | | | __/ | | | __/ |
||||
|_| |_| |_| \___| |_| |_| \___/ |_____| |_| |_| |_| \___| |_| \___| |
||||
|
||||
|
||||
student@ubuntu:~/ascii-art$ ./ascii-art "{Hello There}" |
||||
__ _ _ _ _ _______ _ __ |
||||
/ / | | | | | | | | |__ __| | | \ \ |
||||
| | | |__| | ___ | | | | ___ | | | |__ ___ _ __ ___ | | |
||||
/ / | __ | / _ \ | | | | / _ \ | | | _ \ / _ \ | '__| / _ \ \ \ |
||||
\ \ | | | | | __/ | | | | | (_) | | | | | | | | __/ | | | __/ / / |
||||
| | |_| |_| \___| |_| |_| \___/ |_| |_| |_| \___| |_| \___| | | |
||||
\_\ /_/ |
||||
|
||||
student@ubuntu:~/ascii-art$ |
||||
``` |
@ -0,0 +1,36 @@
|
||||
#### Ascii-Color |
||||
|
||||
##### Try passing as arguments "hello world" --color=red. |
||||
###### Does it displays the expected result? |
||||
##### Try passing as arguments "1 + 1 = 2" --color=green. |
||||
###### Does it display the expected result? |
||||
##### Try passing as arguments "(%&) ??" --color=yellow. |
||||
###### Does it display the expected result? |
||||
##### Try specifying a set of letters to be colored (the second until the last letter). |
||||
###### Does it displays the expected result (the corresponding set of letters with that color)? |
||||
##### Try specifying letter to be colored(the second letter). |
||||
###### Does it displays the expected result (the corresponding letter with that color)? |
||||
##### Try specifying letter to be colored(just two letter). |
||||
###### Does it displays the expected result (the corresponding letters with that color)? |
||||
##### Try passing as arguments "HeY GuYs" --color=orange, in order to color "GuYs". |
||||
###### Does it display the expected result? |
||||
##### Try passing as arguments "RGB()" --color=blue, in order to color just the B. |
||||
###### Does it display the expected result? |
||||
|
||||
#### General Requirements |
||||
|
||||
##### +Is it easy/intuitive to specify letter(s) to be coloured? |
||||
##### +Can you use more than one color in the same string? |
||||
|
||||
#### Basic |
||||
|
||||
###### +Does the project runs quickly and effectively (Favoring of recursive, no unnecessary data requests, etc.)? |
||||
###### +Is the output of the program well structured? Does any letter seems to be out of line? |
||||
###### +Is there a test file for this code? |
||||
###### +Are the tests checking each possible case? |
||||
###### +Does the code obey the [good practices](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md)? |
||||
|
||||
#### Social |
||||
|
||||
###### +Did you learn anything from this project? |
||||
###### +Would you recommend/nominate this program as an example for the rest of the school? |
@ -0,0 +1,27 @@
|
||||
## ascii-art-color |
||||
|
||||
### Objectives |
||||
|
||||
You must follow the same [instructions](https://github.com/01-edu/public/blob/master/subjects/ascii-art/ascii-art.en.md) as in the first subject but with colors. |
||||
|
||||
- The output should manipulate colors using the **flag** `--color=<color>`, in which `--color` is the flag and `<color>` is the color of choice. |
||||
- The colors must respect the [RGB](https://en.wikipedia.org/wiki/RGB_color_model) concept. |
||||
- You should be able to specify a single or a set of letters you want to be colored (use your imagination for this one). |
||||
- If the letter isn't specified, the whole `string` should be colored. |
||||
|
||||
This project will help you learn about : |
||||
|
||||
- Client utilities. |
||||
- The Go file system(**fs**) API. |
||||
- RGB color model. |
||||
- Ways to receive data. |
||||
- Ways to output data. |
||||
- Manipulation of strings. |
||||
- Manipulation of colors on the terminal. |
||||
- Manipulation of structures. |
||||
|
||||
### Instructions |
||||
|
||||
- Your project must be written in **Go**. |
||||
- The code must respect the [**good practices**](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md). |
||||
- It is recommended that the code should present a **test file**. |
@ -0,0 +1,125 @@
|
||||
#### Functional Project Questions |
||||
|
||||
##### Try passing as arguments `"hello" standard` |
||||
``` |
||||
_ _ _ |
||||
| | | | | | |
||||
| |__ ___ | | | | ___ |
||||
| _ \ / _ \ | | | | / _ \ |
||||
| | | | | __/ | | | | | (_) | |
||||
|_| |_| \___| |_| |_| \___/ |
||||
|
||||
|
||||
``` |
||||
|
||||
###### Does it display the string in the right template as an ASCII art representation as above? |
||||
##### Try passing as arguments `"hello world" shadow` |
||||
``` |
||||
|
||||
_| _| _| _| _| |
||||
_|_|_| _|_| _| _| _|_| _| _| _| _|_| _| _|_| _| _|_|_| |
||||
_| _| _|_|_|_| _| _| _| _| _| _| _| _| _| _|_| _| _| _| |
||||
_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| |
||||
_| _| _|_|_| _| _| _|_| _| _| _|_| _| _| _|_|_| |
||||
|
||||
|
||||
``` |
||||
###### Does it display the string in the right template as an ASCII art representation as above? |
||||
##### Try passing as arguments `"nice 2 meet you" thinkertoy` |
||||
``` |
||||
|
||||
-- o |
||||
o o o | |
||||
o-o o-o o-o / o-O-o o-o o-o -o- o o o-o o o |
||||
| | | | |-' / | | | |-' |-' | | | | | | | |
||||
o o | o-o o-o o--o o o o o-o o-o o o--O o-o o--o |
||||
| |
||||
o--o |
||||
``` |
||||
###### Does it display the string in the right template as an ASCII art representation as above? |
||||
##### Try passing as arguments `"you & me" standard` |
||||
``` |
||||
|
||||
___ |
||||
_ _ ___ _ _ ( _ ) _ __ ___ ___ |
||||
| | | | / _ \ | | | | / _ \/\ | '_ ` _ \ / _ \ |
||||
| |_| | | (_) | | |_| | | (_> < | | | | | | | __/ |
||||
\__, | \___/ \__,_| \___/\/ |_| |_| |_| \___| |
||||
__/ / |
||||
|___/ |
||||
``` |
||||
###### Does it display the string in the right template as an ASCII art representation as above? |
||||
##### Try passing as arguments `"123" shadow` |
||||
``` |
||||
|
||||
_| _|_| _|_|_| |
||||
_|_| _| _| _| |
||||
_| _| _|_| |
||||
_| _| _| |
||||
_| _|_|_|_| _|_|_| |
||||
|
||||
|
||||
``` |
||||
###### Does it display the stirng in the right template as an ASCII art representation as above? |
||||
##### Try passing as arguments `"/(\")" thinkertoy` |
||||
``` |
||||
o o |
||||
o / | | \ |
||||
/ o o |
||||
o | | |
||||
/ o o |
||||
o \ / |
||||
|
||||
|
||||
``` |
||||
###### Does it display the stirng in the right template as an ASCII art representation as above? |
||||
##### Try passing as arguments `"ABCDEFGHIJKLMNOPQRSTUVWXYZ" shadow` |
||||
``` |
||||
|
||||
_|_| _|_|_| _|_|_| _|_|_| _|_|_|_| _|_|_|_| _|_|_| _| _| _|_|_| _| _| _| _| _| _| _| _| _|_| _|_|_| _|_| _|_|_| _|_|_| _|_|_|_|_| _| _| _| _| _| _| _| _| _| _| _|_|_|_|_| |
||||
_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _|_| _|_| _|_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| |
||||
_|_|_|_| _|_|_| _| _| _| _|_|_| _|_|_| _| _|_| _|_|_|_| _| _| _|_| _| _| _| _| _| _| _| _| _| _|_|_| _| _|_| _|_|_| _|_| _| _| _| _| _| _| _| _| _| _| _| |
||||
_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| |
||||
_| _| _|_|_| _|_|_| _|_|_| _|_|_|_| _| _|_|_| _| _| _|_|_| _|_| _| _| _|_|_|_| _| _| _| _| _|_| _| _|_| _| _| _| _|_|_| _| _|_| _| _| _| _| _| _| _|_|_|_|_| |
||||
|
||||
|
||||
``` |
||||
###### Does it display the stirng in the right template as an ASCII art representation as above? |
||||
##### Try passing as arguments `"\"#$%&/()*+,-./" thinkertoy` |
||||
``` |
||||
o o | | |
||||
| | | | -O-O- O o / \ o | o o |
||||
-O-O- o | | o / o / o o \|/ | / |
||||
| | -O-O- / /| o | | --O-- -o- o |
||||
-O-O- | | o / o o-O- / o o /|\ | o-o / |
||||
| | -O-O- O | o \ / o | o o O o |
||||
| | | |
||||
|
||||
``` |
||||
###### Does it display the stirng in the right template as an ASCII art representation as above? |
||||
##### Try passing as arguments `"It's Working" thinkertoy` |
||||
``` |
||||
o |
||||
o-O-o o | o o o |
||||
| | | | | / o |
||||
| -o- o-o o o o o-o o-o OO o-o o--o |
||||
| | \ \ / \ / | | | | \ | | | | | |
||||
o-O-o o o-o o o o-o o o o | o o o--O |
||||
| |
||||
o--o |
||||
``` |
||||
###### Does it display the stirng in the right template as an ASCII art representation as above? |
||||
###### Is the file system well organized? |
||||
|
||||
#### Basic |
||||
|
||||
###### +Does the project runs quickly and effectively (Favoring of recursive, no unnecessary data requests, etc.)? |
||||
###### +Is the output of the program well structured? Does any letter seems to be out of line? |
||||
###### +Is there a test file for this code? |
||||
###### +Are the tests checking each possible case? |
||||
###### +Does the code obey the [good practices](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md)? |
||||
|
||||
#### Social |
||||
|
||||
###### +Did you learn anything from this project? |
||||
###### +Would you recommend/nominate this program as an example for the rest of the school? |
@ -0,0 +1,55 @@
|
||||
## ascii-art-fs |
||||
|
||||
### Objectives |
||||
|
||||
You must follow the same [instructions](https://github.com/01-edu/public/blob/master/subjects/ascii-art/ascii-art.en.md) as in the first subject but the second argument must be the name of the template. |
||||
|
||||
This project will help you learn about : |
||||
|
||||
- Client utilities. |
||||
- The Go file system(**fs**) API. |
||||
- Ways to receive data. |
||||
- Ways to output data. |
||||
- Manipulation of strings. |
||||
- Manipulation of structures. |
||||
|
||||
### Instructions |
||||
|
||||
- Your project must be written in **Go**. |
||||
- The code must respect the [**good practices**](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md). |
||||
- It is recommended that the code should present a **test file**. |
||||
- You can see all about the **banners** [here](https://github.com/01-edu/public/tree/master/subjects/ascii-art). |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
student@ubuntu:~/ascii-art$ go build |
||||
student@ubuntu:~/ascii-art$ ./ascii-art "hello" standard |
||||
_ _ _ |
||||
| | | | | | |
||||
| |__ ___ | | | | ___ |
||||
| _ \ / _ \ | | | | / _ \ |
||||
| | | | | __/ | | | | | (_) | |
||||
|_| |_| \___| |_| |_| \___/ |
||||
|
||||
|
||||
student@ubuntu:~/ascii-art$ ./ascii-art "Hello There" shadow |
||||
|
||||
_| _| _| _| _|_|_|_|_| _| _| |
||||
_| _| _|_| _| _| _|_| _| _|_|_| _|_| _| _|_| _|_| _| |
||||
_|_|_|_| _|_|_|_| _| _| _| _| _| _| _| _|_|_|_| _|_| _|_|_|_| _| |
||||
_| _| _| _| _| _| _| _| _| _| _| _| _| |
||||
_| _| _|_|_| _| _| _|_| _| _| _| _|_|_| _| _|_|_| _| |
||||
|
||||
|
||||
student@ubuntu:~/ascii-art$ ./ascii-art "Hello There" thinkertoy |
||||
|
||||
o o o o o-O-o o |
||||
| | | | | | o |
||||
O--O o-o | | o-o | O--o o-o o-o o-o | |
||||
| | |-' | | | | | | | |-' | |-' o |
||||
o o o-o o o o-o o o o o-o o o-o |
||||
O |
||||
|
||||
student@ubuntu:~/ascii-art$ |
||||
``` |
@ -0,0 +1,35 @@
|
||||
#### Functional Project Questions |
||||
|
||||
##### Try passing as arguments `"left" --align=right` |
||||
###### Does it displays the correct result at the right side? |
||||
##### Try passing as arguments `"right" --align=left` |
||||
###### Does it displays the correct result at the left side? |
||||
##### Try passing as arguments `"hello" --align=center` |
||||
###### Does it displays the correct result at the center? |
||||
##### Try passing as arguments `"1 Two 4" --align=justify` |
||||
###### Does it displays the correct result justified? |
||||
##### Try passing as arguments `"23/32" --align=right` |
||||
###### Does it displays the correct result at the right side? |
||||
##### Try passing as arguments `"ABCabc123" --align=right` |
||||
###### Does it displays the correct result at the right side? |
||||
##### Try passing as arguments `"!#$%&" --align=center` |
||||
###### Does it displays the correct result at the center? |
||||
##### Try passing as arguments `"23Hello World!" --align=left` |
||||
###### Does it displays the correct result at the left side? |
||||
##### Try passing as arguments `"HELLO there HOW are YOU?!" --align=justify` |
||||
###### Does it displays the correct result justified? |
||||
##### Try passing as arguments `"a -> A b -> B c -> C" --align=right` |
||||
###### Does it displays the correct result at the right side? |
||||
|
||||
#### Basic |
||||
|
||||
###### +Does the project runs quickly and effectively (Favoring of recursive, no unnecessary data requests, etc.)? |
||||
###### +Is the output of the program well structured? Does any letter seems to be out of line? |
||||
###### +Is there a test file for this code? |
||||
###### +Are the tests checking each possible case? |
||||
###### +Does the code obey the [good practices](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md)? |
||||
|
||||
#### Social |
||||
|
||||
###### +Did you learn anything from this project? |
||||
###### +Would you recommend/nominate this program as an example for the rest of the school? |
@ -0,0 +1,68 @@
|
||||
## ascii-art-justify |
||||
|
||||
### Objectives |
||||
|
||||
You must follow the same [instructions](https://github.com/01-edu/public/blob/master/subjects/ascii-art/ascii-art.en.md) as in the first subject but the representation should be formatted using a **flag** `--align=<type>`, in which `type` can be : |
||||
|
||||
- center |
||||
- left |
||||
- right |
||||
- justify |
||||
|
||||
This project will help you learn about : |
||||
|
||||
- Client utilities. |
||||
- The Go file system(**fs**) API. |
||||
- Ways to receive data. |
||||
- Ways to output data. |
||||
- Manipulation of strings. |
||||
- Manipulation of structures. |
||||
|
||||
### Instructions |
||||
|
||||
- Your project must be written in **Go**. |
||||
- The code must respect the [**good practices**](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md). |
||||
- It is recommended that the code should present a **test file**. |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
|student@ubuntu:~/ascii-art$ go build | |
||||
|student@ubuntu:~/ascii-art$ ./ascii-art "hello" standard --align=center | |
||||
| _ _ _ | |
||||
| | | | | | | | |
||||
| | |__ ___ | | | | ___ | |
||||
| | _ \ / _ \ | | | | / _ \ | |
||||
| | | | | | __/ | | | | | (_) | | |
||||
| |_| |_| \___| |_| |_| \___/ | |
||||
| | |
||||
| | |
||||
|student@ubuntu:~/ascii-art$ ./ascii-art "Hello There" standard --align=left | |
||||
| _ _ _ _ _______ _ | |
||||
|| | | | | | | | |__ __| | | | |
||||
|| |__| | ___ | | | | ___ | | | |__ ___ _ __ ___ | |
||||
|| __ | / _ \ | | | | / _ \ | | | _ \ / _ \ | '__| / _ \ | |
||||
|| | | | | __/ | | | | | (_) | | | | | | | | __/ | | | __/ | |
||||
||_| |_| \___| |_| |_| \___/ |_| |_| |_| \___| |_| \___| | |
||||
| | |
||||
| | |
||||
|student@ubuntu:~/ascii-art$ ./ascii-art "hello" shadow --align=right | |
||||
| | |
||||
| _| _| _| | |
||||
| _|_|_| _|_| _| _| _|_| | |
||||
| _| _| _|_|_|_| _| _| _| _| | |
||||
| _| _| _| _| _| _| _| | |
||||
| _| _| _|_|_| _| _| _|_| | |
||||
| | |
||||
| | |
||||
|student@ubuntu:~/ascii-art$ ./ascii-art "hello" shadow --align=justify | |
||||
| | |
||||
|_| | |
||||
|_|_|_| _|_| _| _| _| _|_|_| _| _|_| _|_| _| _| _|_| _| _| | |
||||
|_| _| _| _| _| _| _| _| _| _|_| _|_|_|_| _| _| _| _| _| _| | |
||||
|_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| | |
||||
|_| _| _|_| _| _| _|_|_| _| _|_|_| _|_|_| _|_| _|_|_| | |
||||
| _| | |
||||
| _|_| | |
||||
|student@ubuntu:~/ascii-art$ | |
||||
``` |
@ -0,0 +1,138 @@
|
||||
#### Functional Project Questions |
||||
|
||||
##### Try passing as arguments `"First\nTest" shadow --output=test00.txt` |
||||
``` |
||||
student$ cat test00.txt |
||||
|
||||
_|_|_|_| _| _| |
||||
_| _| _|_| _|_|_| _|_|_|_| |
||||
_|_|_| _| _|_| _|_| _| |
||||
_| _| _| _|_| _| |
||||
_| _| _| _|_|_| _|_| |
||||
|
||||
|
||||
|
||||
_|_|_|_|_| _| |
||||
_| _|_| _|_|_| _|_|_|_| |
||||
_| _|_|_|_| _|_| _| |
||||
_| _| _|_| _| |
||||
_| _|_|_| _|_|_| _|_| |
||||
|
||||
|
||||
|
||||
``` |
||||
###### Does it save the right output in the right file? |
||||
##### Try passing as arguments `"hello" standard --output=test01.txt` |
||||
``` |
||||
student$ cat test01.txt |
||||
_ _ _ |
||||
| | | | | | |
||||
| |__ ___ | | | | ___ |
||||
| _ \ / _ \ | | | | / _ \ |
||||
| | | | | __/ | | | | | (_) | |
||||
|_| |_| \___| |_| |_| \___/ |
||||
|
||||
|
||||
|
||||
``` |
||||
###### Does it save the right output in the right file? |
||||
##### Try passing as arguments `"123 -> #$%" standard --output=test02.txt` |
||||
``` |
||||
student$ cat test02.txt |
||||
__ _ _ _ _ __ |
||||
_ ____ _____ \ \ _| || |_ | | (_) / / |
||||
/ | |___ \ |___ / ______ \ \ |_ __ _| / __) / / |
||||
| | __) | |_ \ |______| > > _| || |_ \__ \ / / |
||||
| | / __/ ___) | / / |_ __ _| ( / / / _ |
||||
|_| |_____| |____/ /_/ |_||_| |_| /_/ (_) |
||||
|
||||
|
||||
|
||||
``` |
||||
###### Does it save the right output in the right file? |
||||
##### Try passing as arguments `"432 -> #$%&@" shadow --output=test03.txt` |
||||
``` |
||||
student$ cat test03.txt |
||||
|
||||
_| _| _|_|_| _|_| _| _| _| _| _|_| _| _| _|_|_|_|_| |
||||
_| _| _| _| _| _| _|_|_|_|_| _|_|_| _|_| _| _| _| _| _| |
||||
_|_|_|_| _|_| _| _|_|_|_|_| _| _| _| _|_| _| _|_| _| _| _|_|_| _| |
||||
_| _| _| _| _|_|_|_|_| _|_| _| _|_| _| _| _| _| _| _| |
||||
_| _|_|_| _|_|_|_| _| _| _| _|_|_| _| _|_| _|_| _| _| _|_|_|_| |
||||
_| _| |
||||
_|_|_|_|_|_| |
||||
|
||||
``` |
||||
###### Does it save the right output in the right file? |
||||
##### Try passing as arguments `"There" shadow --output=test04.txt` |
||||
``` |
||||
student$ cat test04.txt |
||||
|
||||
_|_|_|_|_| _| |
||||
_| _|_|_| _|_| _| _|_| _|_| |
||||
_| _| _| _|_|_|_| _|_| _|_|_|_| |
||||
_| _| _| _| _| _| |
||||
_| _| _| _|_|_| _| _|_|_| |
||||
|
||||
|
||||
|
||||
``` |
||||
###### Does it save the right output in the right file? |
||||
##### Try passing as arguments `"123 -> \"#$%@" thinkertoy --output=test05.txt` |
||||
``` |
||||
student$ cat test05.txt |
||||
o o | | |
||||
0 -- o-o o | | | | -O-O- O o |
||||
/| o o | \ -O-O- o | | o / / \ |
||||
o | / oo O | | -O-O- / o O-o |
||||
| / | o-o / -O-O- | | o / o \ |
||||
o-o-o o--o o-o o | | -O-O- O o- |
||||
| | |
||||
|
||||
|
||||
``` |
||||
###### Does it save the right output in the right file? |
||||
##### Try passing as arguments `"2 you" thinkertoy --output=test06.txt` |
||||
``` |
||||
student$ cat test06.txt |
||||
|
||||
-- |
||||
o o |
||||
/ o o o-o o o |
||||
/ | | | | | | |
||||
o--o o--O o-o o--o |
||||
| |
||||
o--o |
||||
|
||||
``` |
||||
###### Does it save the right output in the right file? |
||||
##### Try passing as arguments `"Testing long output!" standard --output=test07.txt` |
||||
``` |
||||
student$ cat test07.txt |
||||
_______ _ _ _ _ _ _ |
||||
|__ __| | | (_) __ _ | | __ _ | | | | | | |
||||
| | ___ ___ | |_ _ _ __ / _` | | | ___ _ __ / _` | ___ _ _ | |_ _ __ _ _ | |_ | | |
||||
| | / _ \ / __| | __| | | | '_ \ | (_| | | | / _ \ | '_ \ | (_| | / _ \ | | | | | __| | '_ \ | | | | | __| | | |
||||
| | | __/ \__ \ \ |_ | | | | | | \__, | | | | (_) | | | | | \__, | | (_) | | |_| | \ |_ | |_) | | |_| | \ |_ |_| |
||||
|_| \___| |___/ \__| |_| |_| |_| __/ | |_| \___/ |_| |_| __/ | \___/ \__,_| \__| | .__/ \__,_| \__| (_) |
||||
|___/ |___/ | | |
||||
|_| |
||||
|
||||
``` |
||||
###### Does it save the right output in the right file? |
||||
|
||||
###### Does it save the right output in the right file? |
||||
###### Are all the test files saved? |
||||
|
||||
#### Basic |
||||
|
||||
###### +Does the project runs quickly and effectively (Favoring of recursive, no unnecessary data requests, etc.)? |
||||
###### +Is the output of the program well structured? Does any letter seems to be out of line? |
||||
###### +Is there a test file for this code? |
||||
###### +Are the tests checking each possible case? |
||||
###### +Does the code obey the [good practices](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md)? |
||||
|
||||
#### Social |
||||
|
||||
###### +Did you learn anything from this project? |
||||
###### +Would you recommend/nominate this program as an example for the rest of the school? |
@ -0,0 +1,49 @@
|
||||
## ascii-art-output |
||||
|
||||
### Objectives |
||||
|
||||
- You must follow the same [instructions](https://github.com/01-edu/public/blob/master/subjects/ascii-art/ascii-art.en.md) as in the first subject but writing the result into a file. |
||||
|
||||
- The file must be named by using the flag `--output=<fileName.txt>`, in which `--output` is the flag and `<fileName.txt>` is the file name. |
||||
|
||||
This project will help you learn about : |
||||
|
||||
- Client utilities. |
||||
- The Go file system(**fs**) API. |
||||
- Ways to receive data. |
||||
- Ways to output data. |
||||
- Manipulation of strings. |
||||
- Learning about the choice of outputs. |
||||
|
||||
### Instructions |
||||
|
||||
- Your project must be written in **Go**. |
||||
- The code must respect the [**good practices**](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md). |
||||
- It is recommended that the code should present a **test file**. |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
student@ubuntu:~/ascii-art$ go build |
||||
student@ubuntu:~/ascii-art$ ./ascii-art "hello" standard --output=banner.txt |
||||
student@ubuntu:~/ascii-art$ cat banner.txt |
||||
_ _ _ |
||||
| | | | | | |
||||
| |__ ___ | | | | ___ |
||||
| _ \ / _ \ | | | | / _ \ |
||||
| | | | | __/ | | | | | (_) | |
||||
|_| |_| \___| |_| |_| \___/ |
||||
|
||||
|
||||
student@ubuntu:~/ascii-art$ ./ascii-art "Hello There!" shadow --output=banner.txt |
||||
student@ubuntu:~/ascii-art$ cat banner.txt |
||||
|
||||
_| _| _| _| _|_|_|_|_| _| _| |
||||
_| _| _|_| _| _| _|_| _| _|_|_| _|_| _| _|_| _|_| _| |
||||
_|_|_|_| _|_|_|_| _| _| _| _| _| _| _| _|_|_|_| _|_| _|_|_|_| _| |
||||
_| _| _| _| _| _| _| _| _| _| _| _| _| |
||||
_| _| _|_|_| _| _| _|_| _| _| _| _|_|_| _| _|_|_| _| |
||||
|
||||
|
||||
student@ubuntu:~/ascii-art$ |
||||
``` |
@ -0,0 +1,115 @@
|
||||
## ascii-reverse-examples |
||||
|
||||
- Create your file and copy the examples into it. |
||||
|
||||
### example00 |
||||
|
||||
```console |
||||
_ _ _ _ __ __ _ _ |
||||
| | | | | | | | \ \ / / | | | | |
||||
| |__| | ___ | | | | ___ \ \ /\ / / ___ _ __ | | __| | |
||||
| __ | / _ \ | | | | / _ \ \ \/ \/ / / _ \ | '__| | | / _` | |
||||
| | | | | __/ | | | | | (_) | \ /\ / | (_) | | | | | | (_| | |
||||
|_| |_| \___| |_| |_| \___/ \/ \/ \___/ |_| |_| \__,_| |
||||
|
||||
|
||||
|
||||
``` |
||||
|
||||
### example01 |
||||
|
||||
```console |
||||
|
||||
_ ____ _____ |
||||
/ | |___ \ |___ / |
||||
| | __) | |_ \ |
||||
| | / __/ ___) | |
||||
|_| |_____| |____/ |
||||
|
||||
|
||||
|
||||
``` |
||||
|
||||
### example02 |
||||
|
||||
```console |
||||
___ |
||||
_ _ __ | _| |
||||
_| || |_ ______ \ \ | | |
||||
|_ __ _| |______| \ \ | | |
||||
_| || |_ ______ \ \ | | |
||||
|_ __ _| |______| \ \ | |_ |
||||
|_||_| \_\ |___| |
||||
|
||||
|
||||
``` |
||||
|
||||
### example03 |
||||
|
||||
```console |
||||
__ _ _ _ __ |
||||
/ / | | | | (_) __ _ ___ ____ _____ _ _ \ \ |
||||
| | ___ ___ _ __ | |_ | |__ _ _ __ ___ / _` | ( _ ) |___ \ |___ / | || | | | |
||||
| | / __| / _ \ | '_ \ | __| | _ \ | | | '_ ` _ \ | (_| | / _ \/\ __) | |_ \ | || |_ | | |
||||
| | \__ \ | (_) | | | | | \ |_ | | | | | | | | | | | | \__, | | (_> < / __/ ___) | |__ _| | | |
||||
| | |___/ \___/ |_| |_| \__| |_| |_| |_| |_| |_| |_| __/ | \___/\/ |_____| |____/ |_| | | |
||||
\_\ |___/ /_/ |
||||
|
||||
|
||||
``` |
||||
|
||||
### example04 |
||||
|
||||
```console |
||||
_ _ __ _ _ _ _ _ |
||||
| | | | / _| __ _ | | (_) (_) _ | | | | |
||||
__ _ | |__ ___ __| | ___ | |_ / _` | | |__ _ _ | | _ | | _ __ ___ _ __ ___ _ __ __ _ _ __ ___ | |_ _ _ __ __ __ __ __ __ _ _ ____ |
||||
/ _` | | '_ \ / __| / _` | / _ \ | _| | (_| | | _ \ | | | | | |/ / | | | '_ ` _ \ | '_ \ / _ \ | '_ \ / _` | | '__| / __| | __| | | | | \ \ / / \ \ /\ / / \ \/ / | | | | |_ / |
||||
| (_| | | |_) | | (__ | (_| | | __/ | | \__, | | | | | | | | | | < | | | | | | | | | | | | | (_) | | |_) | | (_| | | | \__ \ \ |_ | |_| | \ V / \ V V / > < | |_| | / / |
||||
\__,_| |_.__/ \___| \__,_| \___| |_| __/ | |_| |_| |_| | | |_|\_\ |_| |_| |_| |_| |_| |_| \___/ | .__/ \__, | |_| |___/ \__| \__,_| \_/ \_/\_/ /_/\_\ \__, | /___| |
||||
|___/ _/ | | | | | __/ / |
||||
|__/ |_| |_| |___/ |
||||
|
||||
``` |
||||
|
||||
### example05 |
||||
|
||||
```console |
||||
__ _ _ _ _ _ _ _ __ _ __ __ _ __ |
||||
\ \ | | ( | ) _| || |_ | | (_) / / ___ ( ) / / \ \ /\| |/\ _ / / |
||||
\ \ | | V V |_ __ _| / __) / / ( _ ) |/ | | | | \ ` ' / _| |_ ______ / / |
||||
\ \ | | _| || |_ \__ \ / / / _ \/\ | | | | |_ _| |_ _| |______| / / |
||||
\ \ |_| |_ __ _| ( / / / _ | (_> < | | | | / , . \ |_| _ _ / / |
||||
\_\ (_) |_||_| |_| /_/ (_) \___/\/ | | | | \/|_|\/ ( ) (_) /_/ |
||||
\_\ /_/ |/ |
||||
|
||||
|
||||
``` |
||||
|
||||
### example06 |
||||
|
||||
```console |
||||
__ __ ___ |
||||
_ _ / / ______ \ \ |__ \ ____ |
||||
(_) (_) / / |______| \ \ ) | / __ \ |
||||
< < ______ > > / / / / _` | |
||||
_ _ \ \ |______| / / |_| | | (_| | |
||||
(_) ( ) \_\ /_/ (_) \ \__,_| |
||||
|/ \____/ |
||||
|
||||
|
||||
``` |
||||
|
||||
### example07 |
||||
|
||||
```console |
||||
____ _____ _____ ______ ______ _____ _ _ _____ _ _ __ _ __ __ _ _ ____ _____ ____ _____ _____ _______ _ _ __ __ __ __ __ __ __ __ ______ |
||||
/\ | _ \ / ____| | __ \ | ____| | ____| / ____| | | | | |_ _| | | | |/ / | | | \/ | | \ | | / __ \ | __ \ / __ \ | __ \ / ____| |__ __| | | | | \ \ / / \ \ / / \ \ / / \ \ / / |___ / |
||||
/ \ | |_) | | | | | | | | |__ | |__ | | __ | |__| | | | | | | ' / | | | \ / | | \| | | | | | | |__) | | | | | | |__) | | (___ | | | | | | \ \ / / \ \ /\ / / \ V / \ \_/ / / / |
||||
/ /\ \ | _ < | | | | | | | __| | __| | | |_ | | __ | | | _ | | | < | | | |\/| | | . ` | | | | | | ___/ | | | | | _ / \___ \ | | | | | | \ \/ / \ \/ \/ / > < \ / / / |
||||
/ ____ \ | |_) | | |____ | |__| | | |____ | | | |__| | | | | | _| |_ | |__| | | . \ | |____ | | | | | |\ | | |__| | | | | |__| | | | \ \ ____) | | | | |__| | \ / \ /\ / / . \ | | / /__ |
||||
/_/ \_\ |____/ \_____| |_____/ |______| |_| \_____| |_| |_| |_____| \____/ |_|\_\ |______| |_| |_| |_| \_| \____/ |_| \___\_\ |_| \_\ |_____/ |_| \____/ \/ \/ \/ /_/ \_\ |_| /_____| |
||||
|
||||
|
||||
|
||||
``` |
@ -0,0 +1,41 @@
|
||||
#### Functional Project Questions |
||||
|
||||
##### Try passing to the reverse flag (--reverse=example00.txt) the example 00 (github.com/public/subject/ascii-art/ascii-reverse-example.md). |
||||
`Hello World` |
||||
###### Does it display the value above? |
||||
##### Try passing to the reverse flag (--reverse=example01.txt) the example 01 (github.com/public/subject/ascii-art/ascii-reverse-example.md). |
||||
`123` |
||||
###### Does it display the value above? |
||||
##### Try passing to the reverse flag (--reverse=example02.txt) the example 02 (github.com/public/subject/ascii-art/ascii-reverse-example.md). |
||||
`#=\[` |
||||
###### Does it display the value above? |
||||
##### Try passing to the reverse flag (--reverse=example03.txt) the example 03 (github.com/public/subject/ascii-art/ascii-reverse-example.md). |
||||
`(somthing&234)` |
||||
###### Does it display the value above? |
||||
##### Try passing to the reverse flag (--reverse=example04.txt) the example 04 (github.com/public/subject/ascii-art/ascii-reverse-example.md). |
||||
`abcdefghijklmnopqrstuvwxyz` |
||||
###### Does it display the value above? |
||||
##### Try passing to the reverse flag (--reverse=example05.txt) the example 05 (github.com/public/subject/ascii-art/ascii-reverse-example.md). |
||||
`\!" #$%&'()*+,-./` |
||||
###### Does it display the value above? |
||||
##### Try passing to the reverse flag (--reverse=example06.txt) the example 06 (github.com/public/subject/ascii-art/ascii-reverse-example.md). |
||||
`:;<=>?@` |
||||
###### Does it display the value above? |
||||
##### Try passing to the reverse flag (--reverse=example07.txt) the example 07 (github.com/public/subject/ascii-art/ascii-reverse-example.md). |
||||
`ABCDEFGHIJKLMNOPQRSTUVWXYZ` |
||||
###### Does it display the value above? |
||||
|
||||
#### Basic |
||||
|
||||
###### +Does the project runs quickly and effectively? (Favoring recursive, no unnecessary data requests, etc) |
||||
###### +Does the code obey the [good practices](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md)? |
||||
|
||||
###### +Is there a test file for this code? |
||||
###### +Are the tests checking each possible case? |
||||
###### +Is the output of the program well structured? Does any letter seems to be out of line? |
||||
|
||||
#### Social |
||||
|
||||
###### +Did you learn anything from this project? |
||||
###### +Can it be open-sourced / be used for other sources? |
||||
###### +Would you recommend/nominate this program as an example for the rest of the school? |
@ -0,0 +1,44 @@
|
||||
## ascii-reverse |
||||
|
||||
### Objectives |
||||
|
||||
You must follow the same [instructions](https://github.com/01-edu/public/blob/master/subjects/ascii-art/ascii-art.en.md) as in the first subject. |
||||
|
||||
- Ascii-reverse consists on reversing the process, converting the graphic representation into a text. |
||||
- You will have to create a text file containing a graphic representation of a random `string`. |
||||
- The argument will be a **flag**, `--reverse=<fileName>`, in which `--reverse` is the flag and `<fileName>` is the file name. |
||||
- The program must print this `string` in **normal text**. |
||||
|
||||
This project will help you learn about : |
||||
|
||||
- Client utilities. |
||||
- The Go file system(**fs**) API. |
||||
- Ways to receive data. |
||||
- Ways to output data. |
||||
- Manipulation of strings. |
||||
- Manipulation of structures. |
||||
|
||||
### Instructions |
||||
|
||||
- Your project must be written in **Go**. |
||||
- The code must respect the [**good practices**](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md). |
||||
- It is recommended that the code should present a **test file**. |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
student@ubuntu:~/ascii-art$ go build |
||||
student@ubuntu:~/ascii-art$ cat file.txt |
||||
_ _ _ |
||||
| | | | | | |
||||
| |__ ___ | | | | ___ |
||||
| _ \ / _ \ | | | | / _ \ |
||||
| | | | | __/ | | | | | (_) | |
||||
|_| |_| \___| |_| |_| \___/ |
||||
|
||||
|
||||
|
||||
student@ubuntu:~/ascii-art$ ./ascii-art --reverse=file.txt |
||||
hello |
||||
student@ubuntu:~/ascii-art$ |
||||
``` |
@ -0,0 +1,855 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
_| |
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_|_|_|_|_| |
||||
_| _| |
||||
_|_|_|_|_| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_|_|_| |
||||
_|_| |
||||
_|_| |
||||
_|_|_| |
||||
_| |
||||
|
||||
|
||||
|
||||
_|_| _| |
||||
_|_| _| |
||||
_| |
||||
_| _|_| |
||||
_| _|_| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| _| |
||||
_|_| _| |
||||
_| _| |
||||
_|_| _| |
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
_| _| _| |
||||
_|_|_| |
||||
_|_|_|_|_| |
||||
_|_|_| |
||||
_| _| _| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_|_|_|_|_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_|_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_|_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_| |
||||
_| _| |
||||
_| |
||||
_| |
||||
_|_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| |
||||
_|_| |
||||
_| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_|_|_|_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_|_| |
||||
_| |
||||
_|_|_| |
||||
_| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| |
||||
_|_|_| |
||||
_| _| |
||||
_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_|_|_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_| |
||||
_| _| |
||||
_|_| |
||||
_| _| |
||||
_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_| |
||||
_| _| |
||||
_|_|_| |
||||
_| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
|
||||
|
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
|
||||
|
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_|_|_|_| |
||||
|
||||
_|_|_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_| |
||||
_| |
||||
_|_| |
||||
|
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_|_|_| |
||||
_| _| |
||||
_| _|_|_| _| |
||||
_| _| _| _| |
||||
_| _|_|_|_| |
||||
_| |
||||
_|_|_|_|_|_| |
||||
|
||||
|
||||
_|_| |
||||
_| _| |
||||
_|_|_|_| |
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| _| |
||||
_|_|_| |
||||
_| _| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| |
||||
_| |
||||
_| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_|_| |
||||
_| |
||||
_|_|_| |
||||
_| |
||||
_|_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_|_| |
||||
_| |
||||
_|_|_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| |
||||
_| _|_| |
||||
_| _| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_|_|_|_| |
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| |
||||
_| |
||||
_| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| _| |
||||
_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_|_| |
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_|_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_|_| _|_| |
||||
_| _| _| |
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_|_| _| |
||||
_| _| _| |
||||
_| _|_| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_|_| |
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| _| |
||||
_|_|_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_| |
||||
_| _| |
||||
_| _|_| |
||||
_| _| |
||||
_|_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| _| |
||||
_|_|_| |
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| |
||||
_|_| |
||||
_| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_|_|_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_| _| _| |
||||
_| _| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_| |
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_|_|_|_| |
||||
_| |
||||
_| |
||||
_| |
||||
_|_|_|_|_| |
||||
|
||||
|
||||
|
||||
_|_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_|_| |
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
_|_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_|_| |
||||
|
||||
|
||||
_| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_|_|_|_| |
||||
|
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| _| |
||||
_| _| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_|_|_| |
||||
_| _| |
||||
_| _| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| |
||||
_| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_|_|_| |
||||
_| _| |
||||
_| _| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_| |
||||
_|_|_|_| |
||||
_| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_|_| |
||||
_| |
||||
_|_|_|_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| _| |
||||
_| _| |
||||
_|_|_| |
||||
_| |
||||
_|_| |
||||
|
||||
|
||||
_| |
||||
_|_|_| |
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
_| |
||||
_| _| |
||||
_|_| |
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| _|_| |
||||
_| _| _| |
||||
_| _| _| |
||||
_| _| _| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_| |
||||
_| _| |
||||
_| _| |
||||
_|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| _| |
||||
_| _| |
||||
_|_|_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_| _| |
||||
_| _| |
||||
_|_|_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
_| _|_| |
||||
_|_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_|_|_| |
||||
_|_| |
||||
_|_| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
_| |
||||
_|_|_|_| |
||||
_| |
||||
_| |
||||
_|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
_|_|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| _| _| |
||||
_| _| _| |
||||
_| _| _| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_|_| |
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
_| _| |
||||
_|_|_| |
||||
_| |
||||
_|_| |
||||
|
||||
|
||||
|
||||
_|_|_|_| |
||||
_| |
||||
_| |
||||
_|_|_|_| |
||||
|
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
_| |
||||
|
||||
|
||||
_| _| |
||||
_| _| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,855 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_ |
||||
| | |
||||
| | |
||||
| | |
||||
|_| |
||||
(_) |
||||
|
||||
|
||||
|
||||
_ _ |
||||
( | ) |
||||
V V |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_ _ |
||||
_| || |_ |
||||
|_ __ _| |
||||
_| || |_ |
||||
|_ __ _| |
||||
|_||_| |
||||
|
||||
|
||||
|
||||
_ |
||||
| | |
||||
/ __) |
||||
\__ \ |
||||
( / |
||||
|_| |
||||
|
||||
|
||||
|
||||
_ __ |
||||
(_) / / |
||||
/ / |
||||
/ / |
||||
/ / _ |
||||
/_/ (_) |
||||
|
||||
|
||||
|
||||
|
||||
___ |
||||
( _ ) |
||||
/ _ \/\ |
||||
| (_> < |
||||
\___/\/ |
||||
|
||||
|
||||
|
||||
_ |
||||
( ) |
||||
|/ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
__ |
||||
/ / |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
\_\ |
||||
|
||||
|
||||
__ |
||||
\ \ |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
/_/ |
||||
|
||||
|
||||
_ |
||||
/\| |/\ |
||||
\ ` ' / |
||||
|_ _| |
||||
/ , . \ |
||||
\/|_|\/ |
||||
|
||||
|
||||
|
||||
|
||||
_ |
||||
_| |_ |
||||
|_ _| |
||||
|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_ |
||||
( ) |
||||
|/ |
||||
|
||||
|
||||
|
||||
|
||||
______ |
||||
|______| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_ |
||||
(_) |
||||
|
||||
|
||||
|
||||
__ |
||||
/ / |
||||
/ / |
||||
/ / |
||||
/ / |
||||
/_/ |
||||
|
||||
|
||||
|
||||
|
||||
___ |
||||
/ _ \ |
||||
| | | | |
||||
| |_| | |
||||
\___/ |
||||
|
||||
|
||||
|
||||
|
||||
_ |
||||
/ | |
||||
| | |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
|
||||
____ |
||||
|___ \ |
||||
__) | |
||||
/ __/ |
||||
|_____| |
||||
|
||||
|
||||
|
||||
|
||||
_____ |
||||
|___ / |
||||
|_ \ |
||||
___) | |
||||
|____/ |
||||
|
||||
|
||||
|
||||
|
||||
_ _ |
||||
| || | |
||||
| || |_ |
||||
|__ _| |
||||
|_| |
||||
|
||||
|
||||
|
||||
|
||||
____ |
||||
| ___| |
||||
|___ \ |
||||
__) | |
||||
|____/ |
||||
|
||||
|
||||
|
||||
|
||||
__ |
||||
/ / |
||||
| '_ \ |
||||
| (_) | |
||||
\___/ |
||||
|
||||
|
||||
|
||||
|
||||
_____ |
||||
|___ | |
||||
/ / |
||||
/ / |
||||
/_/ |
||||
|
||||
|
||||
|
||||
|
||||
___ |
||||
( _ ) |
||||
/ _ \ |
||||
| (_) | |
||||
\___/ |
||||
|
||||
|
||||
|
||||
|
||||
___ |
||||
/ _ \ |
||||
| (_) | |
||||
\__, | |
||||
/ / |
||||
/_/ |
||||
|
||||
|
||||
|
||||
_ |
||||
(_) |
||||
|
||||
_ |
||||
(_) |
||||
|
||||
|
||||
|
||||
|
||||
_ |
||||
(_) |
||||
|
||||
_ |
||||
( ) |
||||
|/ |
||||
|
||||
|
||||
__ |
||||
/ / |
||||
/ / |
||||
< < |
||||
\ \ |
||||
\_\ |
||||
|
||||
|
||||
|
||||
|
||||
______ |
||||
|______| |
||||
______ |
||||
|______| |
||||
|
||||
|
||||
|
||||
|
||||
__ |
||||
\ \ |
||||
\ \ |
||||
> > |
||||
/ / |
||||
/_/ |
||||
|
||||
|
||||
|
||||
___ |
||||
|__ \ |
||||
) | |
||||
/ / |
||||
|_| |
||||
(_) |
||||
|
||||
|
||||
|
||||
|
||||
____ |
||||
/ __ \ |
||||
/ / _` | |
||||
| | (_| | |
||||
\ \__,_| |
||||
\____/ |
||||
|
||||
|
||||
|
||||
/\ |
||||
/ \ |
||||
/ /\ \ |
||||
/ ____ \ |
||||
/_/ \_\ |
||||
|
||||
|
||||
|
||||
____ |
||||
| _ \ |
||||
| |_) | |
||||
| _ < |
||||
| |_) | |
||||
|____/ |
||||
|
||||
|
||||
|
||||
_____ |
||||
/ ____| |
||||
| | |
||||
| | |
||||
| |____ |
||||
\_____| |
||||
|
||||
|
||||
|
||||
_____ |
||||
| __ \ |
||||
| | | | |
||||
| | | | |
||||
| |__| | |
||||
|_____/ |
||||
|
||||
|
||||
|
||||
______ |
||||
| ____| |
||||
| |__ |
||||
| __| |
||||
| |____ |
||||
|______| |
||||
|
||||
|
||||
|
||||
______ |
||||
| ____| |
||||
| |__ |
||||
| __| |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
_____ |
||||
/ ____| |
||||
| | __ |
||||
| | |_ | |
||||
| |__| | |
||||
\_____| |
||||
|
||||
|
||||
|
||||
_ _ |
||||
| | | | |
||||
| |__| | |
||||
| __ | |
||||
| | | | |
||||
|_| |_| |
||||
|
||||
|
||||
|
||||
_____ |
||||
|_ _| |
||||
| | |
||||
| | |
||||
_| |_ |
||||
|_____| |
||||
|
||||
|
||||
|
||||
_ |
||||
| | |
||||
| | |
||||
_ | | |
||||
| |__| | |
||||
\____/ |
||||
|
||||
|
||||
|
||||
_ __ |
||||
| |/ / |
||||
| ' / |
||||
| < |
||||
| . \ |
||||
|_|\_\ |
||||
|
||||
|
||||
|
||||
_ |
||||
| | |
||||
| | |
||||
| | |
||||
| |____ |
||||
|______| |
||||
|
||||
|
||||
|
||||
__ __ |
||||
| \/ | |
||||
| \ / | |
||||
| |\/| | |
||||
| | | | |
||||
|_| |_| |
||||
|
||||
|
||||
|
||||
_ _ |
||||
| \ | | |
||||
| \| | |
||||
| . ` | |
||||
| |\ | |
||||
|_| \_| |
||||
|
||||
|
||||
|
||||
____ |
||||
/ __ \ |
||||
| | | | |
||||
| | | | |
||||
| |__| | |
||||
\____/ |
||||
|
||||
|
||||
|
||||
_____ |
||||
| __ \ |
||||
| |__) | |
||||
| ___/ |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
____ |
||||
/ __ \ |
||||
| | | | |
||||
| | | | |
||||
| |__| | |
||||
\___\_\ |
||||
|
||||
|
||||
|
||||
_____ |
||||
| __ \ |
||||
| |__) | |
||||
| _ / |
||||
| | \ \ |
||||
|_| \_\ |
||||
|
||||
|
||||
|
||||
_____ |
||||
/ ____| |
||||
| (___ |
||||
\___ \ |
||||
____) | |
||||
|_____/ |
||||
|
||||
|
||||
|
||||
_______ |
||||
|__ __| |
||||
| | |
||||
| | |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
_ _ |
||||
| | | | |
||||
| | | | |
||||
| | | | |
||||
| |__| | |
||||
\____/ |
||||
|
||||
|
||||
|
||||
__ __ |
||||
\ \ / / |
||||
\ \ / / |
||||
\ \/ / |
||||
\ / |
||||
\/ |
||||
|
||||
|
||||
|
||||
__ __ |
||||
\ \ / / |
||||
\ \ /\ / / |
||||
\ \/ \/ / |
||||
\ /\ / |
||||
\/ \/ |
||||
|
||||
|
||||
|
||||
__ __ |
||||
\ \ / / |
||||
\ V / |
||||
> < |
||||
/ . \ |
||||
/_/ \_\ |
||||
|
||||
|
||||
|
||||
__ __ |
||||
\ \ / / |
||||
\ \_/ / |
||||
\ / |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
______ |
||||
|___ / |
||||
/ / |
||||
/ / |
||||
/ /__ |
||||
/_____| |
||||
|
||||
|
||||
|
||||
___ |
||||
| _| |
||||
| | |
||||
| | |
||||
| | |
||||
| |_ |
||||
|___| |
||||
|
||||
|
||||
__ |
||||
\ \ |
||||
\ \ |
||||
\ \ |
||||
\ \ |
||||
\_\ |
||||
|
||||
|
||||
|
||||
___ |
||||
|_ | |
||||
| | |
||||
| | |
||||
| | |
||||
_| | |
||||
|___| |
||||
|
||||
|
||||
/\ |
||||
|/\| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
______ |
||||
|______| |
||||
|
||||
_ |
||||
( ) |
||||
\| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
__ _ |
||||
/ _` | |
||||
| (_| | |
||||
\__,_| |
||||
|
||||
|
||||
|
||||
_ |
||||
| | |
||||
| |__ |
||||
| '_ \ |
||||
| |_) | |
||||
|_.__/ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
___ |
||||
/ __| |
||||
| (__ |
||||
\___| |
||||
|
||||
|
||||
|
||||
_ |
||||
| | |
||||
__| | |
||||
/ _` | |
||||
| (_| | |
||||
\__,_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
___ |
||||
/ _ \ |
||||
| __/ |
||||
\___| |
||||
|
||||
|
||||
|
||||
__ |
||||
/ _| |
||||
| |_ |
||||
| _| |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
|
||||
__ _ |
||||
/ _` | |
||||
| (_| | |
||||
\__, | |
||||
__/ | |
||||
|___/ |
||||
|
||||
|
||||
_ |
||||
| | |
||||
| |__ |
||||
| _ \ |
||||
| | | | |
||||
|_| |_| |
||||
|
||||
|
||||
|
||||
_ |
||||
(_) |
||||
_ |
||||
| | |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
_ |
||||
(_) |
||||
_ |
||||
| | |
||||
| | |
||||
| | |
||||
_/ | |
||||
|__/ |
||||
|
||||
|
||||
_ |
||||
| | _ |
||||
| |/ / |
||||
| < |
||||
|_|\_\ |
||||
|
||||
|
||||
|
||||
_ |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_ __ ___ |
||||
| '_ ` _ \ |
||||
| | | | | | |
||||
|_| |_| |_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_ __ |
||||
| '_ \ |
||||
| | | | |
||||
|_| |_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
___ |
||||
/ _ \ |
||||
| (_) | |
||||
\___/ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_ __ |
||||
| '_ \ |
||||
| |_) | |
||||
| .__/ |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
__ _ |
||||
/ _` | |
||||
| (_| | |
||||
\__, | |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
_ __ |
||||
| '__| |
||||
| | |
||||
|_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
___ |
||||
/ __| |
||||
\__ \ |
||||
|___/ |
||||
|
||||
|
||||
|
||||
_ |
||||
| | |
||||
| |_ |
||||
| __| |
||||
\ |_ |
||||
\__| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_ _ |
||||
| | | | |
||||
| |_| | |
||||
\__,_| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
__ __ |
||||
\ \ / / |
||||
\ V / |
||||
\_/ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
__ __ |
||||
\ \ /\ / / |
||||
\ V V / |
||||
\_/\_/ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
__ __ |
||||
\ \/ / |
||||
> < |
||||
/_/\_\ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_ _ |
||||
| | | | |
||||
| |_| | |
||||
\__, | |
||||
__/ / |
||||
|___/ |
||||
|
||||
|
||||
|
||||
____ |
||||
|_ / |
||||
/ / |
||||
/___| |
||||
|
||||
|
||||
|
||||
__ |
||||
/ / |
||||
| | |
||||
/ / |
||||
\ \ |
||||
| | |
||||
\_\ |
||||
|
||||
|
||||
_ |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
|_| |
||||
|
||||
__ |
||||
\ \ |
||||
| | |
||||
\ \ |
||||
/ / |
||||
| | |
||||
/_/ |
||||
|
||||
|
||||
/\/| |
||||
|/\/ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,855 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
| |
||||
o |
||||
|
||||
O |
||||
|
||||
|
||||
o o |
||||
| | |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
| | |
||||
-O-O- |
||||
| | |
||||
-O-O- |
||||
| | |
||||
|
||||
|
||||
|
||||
| | |
||||
-O-O- |
||||
o | | |
||||
-O-O- |
||||
| | o |
||||
-O-O- |
||||
| | |
||||
|
||||
|
||||
|
||||
O |
||||
o / |
||||
/ |
||||
/ o |
||||
O |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
/| |
||||
o-O- |
||||
| |
||||
|
||||
|
||||
|
||||
o |
||||
| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/ |
||||
o |
||||
| |
||||
o |
||||
\ |
||||
|
||||
|
||||
|
||||
|
||||
\ |
||||
o |
||||
| |
||||
o |
||||
/ |
||||
|
||||
|
||||
|
||||
|
||||
o | o |
||||
\|/ |
||||
--O-- |
||||
/|\ |
||||
o | o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
| |
||||
-o- |
||||
| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
O |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
/ |
||||
o |
||||
/ |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
o /o |
||||
| / | |
||||
o/ o |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
0 |
||||
/| |
||||
o | |
||||
| |
||||
o-o-o |
||||
|
||||
|
||||
|
||||
|
||||
-- |
||||
o o |
||||
/ |
||||
/ |
||||
o--o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| |
||||
oo |
||||
| |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
| | |
||||
o--O |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o--o |
||||
| |
||||
o-o |
||||
| |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
/ |
||||
O--o |
||||
o | |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o---o |
||||
/ |
||||
o |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| | |
||||
o-o |
||||
| | |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| o |
||||
o--O |
||||
/ |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
O |
||||
|
||||
O |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
|
||||
o |
||||
| |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
/ |
||||
O |
||||
\ |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o--o |
||||
o--o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
\ |
||||
O |
||||
/ |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
o o |
||||
/ |
||||
o |
||||
|
||||
O |
||||
|
||||
|
||||
|
||||
o |
||||
/ \ |
||||
o O-o |
||||
\ |
||||
o- |
||||
|
||||
|
||||
|
||||
|
||||
O |
||||
/ \ |
||||
o---o |
||||
| | |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
o--o |
||||
| | |
||||
O--o |
||||
| | |
||||
o--o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
/ |
||||
O |
||||
\ |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| \ |
||||
| O |
||||
| / |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o--o |
||||
| |
||||
O-o |
||||
| |
||||
o--o |
||||
|
||||
|
||||
|
||||
|
||||
o--o |
||||
| |
||||
O-o |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
o |
||||
| -o |
||||
o | |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
| | |
||||
O--O |
||||
| | |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
o-O-o |
||||
| |
||||
| |
||||
| |
||||
o-O-o |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
| |
||||
| |
||||
\ o |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
| / |
||||
OO |
||||
| \ |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
| |
||||
| |
||||
| |
||||
O---o |
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
|\ /| |
||||
| O | |
||||
| | |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
|\ | |
||||
| \ | |
||||
| \| |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
o o |
||||
| | |
||||
o o |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o--o |
||||
| | |
||||
O--o |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
o o |
||||
| | |
||||
o O |
||||
o-O\ |
||||
|
||||
|
||||
|
||||
|
||||
o--o |
||||
| | |
||||
O-Oo |
||||
| \ |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| |
||||
o-o |
||||
| |
||||
o--o |
||||
|
||||
|
||||
|
||||
|
||||
o-O-o |
||||
| |
||||
| |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
| | |
||||
| | |
||||
| | |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
| | |
||||
o o |
||||
\ / |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
| | |
||||
o o o |
||||
\ / \ / |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
\ / |
||||
O |
||||
/ \ |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
\ / |
||||
O |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o---o |
||||
/ |
||||
-O- |
||||
/ |
||||
o---o |
||||
|
||||
|
||||
|
||||
|
||||
O-o |
||||
| |
||||
| |
||||
| |
||||
O-o |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
\ |
||||
o |
||||
\ |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o-O |
||||
| |
||||
| |
||||
| |
||||
o-O |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
/ \ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o---o |
||||
|
||||
|
||||
|
||||
|
||||
0 |
||||
| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
oo |
||||
| | |
||||
o-o- |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
| |
||||
O-o |
||||
| | |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
| |
||||
o-O |
||||
| | |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
|-' |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| |
||||
-O- |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o--o |
||||
| | |
||||
o--O |
||||
| |
||||
o--o |
||||
|
||||
|
||||
o |
||||
| |
||||
O--o |
||||
| | |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
|
||||
| |
||||
| |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
|
||||
o |
||||
| |
||||
o o |
||||
o-o |
||||
|
||||
|
||||
o |
||||
| / |
||||
OO |
||||
| \ |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
| |
||||
| |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o-O-o |
||||
| | | |
||||
o o o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| | |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| | |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| | |
||||
O-o |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| | |
||||
o-O |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
\ |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
| |
||||
-o- |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
| | |
||||
o--o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
\ / |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o o o |
||||
\ / \ / |
||||
o o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\ / |
||||
o |
||||
/ \ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
o o |
||||
| | |
||||
o--O |
||||
| |
||||
o--o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
/ |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| |
||||
o-O |
||||
| |
||||
o-o |
||||
|
||||
|
||||
|
||||
|
||||
o |
||||
| |
||||
o |
||||
| |
||||
o |
||||
|
||||
|
||||
|
||||
|
||||
o-o |
||||
| |
||||
O-o |
||||
| |
||||
o-o |
||||
|
||||
|
||||
|
||||
o_ / |
||||
/ o |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,33 @@
|
||||
## balancedstring |
||||
|
||||
### Instructions |
||||
|
||||
Balanced string is a string that has equal quantity of 'C' and 'D' characters. |
||||
|
||||
Write a program that takes a string and outputs maximum amount of balanced strings with `\n` at the end of line. |
||||
|
||||
If the number of arguments is not 1, display `\n`. |
||||
|
||||
It will only be tested strings containing the characters 'C' and 'D'. |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/balancedstring$ go build |
||||
student@ubuntu:~/[[ROOT]]/balancedstring$ ./balancedstring "CDCCDDCDCD" |
||||
4 |
||||
student@ubuntu:~/[[ROOT]]/balancedstring$ ./balancedstring "CDDDDCCCDC" |
||||
3 |
||||
student@ubuntu:~/[[ROOT]]/balancedstring$ ./balancedstring "DDDDCCCC" |
||||
1 |
||||
student@ubuntu:~/[[ROOT]]/balancedstring$ ./balancedstring "CDCCCDDCDD" |
||||
2 |
||||
``` |
||||
|
||||
In first example "CDCCDDCDCD" can be split into "CD", "CCDD", "CD", "CD", each substring contains same number of 'C' and 'D'. |
||||
|
||||
Second, "CDDDDCCCDC" can be split into: "CD", "DDDCCC", "DC". |
||||
|
||||
"DDDDCCCC" can be split into "DDDDCCCC". |
||||
|
||||
"CDCCCDDCDD" can be split into: "CD", "CCCDDCDD", since each substring contains an equal number of 'C' and 'D' |
@ -0,0 +1,74 @@
|
||||
## changeorder |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
You are given a linked list, where each node contains a single digit. |
||||
Change order of linked list so that elements with odd index come first, elements |
||||
with even index come afterwards. |
||||
You have to return pointer/reference to the beginning of new list |
||||
|
||||
### Expected function and structure |
||||
|
||||
```go |
||||
package main |
||||
|
||||
type NodeAddL struct { |
||||
Next *NodeAddL |
||||
Num int |
||||
} |
||||
|
||||
func Changeorder(node *NodeAddL) *NodeAddL { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
) |
||||
|
||||
// I implemented pushBack for this |
||||
|
||||
func main() { |
||||
num1 := &NodeAddL{Num: 1} |
||||
num1 = pushBack(num1, 2) |
||||
num1 = pushBack(num1, 3) |
||||
num1 = pushBack(num1, 4) |
||||
num1 = pushBack(num1, 5) |
||||
|
||||
result := Changeorder(num1) |
||||
for tmp := result; tmp != nil; tmp = tmp.Next { |
||||
fmt.Print(tmp.Num) |
||||
if tmp.Next != nil { |
||||
fmt.Print(" -> ") |
||||
} |
||||
} |
||||
fmt.Println() |
||||
} |
||||
|
||||
``` |
||||
|
||||
Its output: |
||||
|
||||
```console |
||||
$> go build |
||||
$> ./main |
||||
1 -> 3 -> 5 -> 2 -> 4 |
||||
``` |
@ -0,0 +1,649 @@
|
||||
#### Atoi |
||||
|
||||
##### Try with the argument: `""` |
||||
`0` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `"-"` |
||||
`0` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `"--123"` |
||||
`0` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `"1"` |
||||
`1` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `"-3"` |
||||
`-3` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `"8292"` |
||||
`8292` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `"9223372036854775807"` |
||||
`9223372036854775807` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `"-9223372036854775808"` |
||||
`-9223372036854775808` |
||||
###### Does the function returns the value above? |
||||
|
||||
#### RecursivePower |
||||
|
||||
##### Try with the arguments: `nb = -7 and power = -2` |
||||
`0` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `nb = -8 and power = -7` |
||||
`0` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `nb = 4 and power = 8` |
||||
`65536` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `nb = 1 and power = 3` |
||||
`1` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `nb = -1 and power = 1` |
||||
`-1` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `nb = -6 and power = 5` |
||||
`-7776` |
||||
###### Does the function returns the value above? |
||||
|
||||
#### PrintCombN |
||||
|
||||
##### Try with the argument: `n = 1` |
||||
`0, 1, 2, 3, 4, 5, 6, 7, 8, 9` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `n = 2` |
||||
`01, 02, 03, 04, 05, 06, 07, 08, 09, 12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `n = 3` |
||||
`012, 013, 014, 015, 016, 017, 018, 019, 023, 024, 025, 026, 027, 028, 029, 034, 035, 036, 037, 038, 039, 045, 046, 047, 048, 049, 056, 057, 058, 059, 067, 068, 069, 078, 079, 089, 123, 124, 125, 126, 127, 128, 129, 134, 135, 136, 137, 138, 139, 145, 146, 147, 148, 149, 156, 157, 158, 159, 167, 168, 169, 178, 179, 189, 234, 235, 236, 237, 238, 239, 245, 246, 247, 248, 249, 256, 257, 258, 259, 267, 268, 269, 278, 279, 289, 345, 346, 347, 348, 349, 356, 357, 358, 359, 367, 368, 369, 378, 379, 389, 456, 457, 458, 459, 467, 468, 469, 478, 479, 489, 567, 568, 569, 578, 579, 589, 678, 679, 689, 789` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `n = 4` |
||||
`0123, 0124, 0125, 0126, 0127, 0128, 0129, 0134, 0135, 0136, 0137, 0138, 0139, 0145, 0146, 0147, 0148, 0149, 0156, 0157, 0158, 0159, 0167, 0168, 0169, 0178, 0179, 0189, 0234, 0235, 0236, 0237, 0238, 0239, 0245, 0246, 0247, 0248, 0249, 0256, 0257, 0258, 0259, 0267, 0268, 0269, 0278, 0279, 0289, 0345, 0346, 0347, 0348, 0349, 0356, 0357, 0358, 0359, 0367, 0368, 0369, 0378, 0379, 0389, 0456, 0457, 0458, 0459, 0467, 0468, 0469, 0478, 0479, 0489, 0567, 0568, 0569, 0578, 0579, 0589, 0678, 0679, 0689, 0789, 1234, 1235, 1236, 1237, 1238, 1239, 1245, 1246, 1247, 1248, 1249, 1256, 1257, 1258, 1259, 1267, 1268, 1269, 1278, 1279, 1289, 1345, 1346, 1347, 1348, 1349, 1356, 1357, 1358, 1359, 1367, 1368, 1369, 1378, 1379, 1389, 1456, 1457, 1458, 1459, 1467, 1468, 1469, 1478, 1479, 1489, 1567, 1568, 1569, 1578, 1579, 1589, 1678, 1679, 1689, 1789, 2345, 2346, 2347, 2348, 2349, 2356, 2357, 2358, 2359, 2367, 2368, 2369, 2378, 2379, 2389, 2456, 2457, 2458, 2459, 2467, 2468, 2469, 2478, 2479, 2489, 2567, 2568, 2569, 2578, 2579, 2589, 2678, 2679, 2689, 2789, 3456, 3457, 3458, 3459, 3467, 3468, 3469, 3478, 3479, 3489, 3567, 3568, 3569, 3578, 3579, 3589, 3678, 3679, 3689, 3789, 4567, 4568, 4569, 4578, 4579, 4589, 4678, 4679, 4689, 4789, 5678, 5679, 5689, 5789, 6789` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `n = 5` |
||||
`01234, 01235, 01236, 01237, 01238, 01239, 01245, 01246, 01247, 01248, 01249, 01256, 01257, 01258, 01259, 01267, 01268, 01269, 01278, 01279, 01289, 01345, 01346, 01347, 01348, 01349, 01356, 01357, 01358, 01359, 01367, 01368, 01369, 01378, 01379, 01389, 01456, 01457, 01458, 01459, 01467, 01468, 01469, 01478, 01479, 01489, 01567, 01568, 01569, 01578, 01579, 01589, 01678, 01679, 01689, 01789, 02345, 02346, 02347, 02348, 02349, 02356, 02357, 02358, 02359, 02367, 02368, 02369, 02378, 02379, 02389, 02456, 02457, 02458, 02459, 02467, 02468, 02469, 02478, 02479, 02489, 02567, 02568, 02569, 02578, 02579, 02589, 02678, 02679, 02689, 02789, 03456, 03457, 03458, 03459, 03467, 03468, 03469, 03478, 03479, 03489, 03567, 03568, 03569, 03578, 03579, 03589, 03678, 03679, 03689, 03789, 04567, 04568, 04569, 04578, 04579, 04589, 04678, 04679, 04689, 04789, 05678, 05679, 05689, 05789, 06789, 12345, 12346, 12347, 12348, 12349, 12356, 12357, 12358, 12359, 12367, 12368, 12369, 12378, 12379, 12389, 12456, 12457, 12458, 12459, 12467, 12468, 12469, 12478, 12479, 12489, 12567, 12568, 12569, 12578, 12579, 12589, 12678, 12679, 12689, 12789, 13456, 13457, 13458, 13459, 13467, 13468, 13469, 13478, 13479, 13489, 13567, 13568, 13569, 13578, 13579, 13589, 13678, 13679, 13689, 13789, 14567, 14568, 14569, 14578, 14579, 14589, 14678, 14679, 14689, 14789, 15678, 15679, 15689, 15789, 16789, 23456, 23457, 23458, 23459, 23467, 23468, 23469, 23478, 23479, 23489, 23567, 23568, 23569, 23578, 23579, 23589, 23678, 23679, 23689, 23789, 24567, 24568, 24569, 24578, 24579, 24589, 24678, 24679, 24689, 24789, 25678, 25679, 25689, 25789, 26789, 34567, 34568, 34569, 34578, 34579, 34589, 34678, 34679, 34689, 34789, 35678, 35679, 35689, 35789, 36789, 45678, 45679, 45689, 45789, 46789, 56789` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `n = 6` |
||||
`012345, 012346, 012347, 012348, 012349, 012356, 012357, 012358, 012359, 012367, 012368, 012369, 012378, 012379, 012389, 012456, 012457, 012458, 012459, 012467, 012468, 012469, 012478, 012479, 012489, 012567, 012568, 012569, 012578, 012579, 012589, 012678, 012679, 012689, 012789, 013456, 013457, 013458, 013459, 013467, 013468, 013469, 013478, 013479, 013489, 013567, 013568, 013569, 013578, 013579, 013589, 013678, 013679, 013689, 013789, 014567, 014568, 014569, 014578, 014579, 014589, 014678, 014679, 014689, 014789, 015678, 015679, 015689, 015789, 016789, 023456, 023457, 023458, 023459, 023467, 023468, 023469, 023478, 023479, 023489, 023567, 023568, 023569, 023578, 023579, 023589, 023678, 023679, 023689, 023789, 024567, 024568, 024569, 024578, 024579, 024589, 024678, 024679, 024689, 024789, 025678, 025679, 025689, 025789, 026789, 034567, 034568, 034569, 034578, 034579, 034589, 034678, 034679, 034689, 034789, 035678, 035679, 035689, 035789, 036789, 045678, 045679, 045689, 045789, 046789, 056789, 123456, 123457, 123458, 123459, 123467, 123468, 123469, 123478, 123479, 123489, 123567, 123568, 123569, 123578, 123579, 123589, 123678, 123679, 123689, 123789, 124567, 124568, 124569, 124578, 124579, 124589, 124678, 124679, 124689, 124789, 125678, 125679, 125689, 125789, 126789, 134567, 134568, 134569, 134578, 134579, 134589, 134678, 134679, 134689, 134789, 135678, 135679, 135689, 135789, 136789, 145678, 145679, 145689, 145789, 146789, 156789, 234567, 234568, 234569, 234578, 234579, 234589, 234678, 234679, 234689, 234789, 235678, 235679, 235689, 235789, 236789, 245678, 245679, 245689, 245789, 246789, 256789, 345678, 345679, 345689, 345789, 346789, 356789, 456789` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `n = 7` |
||||
`0123456, 0123457, 0123458, 0123459, 0123467, 0123468, 0123469, 0123478, 0123479, 0123489, 0123567, 0123568, 0123569, 0123578, 0123579, 0123589, 0123678, 0123679, 0123689, 0123789, 0124567, 0124568, 0124569, 0124578, 0124579, 0124589, 0124678, 0124679, 0124689, 0124789, 0125678, 0125679, 0125689, 0125789, 0126789, 0134567, 0134568, 0134569, 0134578, 0134579, 0134589, 0134678, 0134679, 0134689, 0134789, 0135678, 0135679, 0135689, 0135789, 0136789, 0145678, 0145679, 0145689, 0145789, 0146789, 0156789, 0234567, 0234568, 0234569, 0234578, 0234579, 0234589, 0234678, 0234679, 0234689, 0234789, 0235678, 0235679, 0235689, 0235789, 0236789, 0245678, 0245679, 0245689, 0245789, 0246789, 0256789, 0345678, 0345679, 0345689, 0345789, 0346789, 0356789, 0456789, 1234567, 1234568, 1234569, 1234578, 1234579, 1234589, 1234678, 1234679, 1234689, 1234789, 1235678, 1235679, 1235689, 1235789, 1236789, 1245678, 1245679, 1245689, 1245789, 1246789, 1256789, 1345678, 1345679, 1345689, 1345789, 1346789, 1356789, 1456789, 2345678p, 2345679, 2345689, 2345789, 2346789, 2356789, 2456789, 3456789` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `n = 8` |
||||
`01234567, 01234568, 01234569, 01234578, 01234579, 01234589, 01234678, 01234679, 01234689, 01234789, 01235678, 01235679, 01235689, 01235789, 01236789, 01245678, 01245679, 01245689, 01245789, 01246789, 01256789, 01345678, 01345679, 01345689, 01345789, 01346789, 01356789, 01456789, 02345678, 02345679, 02345689, 02345789, 02346789, 02356789, 02456789, 03456789, 12345678, 12345679, 12345689, 12345789, 12346789, 12356789, 12456789, 13456789, 23456789` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `n = 9` |
||||
`012345678, 012345679, 012345689, 012345789, 012346789, 012356789, 012456789, 013456789, 023456789, 123456789` |
||||
###### Does the function prints the value above? |
||||
|
||||
#### PrintNbrBase |
||||
|
||||
##### Try with the argument: `nbr = 919617 and base = 01` |
||||
`11100000100001000001` |
||||
###### Does the function prints the value? |
||||
##### Try with the argument: `nbr = 753639 and base = CHOUMIisDAcat!` |
||||
`HIDAHI` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `nbr = -174336 and base = CHOUMIisDAcat!` |
||||
`-MssiD` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `nbr = -661165 and base = 1` |
||||
`NV` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `nbr = -861737 and base = Zone01Zone01` |
||||
`-1111101` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `nbr = 125 and base = 0123456789ABCDEF` |
||||
`7D` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `nbr = -125 and base = choumi` |
||||
`-uoi` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `nbr = 125 and base = -ab` |
||||
`NV` |
||||
###### Does the function prints the value above? |
||||
##### Try with the argument: `nbr = -9223372036854775808 and base = 0123456789` |
||||
`-9223372036854775808` |
||||
###### Does the function prints the value above? |
||||
|
||||
#### doop |
||||
|
||||
##### Try with the arguments: `861 + 870` |
||||
`1731` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `861 - 870` |
||||
`-9` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `861 * 870` |
||||
`749070` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `861 % 870` |
||||
`861` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `hello + 1` |
||||
`0` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `1 p 1` |
||||
`0` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `1 / 0` |
||||
`No division by 0` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `1 % 0` |
||||
`No remainder of division by 0` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `1 * 1` |
||||
`1` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `9223372036854775807 + 1` |
||||
`0` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `9223372036854775809 - 3` |
||||
`0` |
||||
###### Does the program prints the value above? |
||||
##### Try with the arguments: `9223372036854775807 * 3` |
||||
`0` |
||||
###### Does the program prints the value above? |
||||
|
||||
#### Atoibase |
||||
|
||||
##### Try with the arguments: `s = bcbbbbaab and base = abc` |
||||
`12016` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `s = 0001 and base = 01` |
||||
`1` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `s = 00 and base = 01` |
||||
`0` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `s = saDt!I!sI and base = CHOUMIisDAcat!` |
||||
`11557277891` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `s = AAho?Ao and base = WhoAmI?` |
||||
`406772` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `s = thisinputshouldnotmatter and base = abca` |
||||
`0` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `s = 125 and base = 0123456789` |
||||
`125` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `s = uoi and base = choumi` |
||||
`125` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `s = bbbbbab and base = -ab` |
||||
`0` |
||||
###### Does the function returns the value above? |
||||
|
||||
#### splitwhitespaces |
||||
|
||||
##### Try with the argument: `str = "The earliest foundations of what would become computer science predate the invention of the modern digital computer"` |
||||
`[The earliest foundations of what would become computer science predate the invention of the modern digital computer]` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `str = Machines for calculating fixed numerical tasks such as the abacus have existed since antiquity,` |
||||
[Machines for calculating fixed numerical tasks such as the abacus have existed since antiquity,] |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `str = aiding in computations such as multiplication and division .` |
||||
`[aiding in computations such as multiplication and division .]` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `str = Algorithms for performing computations have existed since antiquity, even before the development of sophisticated computing equipment.` |
||||
`[Algorithms for performing computations have existed since antiquity, even before the development of sophisticated computing equipment.]` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `str = Wilhelm Schickard designed and constructed the first working mechanical calculator in 1623.[4]` |
||||
[Wilhelm Schickard designed and constructed the first working mechanical calculator in 1623.[4]] |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `str = In 1673, Gottfried Leibniz demonstrated a digital mechanical calculator,` |
||||
`[In 1673, Gottfried Leibniz demonstrated a digital mechanical calculator,]` |
||||
###### Does the function returns the value above? |
||||
|
||||
#### split |
||||
|
||||
##### Try with the arguments: |
||||
``` |
||||
str = |=choumi=|which|=choumi=|itself|=choumi=|used|=choumi=|cards|=choumi=|and|=choumi=|a|=choumi=|central|=choumi=|computing|=choumi=|unit.|=choumi=|When|=choumi=|the|=choumi=|machine|=choumi=|was|=choumi=|finished, and charset = |=choumi=| |
||||
``` |
||||
`[ which itself used cards and a central computing unit. When the machine was finished,]` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: |
||||
``` |
||||
str = !==!which!==!was!==!making!==!all!==!kinds!==!of!==!punched!==!card!==!equipment!==!and!==!was!==!also!==!in!==!the!==!calculator!==!business[10]!==!to!==!develop!==!his!==!giant!==!programmable!==!calculator, and charset = !==! |
||||
``` |
||||
`[ which was making all kinds of punched card equipment and was also in the calculator business[10] to develop his giant programmable calculator,]` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: |
||||
``` |
||||
str = AFJCharlesAFJBabbageAFJstartedAFJtheAFJdesignAFJofAFJtheAFJfirstAFJautomaticAFJmechanicalAFJcalculator, and charset = AFJ |
||||
``` |
||||
`[ Charles Babbage started the design of the first automatic mechanical calculator,]` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: |
||||
``` |
||||
str = <<==123==>>In<<==123==>>1820,<<==123==>>Thomas<<==123==>>de<<==123==>>Colmar<<==123==>>launched<<==123==>>the<<==123==>>mechanical<<==123==>>calculator<<==123==>>industry[note<<==123==>>1]<<==123==>>when<<==123==>>he<<==123==>>released<<==123==>>his<<==123==>>simplified<<==123==>>arithmometer, and charset = <<==123==>> |
||||
``` |
||||
`[ In 1820, Thomas de Colmar launched the mechanical calculator industry[note 1] when he released his simplified arithmometer,]` |
||||
###### Does the function returns the value above? |
||||
|
||||
#### convertbase |
||||
|
||||
##### Try with the arguments `nbr = "4506C", baseFrom = "0123456789ABCDEF" and baseTo = "choumi"` |
||||
`"hccocimc"` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments `nbr = "babcbaaaaabcb", baseFrom = "abc" and baseTo = "0123456789ABCDEF"` |
||||
`"9B611"` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments `nbr = "256850", baseFrom = "0123456789" and baseTo = "01"` |
||||
`"111110101101010010"` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments `nbr = "uuhoumo", baseFrom = "choumi" and baseTo = "Zone01"` |
||||
`"eeone0n"` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments `nbr = "683241", baseFrom = "0123456789" and baseTo = "0123456789"` |
||||
`"683241"` |
||||
###### Does the function returns the value above? |
||||
|
||||
#### rotatevowels |
||||
|
||||
##### Try the program without any arguments |
||||
###### Does the program displays a new line? |
||||
##### Try executing the program passing as argument: `"Hello World"` |
||||
`Hollo Werld` |
||||
###### Does the program returns the value above? |
||||
##### Try executing the program passing as arguments: `"HEllO World" "problem solved"` |
||||
`Hello Werld problom sOlvEd` |
||||
###### Does the program returns the value above? |
||||
##### Try executing the program passing as argument: `"str" "shh" "psst"` |
||||
`str shh psst` |
||||
###### Does the program returns the value above? |
||||
##### Try executing the program passing as argument: `"happy thoughts" "good luck"` |
||||
`happy thoughts good luck` |
||||
###### Does the program returns the value above? |
||||
##### Try executing the program passing as argument: `"al's elEphAnt is overly underweight!" |
||||
`il's elephunt es ovirly AndErweaght!` |
||||
###### Does the program returns the value above? |
||||
|
||||
#### advancedsortwordarr |
||||
|
||||
##### Try with the arguments |
||||
``` |
||||
array = [The earliest computing device undoubtedly consisted of the five fingers of each hand] and f = strings.Compare |
||||
``` |
||||
`[The computing consisted device each earliest fingers five hand of of the undoubtedly]` |
||||
##### Does the function returns the value above? |
||||
##### Try with the arguments |
||||
``` |
||||
array = [The word digital comesfrom "digits" or fingers] and f = strings.Compare |
||||
``` |
||||
`["digits" The comesfrom digital fingers or word]` |
||||
##### Does the function returns the value above? |
||||
##### Try with the arguments |
||||
``` |
||||
array = [a A 1 b B 2 c C 3] and f = strings.Compare |
||||
``` |
||||
`[1 2 3 A B C a b c]` |
||||
##### Does the function returns the value above? |
||||
##### Try with the arguments |
||||
``` |
||||
array = [The computing consisted device each earliest fingers five hand of of the undoubtedly] and f = func(a, b string) int { |
||||
return strings.Compare(b, a) |
||||
} |
||||
``` |
||||
`[undoubtedly the of of hand five fingers earliest each device consisted computing The]` |
||||
##### Does the function returns the value above? |
||||
##### Try with the arguments |
||||
``` |
||||
array = ["digits" The comesfrom digital fingers or word] and f = func(a, b string) int { |
||||
return strings.Compare(b, a) |
||||
} |
||||
``` |
||||
`[word or fingers digital comesfrom The "digits"]` |
||||
##### Does the function returns the value above? |
||||
##### Try with the arguments |
||||
``` |
||||
array = [1 2 3 A B C a b c] and f = func(a, b string) int { |
||||
return strings.Compare(b, a) |
||||
} |
||||
``` |
||||
`[c b a C B A 3 2 1]` |
||||
##### Does the function returns the value above? |
||||
|
||||
#### cat |
||||
|
||||
##### Run the program without arguments and then write: `Hello` |
||||
`Hello` |
||||
###### Does the program returns the value above? |
||||
##### Write: jaflsdfj |
||||
`jaflsdfj` |
||||
###### Does the program returns the value above? |
||||
##### Write: `Computer science (sometimes called computation science or computing science` |
||||
`Computer science (sometimes called computation science or computing science` |
||||
###### Does the program returns the value above? |
||||
##### Run the program passing the file: `quest8.txt` as an argument of execution of the program (as shown in the subject) |
||||
###### Does the the program displays the same output as in the readme? |
||||
##### Run the program with the file: quest8T.txt |
||||
###### Does the program displays the content of the file? |
||||
##### Run the program with the files: quest8T.txt and quest8.txt in that order |
||||
###### Does the program displays the content of the file in order? |
||||
##### Run the program with a diferent file and then run the system program *`cat`* with the same file. |
||||
###### Are the outputs identical? |
||||
##### Run both this program and the system program *`cat`* passing as an argument a random string that is not the name of a file |
||||
###### Are the outputs identical? |
||||
|
||||
#### ztail |
||||
|
||||
##### Run both ztail and the system command `tail` with the arguments: `-c 20 <filename> ` |
||||
###### Are the outputs exactly the same? |
||||
##### Run both ztail and the system command `tail` with the arguments: `<filename> -c 23` |
||||
###### Are the outputs exactly the same? |
||||
. Substitute <filename> for the name of a file |
||||
##### Run both ztail and the system command `tail` with the arguments: `-c jelrjq 15` |
||||
###### Are the outputs exactly the same? |
||||
##### Run both ztail and the system command `tail` with the arguments: `-c 11 <filename> jfdklsa` |
||||
###### Are the outputs exactly the same? |
||||
##### Run both ztail and the system command `tail` with the arguments: `11 -c <filename>` |
||||
###### Are the outputs exactly the same? |
||||
|
||||
#### activebits |
||||
|
||||
##### Try with the argument: `n = 15` |
||||
`4` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `n = 17` |
||||
`2` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `n = 4` |
||||
`1` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `n = 11` |
||||
`3` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `n = 9` |
||||
`2` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `n = 12` |
||||
`2` |
||||
###### Does the function returns the value above? |
||||
##### Try with the argument: `n = 2` |
||||
`1` |
||||
###### Does the function returns the value above? |
||||
|
||||
#### sortlistinsert |
||||
|
||||
##### Try with the arguments: `l = 0-> <nil> and data_ref = 39` |
||||
`(0-> 39-> <nil>)` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `l = 0-> 1-> 2-> 3-> 4-> 5-> 24-> 25-> 54-> <nil> and data_ref = 33` |
||||
`(0-> 1-> 2-> 3-> 4-> 5-> 24-> 25-> 33-> 54-> <nil>)` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `l = 0-> 2-> 18-> 33-> 37-> 37-> 39-> 52-> 53-> 57-> <nil> and data_ref = 53` |
||||
`(0-> 2-> 18-> 33-> 37-> 37-> 39-> 52-> 53-> 53-> 57-> <nil>)` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `l = 0-> 5-> 18-> 24-> 28-> 35-> 42-> 45-> 52-> <nil> and data_ref = 52` |
||||
`(0-> 5-> 18-> 24-> 28-> 35-> 42-> 45-> 52-> 52-> <nil>)` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `l = 0-> 12-> 20-> 23-> 23-> 24-> 30-> 41-> 53-> 57-> 59-> <nil> and data_ref = 38` |
||||
`(0-> 12-> 20-> 23-> 23-> 24-> 30-> 38-> 41-> 53-> 57-> 59-> <nil>)` |
||||
###### Does the function returns the value above? |
||||
|
||||
#### sortedlistmerge |
||||
|
||||
##### Try with the arguments: `n1 = <nil> and n2 = <nil>` |
||||
`(<nil>)` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `n1 = <nil> and n2 = 2-> 2-> 4-> 9-> 12-> 12-> 19-> 20-> <nil>` |
||||
`(2-> 2-> 4-> 9-> 12-> 12-> 19-> 20-> <nil>)` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `n1 = 4-> 4-> 6-> 9-> 13-> 18-> 20-> 20-> <nil> and n2 = <nil>` |
||||
`(4-> 4-> 6-> 9-> 13-> 18-> 20-> 20-> <nil>)` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `n1 = 0-> 7-> 39-> 92-> 97-> 93-> 91-> 28-> 64-> <nil> and n2 = 80-> 23-> 27-> 30-> 85-> 81-> 75-> 70-> <nil>` |
||||
`(0-> 7-> 39-> 80-> 23-> 27-> 30-> 85-> 81-> 75-> 70-> 92-> 97-> 93-> 91-> 28-> 64-> <nil>)` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `n1 =0-> 2-> 11-> 30-> 54-> 56-> 70-> 79-> 99-> <nil> and n2 = 23-> 28-> 38-> 67-> 67-> 79-> 95-> 97-> <nil>` |
||||
`(0-> 2-> 11-> 23-> 28-> 30-> 38-> 54-> 56-> 67-> 67-> 70-> 79-> 79-> 95-> 97-> 99-> <nil>)` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: `n1 = 0-> 3-> 8-> 8-> 13-> 19-> 34-> 38-> 46-> <nil> and n2 = 7-> 39-> 45-> 53-> 59-> 70-> 76-> 79-> <nil>` |
||||
`(0-> 3-> 7-> 8-> 8-> 13-> 19-> 34-> 38-> 39-> 45-> 46-> 53-> 59-> 70-> 76-> 79-> <nil>)` |
||||
###### Does the function returns the value above? |
||||
|
||||
#### listremoveif |
||||
|
||||
##### Try with the arguments: `l = <nil> and data_ref = 1` |
||||
`(<nil>)` |
||||
###### Does the function returns the list above? |
||||
##### Try with the arguments: `l = <nil> and data_ref = 96` |
||||
`(<nil>)` |
||||
###### Does the function returns the list above? |
||||
##### Try with the arguments: `l = 98-> 98-> 33-> 34-> 33-> 34-> 33-> 89-> 33-> <nil> and data_ref = 34` |
||||
`(98-> 98-> 33-> 33-> 33-> 89-> 33-> <nil>)` |
||||
###### Does the function returns the list above? |
||||
##### Try with the arguments: `l = 79-> 74-> 99-> 79-> 7-> <nil> and data_ref = 99` |
||||
`(79-> 74-> 79-> 7-> <nil>)` |
||||
###### Does the function returns the list above? |
||||
##### Try with the arguments: `l = 56-> 93-> 68-> 56-> 87-> 68-> 56-> 68-> <nil> and data_ref = 68` |
||||
`(56-> 93-> 56-> 87-> 56-> <nil>)` |
||||
###### Does the function returns the list above? |
||||
##### Try with the arguments: `l = mvkUxbqhQve4l-> 4Zc4t hnf SQ-> q2If E8BPuX -> <nil> and data_ref = 4Zc4t hnf SQ` |
||||
`(mvkUxbqhQve4l-> q2If E8BPuX -> <nil>)` |
||||
###### Does the function returns the list above? |
||||
|
||||
#### btreetransplant |
||||
|
||||
##### Try with the arguments: |
||||
``` |
||||
root = |
||||
01 |
||||
└── 07 |
||||
├── 12 |
||||
│ └── 10 |
||||
└── 05 |
||||
└── 02 |
||||
└── 03 |
||||
, node = 12 and |
||||
repla = |
||||
55 |
||||
├── 60 |
||||
└── 33 |
||||
└── 12 |
||||
└── 15 |
||||
``` |
||||
``` |
||||
01 |
||||
└── 07 |
||||
├── 55 |
||||
│ ├── 60 |
||||
│ └── 33 |
||||
│ └── 12 |
||||
│ └── 15 |
||||
└── 05 |
||||
└── 02 |
||||
└── 03 |
||||
``` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: |
||||
``` |
||||
root = |
||||
33 |
||||
├── 5 |
||||
│ └── 52 |
||||
└── 20 |
||||
├── 31 |
||||
└── 13 |
||||
└── 11 |
||||
, node = 20 and |
||||
repla = |
||||
55 |
||||
├── 60 |
||||
└── 33 |
||||
└── 12 |
||||
└── 15 |
||||
``` |
||||
``` |
||||
33 |
||||
├── 5 |
||||
│ └── 52 |
||||
└── 55 |
||||
├── 60 |
||||
└── 33 |
||||
└── 12 |
||||
└── 15 |
||||
``` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: |
||||
``` |
||||
root = |
||||
03 |
||||
└── 39 |
||||
├── 99 |
||||
│ └── 44 |
||||
└── 11 |
||||
└── 14 |
||||
└── 11 |
||||
, node = 11 and |
||||
repla = |
||||
55 |
||||
├── 60 |
||||
└── 33 |
||||
└── 12 |
||||
└── 15 |
||||
``` |
||||
|
||||
``` |
||||
03 |
||||
└── 39 |
||||
├── 99 |
||||
│ └── 44 |
||||
└── 55 |
||||
├── 60 |
||||
└── 33 |
||||
└── 12 |
||||
└── 15 |
||||
``` |
||||
###### Does the function returns the value above? |
||||
|
||||
#### btreeapplybylevel |
||||
|
||||
##### Try with the arguments: |
||||
``` |
||||
root = |
||||
01 |
||||
└── 07 |
||||
├── 12 |
||||
│ └── 10 |
||||
└── 05 |
||||
└── 02 |
||||
└── 03 |
||||
and f = fmt.Println |
||||
``` |
||||
``` |
||||
01 |
||||
07 |
||||
05 |
||||
12 |
||||
02 |
||||
10 |
||||
03 |
||||
``` |
||||
###### Does the function prints the value above? |
||||
##### Try with the arguments: |
||||
``` |
||||
root = |
||||
01 |
||||
└── 07 |
||||
├── 12 |
||||
│ └── 10 |
||||
└── 05 |
||||
└── 02 |
||||
└── 03 |
||||
and f = fmt.Print |
||||
``` |
||||
``` |
||||
01070512021003 |
||||
``` |
||||
###### Does the function prints the value above? |
||||
|
||||
#### btreedeletenode |
||||
|
||||
##### Try with the arguments: |
||||
``` |
||||
root = |
||||
01 |
||||
└── 07 |
||||
├── 12 |
||||
│ └── 10 |
||||
└── 05 |
||||
└── 02 |
||||
└── 03 |
||||
and node = 02 |
||||
``` |
||||
``` |
||||
01 |
||||
└── 07 |
||||
├── 12 |
||||
│ └── 10 |
||||
└── 05 |
||||
└── 03 |
||||
``` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: |
||||
``` |
||||
root = |
||||
33 |
||||
├── 5 |
||||
│ └── 52 |
||||
└── 20 |
||||
├── 31 |
||||
└── 13 |
||||
└── 11 |
||||
and node = 20 |
||||
``` |
||||
``` |
||||
33 |
||||
├── 5 |
||||
│ └── 52 |
||||
└── 31 |
||||
└── 13 |
||||
└── 11 |
||||
``` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: |
||||
``` |
||||
root = |
||||
03 |
||||
└── 39 |
||||
├── 99 |
||||
│ └── 44 |
||||
└── 11 |
||||
└── 14 |
||||
└── 11 |
||||
and node = 03 |
||||
``` |
||||
``` |
||||
39 |
||||
├── 99 |
||||
│ └── 44 |
||||
└── 11 |
||||
└── 14 |
||||
└── 11 |
||||
``` |
||||
###### Does the function returns the value above? |
||||
##### Try with the arguments: |
||||
``` |
||||
root = |
||||
03 |
||||
├── 03 |
||||
│ └── 94 |
||||
│ └── 19 |
||||
│ ├── 24 |
||||
│ └── 111 |
||||
└── 01 |
||||
and node = 03 |
||||
``` |
||||
``` |
||||
03 |
||||
├── 94 |
||||
│ └── 19 |
||||
│ ├── 24 |
||||
│ └── 111 |
||||
└── 01 |
||||
``` |
||||
###### Does the function returns the value above? |
@ -0,0 +1,29 @@
|
||||
## good practices |
||||
|
||||
### [code](https://code.tutsplus.com/tutorials/top-15-best-practices-for-writing-super-readable-code--net-8118) |
||||
|
||||
- Commenting and Documentation |
||||
- Consistent Indentation |
||||
- Avoid Obvious Comments |
||||
- Code Grouping |
||||
- Consistent Naming Scheme |
||||
- camelCase |
||||
- under_scores |
||||
- [**DRY**](https://thefullstack.xyz/dry-yagni-kiss-tdd-soc-bdfu) (Don't Repeat Yourself) or [**DIE**](https://thefullstack.xyz/dry-yagni-kiss-tdd-soc-bdfu) (Duplication is Evil) principle |
||||
- [**KISS**](https://thefullstack.xyz/dry-yagni-kiss-tdd-soc-bdfu) (Keep It Simple Stupid) |
||||
- [**YAGNI**](https://thefullstack.xyz/dry-yagni-kiss-tdd-soc-bdfu) (You Aren’t Gonna Need It) |
||||
- [**SOC**](https://thefullstack.xyz/dry-yagni-kiss-tdd-soc-bdfu) (Separation of Concerns) |
||||
- Avoid Deep Nesting |
||||
- Handling errors |
||||
- Limit Line Length |
||||
- File and Folder Organization |
||||
- Consistent Temporary Names |
||||
- Separation of Code and Data |
||||
- Code Refactoring |
||||
|
||||
### Go |
||||
|
||||
- [**Go**](https://golang.org/doc/effective_go.html) |
||||
- [**gofmt**](https://golang.org/cmd/gofmt/) |
||||
- [**goimports**](https://godoc.org/golang.org/x/tools/cmd/goimports) |
||||
- [**foimports vs gofmt**](https://goinbigdata.com/goimports-vs-gofmt/) |
@ -0,0 +1,44 @@
|
||||
## invert tree |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
|
||||
### Instructions: |
||||
Write a function that takes tree and inverts(flips) and returns it. |
||||
``` |
||||
type TNode struct { |
||||
Val int |
||||
Left *TNode |
||||
Right *TNode |
||||
} |
||||
``` |
||||
Example: |
||||
``` |
||||
Input: |
||||
7 |
||||
/ \ |
||||
5 10 |
||||
/ \ / \ |
||||
3 6 9 13 |
||||
|
||||
Output: |
||||
7 |
||||
/ \ |
||||
10 5 |
||||
/ \ / \ |
||||
13 9 6 3 |
||||
``` |
||||
Expected function: |
||||
``` |
||||
func InvertTree(root *TNode) *TNode { |
||||
} |
||||
``` |
@ -0,0 +1,52 @@
|
||||
## lcm |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
Write a function, `lcm`, that returns least common multiple. |
||||
|
||||
All arguments tested will be positive `int` values. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Lcm(first, second int) int { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function : |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
piscine ".." |
||||
) |
||||
|
||||
func main() { |
||||
fmt.Println(piscine.Lcm(2, 7)) |
||||
} |
||||
``` |
||||
|
||||
### Output |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
14 |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -0,0 +1,87 @@
|
||||
## merge |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. |
||||
|
||||
You need to merge them into a new binary tree. The merge rule is that if two nodes overlap, then sum node values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of new tree. |
||||
|
||||
Write a function, `MergeTrees`, that returns merged tree . |
||||
Note: The merging process must start from the root nodes of both trees. |
||||
|
||||
Example 1: |
||||
|
||||
Input: |
||||
|
||||
1 |
||||
/ \ |
||||
2 3 |
||||
|
||||
[1,2,3] |
||||
|
||||
1 |
||||
/ \ |
||||
2 3 |
||||
|
||||
[1,2,3] |
||||
|
||||
Merged Tree: |
||||
|
||||
2 |
||||
/ \ |
||||
4 6 |
||||
|
||||
[2,4,6] |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
type TreeNodeM struct { |
||||
Left *TreeNodeM |
||||
Val int |
||||
Right *TreeNodeM |
||||
} |
||||
|
||||
|
||||
func MergeTrees(t1 *TreeNodeM, t2 *TreeNodeM) *TreeNodeM { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function : |
||||
|
||||
```go |
||||
package main |
||||
|
||||
|
||||
func main() { |
||||
mergedTree := &TreeNodeM{} |
||||
t1 := NewRandTree() |
||||
t2 := NewRandTree() |
||||
|
||||
mergedTree = MergeTrees(t1, t2) |
||||
printTree(mergedTree) |
||||
} |
||||
``` |
||||
|
||||
### Output |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
[20, 2, 3, 4, 5, 6, 6, 7, 3, 5] |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -0,0 +1,62 @@
|
||||
## nauuo |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
There was a vote. There are people who voted positively, negatively, and randomly. |
||||
Figure out if the final answer depends on random people or not. |
||||
If it does, return '?', otherwise the result must be either '+', '-', or '0' |
||||
Previous characters stand for outcome of the vote: positive/negative/draw. |
||||
Input is always positive. |
||||
|
||||
Write a function, `Nauuo`, that returns final result of voting. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Nauuo(plus, minus, rand int) string { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function : |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
piscine ".." |
||||
) |
||||
|
||||
func main() { |
||||
fmt.Println(piscine.Nauuo(50, 43, 20)) |
||||
fmt.Println(piscine.Nauuo(13, 13, 0)) |
||||
fmt.Println(piscine.Nauuo(10, 9, 0)) |
||||
fmt.Println(piscine.Nauuo(5, 9, 2)) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
? |
||||
0 |
||||
+ |
||||
- |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -0,0 +1,20 @@
|
||||
## printchessboard |
||||
|
||||
### Instructions |
||||
|
||||
Write a program that takes two integers as arguments and displays the chess desk, in which white cells are represented by `' '` and black cells by `'#'`. |
||||
|
||||
- If the number of arguments is different from 2, or if the argument is not a positive number, the program displays `Error` followed by a newline (`'\n'`). |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/printchessboard$ go build |
||||
student@ubuntu:~/[[ROOT]]/printchessboard$ ./printchessboard 4 3 | cat -e |
||||
# # $ |
||||
# #$ |
||||
# # $ |
||||
student@ubuntu:~/[[ROOT]]/printchessboard$ ./printchessboard 7 | cat -e |
||||
Error$ |
||||
student@ubuntu:~/[[ROOT]]/printchessboard$ |
||||
``` |
@ -0,0 +1,53 @@
|
||||
## priorprime |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
You are given an integer. |
||||
Your function must return sum of all prime numbers prior to the number exclusively. The number is not included. |
||||
|
||||
### Expected function and structure |
||||
|
||||
```go |
||||
package main |
||||
|
||||
func Priorprime(x int) int { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
) |
||||
|
||||
func main() { |
||||
fmt.Println(Priorprime(14)) |
||||
} |
||||
|
||||
``` |
||||
|
||||
Its output: |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./priorprime |
||||
41 |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -0,0 +1,75 @@
|
||||
## reverse |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
You are given a linked list, where each node contains a single digit. |
||||
Write a function that reverses the list and returns pointer/reference to new linked list |
||||
|
||||
### Expected function and structure |
||||
|
||||
```go |
||||
package main |
||||
|
||||
type NodeAddL struct { |
||||
Next *NodeAddL |
||||
Num int |
||||
} |
||||
|
||||
func Reverse(node *NodeAddL) *NodeAddL { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function : |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
) |
||||
|
||||
func pushBack(n *NodeAddL, num int) *NodeAddL{ |
||||
|
||||
} |
||||
|
||||
func main() { |
||||
num1 := &piscine.NodeAddL{Num: 1} |
||||
num1 = pushBack(num1, 3) |
||||
num1 = pushBack(num1, 2) |
||||
num1 = pushBack(num1, 4) |
||||
num1 = pushBack(num1, 5) |
||||
|
||||
result := piscine.Reverse(num1) |
||||
for tmp := result; tmp != nil; tmp = tmp.Next { |
||||
fmt.Print(tmp.Num) |
||||
if tmp.Next != nil { |
||||
fmt.Print(" -> ") |
||||
} |
||||
} |
||||
fmt.Println() |
||||
} |
||||
|
||||
``` |
||||
|
||||
Its output: |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./main |
||||
5 -> 4 -> 2 -> 3 -> 1 |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -0,0 +1,30 @@
|
||||
## robottoorigin |
||||
|
||||
### Instructions |
||||
|
||||
There is a robot at position (0, 0) at 2D map. |
||||
|
||||
Write a program, that outputs `true` if robot ends up at the origin (0, 0) after a sequence of moves, otherwise `false`. `\n` should be in the end of line. |
||||
|
||||
Sequence of moves is a string, which characters state for movement direction: |
||||
|
||||
- U - up |
||||
- D - down |
||||
- R - right |
||||
- L - left |
||||
|
||||
If the number of arguments is not 1, output `\n`. |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./main "UD" |
||||
true |
||||
student@ubuntu:~/[[ROOT]]/test$ ./main "LL" |
||||
false |
||||
``` |
||||
|
||||
In first case, the robot moves up and the down. So, it returned back to its origin position. |
||||
|
||||
In second example, the robot moves twice to the left. It is 2 positions left from its origin, so the program outputs false. |
@ -0,0 +1,110 @@
|
||||
## sametree |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
Given two binary trees, write a function to check if they are the same or not. |
||||
|
||||
Two binary trees are considered the same if they are structurally identical and the nodes have the same value. |
||||
|
||||
Write a function, `IsSameTree`, that returns `bool`. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
type TreeNodeM struct { |
||||
Left *TreeNodeM |
||||
Val int |
||||
Right *TreeNodeM |
||||
} |
||||
|
||||
|
||||
func IsSameTree(p *TreeNodeM, q *TreeNodeM) bool { |
||||
|
||||
} |
||||
``` |
||||
|
||||
Example 1: |
||||
|
||||
Input: |
||||
|
||||
1 |
||||
/ \ |
||||
2 3 |
||||
|
||||
[1,2,3] |
||||
|
||||
1 |
||||
/ \ |
||||
2 3 |
||||
|
||||
[1,2,3] |
||||
|
||||
Output: true |
||||
|
||||
Input: |
||||
|
||||
1 |
||||
/ |
||||
2 |
||||
|
||||
[1,2], |
||||
|
||||
1 |
||||
\ |
||||
2 |
||||
|
||||
[1,null,2] |
||||
|
||||
Output: false |
||||
|
||||
Input: |
||||
``` |
||||
|
||||
1 |
||||
/ \ |
||||
2 1 |
||||
|
||||
[1,2,1], |
||||
|
||||
1 |
||||
/ \ |
||||
1 2 |
||||
|
||||
[1,1,2] |
||||
``` |
||||
Output: false |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function : |
||||
|
||||
```go |
||||
package main |
||||
|
||||
func main() { |
||||
t1 := NewRandTree() |
||||
t2 := NewRandTree() |
||||
|
||||
fmt.Println(IsSameTree(t1, t2)) |
||||
} |
||||
``` |
||||
|
||||
### Output |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
true |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -0,0 +1,70 @@
|
||||
## sortlinkedlist |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
You are given a linked list, where each node contains a single digit. |
||||
Write a function that sorts the list in descending order and return pointer/reference to new linked list |
||||
|
||||
### Expected function and struct |
||||
|
||||
```go |
||||
package main |
||||
|
||||
type NodeAddL struct { |
||||
Next *NodeAddL |
||||
Num int |
||||
} |
||||
|
||||
func Sortll(node *NodeAddL) *NodeAddL { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
) |
||||
|
||||
// I implemented pushBack for this |
||||
|
||||
func main() { |
||||
num1 := &NodeAddL{Num: 5} |
||||
num1 = pushBack(num1, 1) |
||||
num1 = pushBack(num1, 3) |
||||
num1 = pushBack(num1, 1) |
||||
num1 = pushBack(num1, 3) |
||||
|
||||
result := Sortll(num1) |
||||
for tmp := result; tmp != nil; tmp = tmp.Next { |
||||
fmt.Print(tmp.Num) |
||||
if tmp.Next != nil { |
||||
fmt.Print(" -> ") |
||||
} |
||||
} |
||||
fmt.Println() |
||||
} |
||||
``` |
||||
|
||||
Its output: |
||||
|
||||
```console |
||||
$> go build |
||||
$> ./main |
||||
5 -> 3 -> 3 -> 1 -> 1 |
||||
``` |
@ -0,0 +1,11 @@
|
||||
## bad example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
``` |
||||
#### |
||||
...# |
||||
.... |
||||
.... |
||||
|
||||
``` |
@ -0,0 +1,11 @@
|
||||
## bad example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
``` |
||||
...# |
||||
..#. |
||||
.#.. |
||||
#... |
||||
|
||||
``` |
@ -0,0 +1,11 @@
|
||||
## bad example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
``` |
||||
...# |
||||
..#. |
||||
.#.. |
||||
#... |
||||
|
||||
``` |
@ -0,0 +1,11 @@
|
||||
## bad example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
``` |
||||
.... |
||||
.... |
||||
.... |
||||
.... |
||||
|
||||
``` |
@ -0,0 +1,11 @@
|
||||
## bad example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
``` |
||||
..## |
||||
.... |
||||
.... |
||||
##.. |
||||
|
||||
``` |
@ -0,0 +1,26 @@
|
||||
## bad example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
``` |
||||
...# |
||||
...# |
||||
...# |
||||
...# |
||||
.... |
||||
.... |
||||
.... |
||||
#### |
||||
|
||||
|
||||
.### |
||||
...# |
||||
.... |
||||
.... |
||||
|
||||
.... |
||||
..## |
||||
.##. |
||||
.... |
||||
|
||||
``` |
@ -0,0 +1,11 @@
|
||||
## good example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
```console |
||||
.... |
||||
.##. |
||||
.##. |
||||
.... |
||||
|
||||
``` |
@ -0,0 +1,26 @@
|
||||
## good example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
``` |
||||
...# |
||||
...# |
||||
...# |
||||
...# |
||||
|
||||
.... |
||||
.... |
||||
.... |
||||
#### |
||||
|
||||
.### |
||||
...# |
||||
.... |
||||
.... |
||||
|
||||
.... |
||||
..## |
||||
.##. |
||||
.... |
||||
|
||||
``` |
@ -0,0 +1,46 @@
|
||||
## good example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
``` |
||||
...# |
||||
...# |
||||
...# |
||||
...# |
||||
|
||||
.... |
||||
.... |
||||
.... |
||||
#### |
||||
|
||||
.### |
||||
...# |
||||
.... |
||||
.... |
||||
|
||||
.... |
||||
..## |
||||
.##. |
||||
.... |
||||
|
||||
.... |
||||
.##. |
||||
.##. |
||||
.... |
||||
|
||||
.... |
||||
.... |
||||
##.. |
||||
.##. |
||||
|
||||
##.. |
||||
.#.. |
||||
.#.. |
||||
.... |
||||
|
||||
.... |
||||
###. |
||||
.#.. |
||||
.... |
||||
|
||||
``` |
@ -0,0 +1,61 @@
|
||||
## good example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
``` |
||||
.... |
||||
.##. |
||||
.##. |
||||
.... |
||||
|
||||
...# |
||||
...# |
||||
...# |
||||
...# |
||||
|
||||
.... |
||||
..## |
||||
.##. |
||||
.... |
||||
|
||||
.... |
||||
.##. |
||||
.##. |
||||
.... |
||||
|
||||
.... |
||||
..#. |
||||
.##. |
||||
.#.. |
||||
|
||||
.### |
||||
...# |
||||
.... |
||||
.... |
||||
|
||||
##.. |
||||
.#.. |
||||
.#.. |
||||
.... |
||||
|
||||
.... |
||||
..## |
||||
.##. |
||||
.... |
||||
|
||||
##.. |
||||
.#.. |
||||
.#.. |
||||
.... |
||||
|
||||
.#.. |
||||
.##. |
||||
..#. |
||||
.... |
||||
|
||||
.... |
||||
###. |
||||
.#.. |
||||
.... |
||||
|
||||
``` |
@ -0,0 +1,66 @@
|
||||
## hard example |
||||
|
||||
- Create your file and copy the example into it. |
||||
|
||||
``` |
||||
.... |
||||
.##. |
||||
.##. |
||||
.... |
||||
|
||||
.#.. |
||||
.##. |
||||
.#.. |
||||
.... |
||||
|
||||
.... |
||||
..## |
||||
.##. |
||||
.... |
||||
|
||||
.... |
||||
.##. |
||||
.##. |
||||
.... |
||||
|
||||
.... |
||||
..#. |
||||
.##. |
||||
.#.. |
||||
|
||||
.### |
||||
...# |
||||
.... |
||||
.... |
||||
|
||||
##.. |
||||
.#.. |
||||
.#.. |
||||
.... |
||||
|
||||
.... |
||||
.##. |
||||
.##. |
||||
.... |
||||
|
||||
.... |
||||
..## |
||||
.##. |
||||
.... |
||||
|
||||
##.. |
||||
.#.. |
||||
.#.. |
||||
.... |
||||
|
||||
.#.. |
||||
.##. |
||||
..#. |
||||
.... |
||||
|
||||
.... |
||||
###. |
||||
.#.. |
||||
.... |
||||
|
||||
``` |
@ -0,0 +1,45 @@
|
||||
#### Functional Project Questions |
||||
|
||||
##### Try bad example 00 (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/badexample00.md). |
||||
`ERROR` |
||||
###### Does the program prints the value above? |
||||
##### Try bad example 01 (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/badexample01.md). |
||||
`ERROR` |
||||
###### Does the program prints the value above? |
||||
##### Try bad example 02 (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/badexample02.md). |
||||
`ERROR` |
||||
###### Does the program prints the value above? |
||||
##### Try bad example 03 (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/badexample03.md). |
||||
`ERROR` |
||||
###### Does the program prints the value above? |
||||
##### Try bad example 04 (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/badexample04.md). |
||||
`ERROR` |
||||
###### Does the program prints the value above? |
||||
##### Try bad format (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/badformat.md). |
||||
`ERROR` |
||||
###### Does the program prints the value above? |
||||
##### Try good example 00 (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/goodexample00.md). |
||||
###### Does the result contain 0 empty spaces (0 '.')? |
||||
##### Try good example 01 (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/goodexample01.md). |
||||
###### Does the result contain 9 empty spaces (9 '.')? |
||||
##### Try good example 02 (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/goodexample02.md). |
||||
###### Does the result contain 4 empty spaces (4 '.')? |
||||
##### Try good example 03 (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/goodexample03.md). |
||||
###### Does the result contain 5 empty spaces (5 '.')? |
||||
##### Try hard example (https://github.com/01-edu/public/blob/master/subjects/tetrisoptimizer/hardexam.md). |
||||
###### Does the result contain 1 empty spaces (1 '.')? |
||||
###### Are all of the Tetrominos contained in the test file, present in the output? |
||||
###### Different characters correspond to different Tetrominos? |
||||
###### Does one Tetromino has only one character? |
||||
|
||||
#### Basic |
||||
|
||||
###### +Does the project runs quickly and effectively (Favoring of recursive, no unnecessary data requests, etc.)? |
||||
###### +Is there a test file for this code? |
||||
###### +Are the tests checking each possible case? |
||||
###### +Does the code obey the [good practices](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md)? |
||||
|
||||
#### Social |
||||
|
||||
###### +Did you learn anything from this project? |
||||
###### +Would you recommend/nominate this program as an example for the rest of the school? |
@ -0,0 +1,92 @@
|
||||
## tetrisoptimizer |
||||
|
||||
### Objectives |
||||
|
||||
Develop a program that receives only one argument, a path to a text file which will contain a list of [tetrominoes](https://en.wikipedia.org/wiki/Tetromino) to assemble them in order to create the smallest square possible. |
||||
|
||||
### Instructions |
||||
|
||||
The program must : |
||||
|
||||
- Be written in Go |
||||
- Compile successfully |
||||
- Assemble all of the tetrominoes in order to create the smallest square possible |
||||
- Identify each tetromino in the solution by printing them with uppercase latin letters (`A` for the first one, `B` for the second, etc) |
||||
- Expect at least one tetromino in the text file |
||||
- In case of bad format on the tetrominoes or bad file format it should print `ERROR` |
||||
|
||||
#### Example of a text File |
||||
|
||||
```console |
||||
#... |
||||
#... |
||||
#... |
||||
#... |
||||
|
||||
.... |
||||
.... |
||||
..## |
||||
..## |
||||
``` |
||||
|
||||
- If it isn't possible to form a complete square, the program should leave spaces between the tetrominoes. For example: |
||||
|
||||
```console |
||||
ABB. |
||||
ABB. |
||||
A... |
||||
A... |
||||
``` |
||||
|
||||
## Usage |
||||
|
||||
``` |
||||
student@ubuntu:~/tetrisoptimizer$ cat -e sample.txt |
||||
...#$ |
||||
...#$ |
||||
...#$ |
||||
...#$ |
||||
$ |
||||
....$ |
||||
....$ |
||||
....$ |
||||
####$ |
||||
$ |
||||
.###$ |
||||
...#$ |
||||
....$ |
||||
....$ |
||||
$ |
||||
....$ |
||||
..##$ |
||||
.##.$ |
||||
....$ |
||||
$ |
||||
....$ |
||||
.##.$ |
||||
.##.$ |
||||
....$ |
||||
$ |
||||
....$ |
||||
....$ |
||||
##..$ |
||||
.##.$ |
||||
$ |
||||
##..$ |
||||
.#..$ |
||||
.#..$ |
||||
....$ |
||||
$ |
||||
....$ |
||||
###.$ |
||||
.#..$ |
||||
....$ |
||||
student@ubuntu:~/tetrisoptimizer$ ./tetrisoptimizer sample.txt | cat -e |
||||
ABBBB.$ |
||||
ACCCEE$ |
||||
AFFCEE$ |
||||
A.FFGG$ |
||||
HHHDDG$ |
||||
.HDD.G$ |
||||
student@ubuntu:~/tetrisoptimizer$ |
||||
``` |
@ -0,0 +1,53 @@
|
||||
## twosum |
||||
|
||||
## **WARNING! VERY IMPORTANT!** |
||||
|
||||
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program: |
||||
|
||||
This means that: |
||||
|
||||
- The package needs to be named `package main`. |
||||
- The submitted code needs one declared function main(```func main()```) even if empty. |
||||
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done. |
||||
- Every other rules are obviously the same than for a `program`. |
||||
|
||||
### Instructions |
||||
|
||||
Given an array of integers, return indexes of the two numbers such that they add up to a specific target. |
||||
|
||||
If there are more than one solution, return the first one. |
||||
|
||||
If there are no solutions, return nil. |
||||
|
||||
Expected function : |
||||
|
||||
```go |
||||
func TwoSum(nums []int, target int) []int { |
||||
} |
||||
``` |
||||
|
||||
Here is a possible [program](TODO-LINK) to test your function : |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
piscine ".." |
||||
) |
||||
|
||||
func main() { |
||||
case1 := []int{1, 2, 3, 4} |
||||
out := piscine.TwoSum(case1, 5) |
||||
fmt.Println(out) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
[0 3] |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -0,0 +1,23 @@
|
||||
## uniqueoccurences |
||||
|
||||
### Instructions |
||||
|
||||
Write a program that outputs `true` if the number of occurrences of each character is unique, otherwise `false`. `\n` should be at the of line. |
||||
|
||||
If number of arguments is not 1 output `\n`. |
||||
|
||||
Only lower case characters will be given. |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./main "abbaac" |
||||
true |
||||
student@ubuntu:~/[[ROOT]]/test$ ./main "ab" |
||||
false |
||||
student@ubuntu:~/[[ROOT]]/test$ ./main "abcacccazb" |
||||
true |
||||
``` |
||||
|
||||
In first example, character 'a' has 3 occurrences, 'b' has 2 and 'c' has 1. No two characters have the same number of occurrences. |
Loading…
Reference in new issue