diff --git a/docs/addition_of_exercise_draft.md b/docs/addition_of_exercise_draft.md new file mode 100644 index 000000000..4a653a926 --- /dev/null +++ b/docs/addition_of_exercise_draft.md @@ -0,0 +1,281 @@ +# THE ADDITION OF EXERCISE PROCEDURE + + +##### This is for a go exercise in the piscine-go + +## **1. Writing the subject and / or writing the solution** + +Always address each exceptional cases. + +Example: [fprime](https://github.com/01-edu/public/blob/master/subjects/fprime.en.md). + +The exceptional cases in the `usage` part. + +```console +student@ubuntu:~/piscine-go/test$ go build +student@ubuntu:~/piscine-go/test$ ./test 225225 +3*3*5*5*7*11*13 +student@ubuntu:~/piscine-go/test$ ./test 8333325 +3*3*5*5*7*11*13*37 + +... + +student@ubuntu:~/piscine-go/test$ ./test 0 + +student@ubuntu:~/piscine-go/test$ ./test 1 +1 +student@ubuntu:~/piscine-go/test$ +``` + +The subject states that only **positive integer** will be tested, however, 0 and 1 are not primes. + +The subject writer made a mistake because of forgetting that fact. + +During the exam, the test was testing the `1` case and expecting a `1\n` to be printed. The real result should only have been a `\n`. + +Some students found this mistake. An update of the subject during the exam treating that special case was immediately necessary. + +1. Try to avoid the “you” and contracted “language” + +2. Always check the formating md + +------ + +### fprime (Title of the exercise) + +#### Instructions (Instructions of the exercise) + + +Write a program that takes a positive `int` and displays its prime factors, followed by a newline (`'\n'`). (general guidelines, notice the imperative style tense and the avoidance of “you”. “You” is authorized in the case of a presence of a back story where the player is immersed) + +- Factors must be displayed in ascending order and separated by `*`. (formating requirement) + +- If the number of parameters is different from 1, the program displays a newline. (special case requirement, this case will need to be tested) + +- The input, when there is one, will always be valid. (Clarification on what the tester will do, hence giving the student guidelines on the cases to be handled, the tests have to reflect this instruction as well) + +- In this exercise the primes factor of 1 is considered as 1. (Handling of exceptional case: THIS Happens to be a mistake, we will see uses this example for the “UPDATING A SUBJECT/TEST PROCEDURE”) + +### Usage + +```console +student@ubuntu:~/piscine-go/test$ go build +student@ubuntu:~/piscine-go/test$ ./test 225225 +3*3*5*5*7*11*13 +student@ubuntu:~/piscine-go/test$ ./test 8333325 +3*3*5*5*7*11*13*37 +student@ubuntu:~/piscine-go/test$ ./test 9539 +9539 +student@ubuntu:~/piscine-go/test$ ./test 804577 +804577 +student@ubuntu:~/piscine-go/test$ ./test 42 +2*3*7 +student@ubuntu:~/piscine-go/test$ ./test a + +student@ubuntu:~/piscine-go/test$ ./test 0 + +student@ubuntu:~/piscine-go/test$ ./test 1 +1 +student@ubuntu:~/piscine-go/test$ +``` + +------ + +## **2. Creating the files for tests (4 main cases)** + +### always in -> *all/tests/go/* + +### **Folder organization** + +- Function exercise in a Quest `(strlen)` + - 2 files: + - strlen_test.go + - solutions/strlen.goz + +```console +go +| strlen_test.go +| +| __ solutions +| |-strlen.go (package solutions) +| +| __ student (the same thing as the solutions, just run "cp -aT solutions/ student/") +``` + +- Program exercise in a Quest `(doop)` + - 2 files + - doop_test.go + - solutions/doop/main.go + +```console +go +| doop_test.go +| +| +| __ solutions +| |__doop +| |-main.go (package main) +| +| __ student (the same thing as the solutions, just run "cp -aT solutions/ student/") +``` + +- Program exercise in the exam `(dooprog)` + - 2 files + - solutions/doopprog/main.go + - solutions/doopprog/doopprog_test.go + +```console +go +| +| __ solutions +| | __ doopprog +| |-main.go (package main) +| |-doopprog_test.go +| +| __ student (the same thing as the solutions, just run "cp -aT solutions/ student/") +``` + +- Function exercise in the exam `(atoiprog)` + - 3 files + - solutions/atoi.go + - solutions/atoiprog/main.go + - solutions/atoiprog/atoiprog_test.go + +```console +go +| +| __ solutions +| | +| |-atoi.go (package solutions) +| |__atoiprog +| |-main.go (package main)(func main(){} stays empty) +| |-atoiprog_test.go +| +| __ student (the same thing as the solutions, just run "cp -aT solutions/ student/") +``` + +------ + +## **3. Writing a file_test.go (test file for go)** + +### **RULE 1** + +- Make the test as independent as possible (no self-made functions imported) + +- **If** the source is not in the import section, copy and paste the function, with **lowercase** for the first letter of its name. + +- Example: addprimesum_test.go + +![isaprime](isaprime.png) + +The func isAPrime is fully copied to the file. + +### **RULE 2** + +Every special case in the subject should be tested. Preferably first. Before the randoms tests + +### **RULE 3** + +Whenever possible do at least 1 random test! This is to avoid cheating by predictability of the tests. If the tests are fixed, then the student may create a forest of ifs program to bypass the tester. + +### z01.functions to be used by tester + +- Function exercise in a Quest (strlen) ![z01sl](strlenz01.png) + +```go +z01.Challenge(t, studentSol, studentStu) // if the program doesn’t have arguments + +z01.Challenge(t, studentSol, studentStu, args...) //if the program has arguments +``` + +- Program exercise in a Quest (doop) ![z01doop](doopz01.png)<- Screenshots to be added. + +```go +z01.ChallengeMain(t) // if the program doesn’t have arguments + +z01.ChallengeMain(t, args...) // if the program has arguments +``` + +- Program exercise in the exam (dooprog) Screenshots to be added. + +```go +z01.ChallengeMainExam(t) // if the program doesn’t have arguments + +z01.ChallengeMainExam (t, args...) // if the program has arguments +``` + +- Function exercise in the exam (Atoiprog) Screenshots to be added. + +```go +z01.Challenge(t, studentSol, studentStu) // if the program doesn’t have arguments + +z01.Challenge(t, studentSol, studentStu, args...) //if the program has arguments +``` + +------ + +## **4. Testing locally (`go test` or `go test -run=Test\`)** + +### you do -run=... because you have many test files, so you need to run just one + +### Before every PR : a go test has to be executed (in several situations) in the folder(s) of the exercise(s) worked on + +**First thing first** + +```console +rm -r student +cp -aT solutions/ student +``` + +### Execute a go test in the appropriate folder + +- Function exercise in a Quest `(strlen)` ![](image.png) + +`all/test/go` + +```console +go test -run=TestStrlen +``` + +- Program exercise in a Quest `(doop)` ![](image.png)<- Screenshots to be added. + +`all/test/go/` + +```console +go test -run=TestDoop +``` + +- Program exercise in the exam `(dooprog)` Screenshots to be added. + +Here you can do just *go test*, because there's only one test file + +`all/test/go/student/dooprog` + +```console +go test +``` + +- Function exercise in the exam `(atoiprog)` Screenshots to be added. + +`all/test/go/student/atoiprog` + +```console +go test +``` + + +### **NOTE:** If a go test gives a (cached) result, use this type of command (example with raid3): + +```go test count=1 raid3_test.go``` + +The result should be an OK message: + +- This means that the test is running correctly when the correct solution is given. If this does not work, the test file is likely to have errors inside. + +- Time should be under 5-6 seconds. If longer, remove some of the iteration of the random tests (for example, less random tests) + +- Be watchful of exercises with challenge function: Always test a copy of the variable and not the same variable for both the student and the solution function. + +- Introduce errors in the student solution.go file in order to see the errors message and compare them to the subject examples. + +- Error messages for structures exercises (linked lists, binary trees) need to be tailored accordingly. diff --git a/scripts/docker.sh b/scripts/docker.sh new file mode 100755 index 000000000..056015961 --- /dev/null +++ b/scripts/docker.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Install Docker + +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir +. set.sh + +apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - +add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable" +apt-get update +apt-get -y install docker-ce docker-ce-cli containerd.io +adduser student docker diff --git a/scripts/install_client.sh b/scripts/install_client.sh index 152b68dea..dd3ff77dd 100755 --- a/scripts/install_client.sh +++ b/scripts/install_client.sh @@ -10,7 +10,7 @@ cd $script_dir . set.sh disk=$(lsblk -o tran,kname,hotplug,type,fstype -pr | - grep -e nvme -e sata -e sas -e ata | + grep -e nvme -e sata -e sas -e ata -e vda | grep '0 disk' | cut -d' ' -f2 | sort | @@ -43,6 +43,7 @@ apt-get -yf install . vscode.sh . libreoffice.sh . exam.sh +. docker.sh # Install additional packages pkgs=" diff --git a/scripts/ubuntu_tweaks.sh b/scripts/ubuntu_tweaks.sh index 594edcf6b..eaf1947fc 100755 --- a/scripts/ubuntu_tweaks.sh +++ b/scripts/ubuntu_tweaks.sh @@ -80,6 +80,7 @@ services=" apt-daily-upgrade.timer apt-daily.timer console-setup.service +e2scrub_reap.service keyboard-setup.service motd-news.timer remote-fs.target diff --git a/subjects/ascii-art-web/ascii-art-web-dockerize.audit.en.md b/subjects/ascii-art-web/ascii-art-web-dockerize.audit.en.md index c803eab78..8f280f039 100644 --- a/subjects/ascii-art-web/ascii-art-web-dockerize.audit.en.md +++ b/subjects/ascii-art-web/ascii-art-web-dockerize.audit.en.md @@ -2,7 +2,7 @@ ###### Does the project have a DockerFile? -##### Try running the [command](https://docs.docker.com/engine/reference/commandline/image_build/) `"docker image build [OPTIONS] PATH | URL | -"` to build the image. (example : `"docker image build -f Dockerfile -t ."`). +##### Try running the [command](https://docs.docker.com/engine/reference/commandline/image_build/) `"docker image build [OPTIONS] PATH | URL | -"` to build the image using the project Dockerfile. (example : `"docker image build -f Dockerfile -t ."`). ``` student$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE @@ -10,7 +10,7 @@ REPOSITORY TAG IMAGE ID CREA ``` ###### Run the command `"docker images"` to see all images. Does the docker image build as above? -##### Try running the [command](https://docs.docker.com/engine/reference/commandline/container_run/) `"docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]"` to start the container. (example : `"docker container run -p --detach --name "`) +##### Try running the [command](https://docs.docker.com/engine/reference/commandline/container_run/) `"docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]"` to start the container using the image just created. (example : `"docker container run -p --detach --name "`) ``` student$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES diff --git a/subjects/ascii-art/ascii-art-color.audit.en.md b/subjects/ascii-art/ascii-art-color.audit.en.md index c330c99ac..c9f53591e 100644 --- a/subjects/ascii-art/ascii-art-color.audit.en.md +++ b/subjects/ascii-art/ascii-art-color.audit.en.md @@ -1,31 +1,43 @@ #### Functional ##### Try passing as arguments `"hello world" --color=red`. -###### Does it displays the expected result? +###### Does it display 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)? +###### Does it display the expected result (the corresponding set of letters with that color)? +##### Try specifying letter to be colored (the second letter). +###### Does it display 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)? +###### Does it display 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? +##### Try passing as arguments a random string with lower and upper case letters, and a random color in the color flag ("--color="). +###### Does it display the expected result? + +##### Try passing as arguments a random string with lower case letters, numbers and spaces, and a random color in the color flag ("--color="). +###### Does it display the expected result? + +##### Try passing as arguments a random string with special characters, and a random color in the color flag ("--color="), specifying one letter to be coloured. +###### Does it display the expected result? + +##### Try passing as arguments a random string with lower, upper case, spaces and numbers letters and a random color in the color flag ("--color="), specifying a set of letters to be coloured. +###### Does it display the expected result? + #### General -##### +Is it easy/intuitive to specify letter(s) to be coloured? -##### +Can you use more than one color in the same string? +###### +Is it easy/intuitive to specify letter(s) to be colored? +###### +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? +###### +Does the project run quickly and effectively (favoring of recursive, no unnecessary data requests, etc.)? +###### +Is the output of the program well structured? Does any letter seem 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)? diff --git a/subjects/ascii-art/ascii-art-color.en.md b/subjects/ascii-art/ascii-art-color.en.md index 98d156098..8b8cb80ed 100644 --- a/subjects/ascii-art/ascii-art-color.en.md +++ b/subjects/ascii-art/ascii-art-color.en.md @@ -4,7 +4,7 @@ You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/ascii-art.en) as in the first subject but with colors. -- The output should manipulate colors using the **flag** `--color=`, in which `--color` is the flag and `` is the color of choice. +- The output should manipulate colors using the **flag** `--color=`, in which `--color` is the flag and `` is the color name of choice (ex: orange, green, blue). - 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. diff --git a/subjects/ascii-art/ascii-art-fs.audit.en.md b/subjects/ascii-art/ascii-art-fs.audit.en.md index ba5478c3d..8f38254e0 100644 --- a/subjects/ascii-art/ascii-art-fs.audit.en.md +++ b/subjects/ascii-art/ascii-art-fs.audit.en.md @@ -75,14 +75,14 @@ o \ / ###### Does it display the string in the right template as an ASCII art representation as above? ##### Try passing as arguments `ABCDEFGHIJKLMNOPQRSTUVWXYZ shadow` ``` - - _|_| _|_|_| _|_|_| _|_|_| _|_|_|_| _|_|_|_| _|_|_| _| _| _|_|_| _| _| _| _| _| _| _| _| _|_| _|_|_| _|_| _|_|_| _|_|_| _|_|_|_|_| _| _| _| _| _| _| _| _| _| _| _|_|_|_|_| -_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _|_| _|_| _|_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| -_|_|_|_| _|_|_| _| _| _| _|_|_| _|_|_| _| _|_| _|_|_|_| _| _| _|_| _| _| _| _| _| _| _| _| _| _|_|_| _| _|_| _|_|_| _|_| _| _| _| _| _| _| _| _| _| _| _| -_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| -_| _| _|_|_| _|_|_| _|_|_| _|_|_|_| _| _|_|_| _| _| _|_|_| _|_| _| _| _|_|_|_| _| _| _| _| _|_| _| _|_| _| _| _| _|_|_| _| _|_| _| _| _| _| _| _| _|_|_|_|_| - - + + _|_| _|_|_| _|_|_| _|_|_| _|_|_|_| _|_|_|_| _|_|_| _| _| _|_|_| _| _| _| _| _| _| _| _| _|_| _|_|_| _|_| _|_|_| _|_|_| _|_|_|_|_| _| _| _| _| _| _| _| _| _| _| _|_|_|_|_| +_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _|_| _|_| _|_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| +_|_|_|_| _|_|_| _| _| _| _|_|_| _|_|_| _| _|_| _|_|_|_| _| _| _|_| _| _| _| _| _| _| _| _| _| _|_|_| _| _|_| _|_|_| _|_| _| _| _| _| _| _| _| _| _| _| _| +_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| +_| _| _|_|_| _|_|_| _|_|_| _|_|_|_| _| _|_|_| _| _| _|_|_| _|_| _| _| _|_|_|_| _| _| _| _| _|_| _| _|_| _| _| _| _|_|_| _| _|_| _| _| _| _| _| _| _|_|_|_|_| + + ``` ###### Does it display the string in the right template as an ASCII art representation as above? ##### Try passing as arguments `\"#$%&/()*+,-./ thinkertoy` @@ -109,8 +109,25 @@ 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 a random string with upper and lower case letters followed by one of the templates names (standard, shadow, thinkertoy, or other). +###### Does it display the expected string in the right template as an ASCII art representation? + +##### Try passing as arguments a random string with numbers followed by one of the templates names (standard, shadow, thinkertoy, or other). +###### Does it display the expected string in the right template as an ASCII art representation? + +##### Try passing as arguments a random string with special characters followed by one of the templates names (standard, shadow, thinkertoy, or other). +###### Does it display the expected string in the right template as an ASCII art representation? + +##### Try passing as arguments a random string with numbers, spaces, special characters, upper and lower case letters followed by one of the templates names (standard, shadow, thinkertoy, or other). +###### Does it display the expected string in the right template as an ASCII art representation? + ###### Is the file system well organized? +#### General + +###### +Does the project contain their own templates? + #### Basic ###### +Does the project runs quickly and effectively (Favoring of recursive, no unnecessary data requests, etc.)? diff --git a/subjects/ascii-art/ascii-art-fs.en.md b/subjects/ascii-art/ascii-art-fs.en.md index eab2d59e9..066241f99 100644 --- a/subjects/ascii-art/ascii-art-fs.en.md +++ b/subjects/ascii-art/ascii-art-fs.en.md @@ -33,7 +33,7 @@ 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!" shadow _| _| _| _| _|_|_|_|_| _| _| _| _| _|_| _| _| _|_| _| _|_|_| _|_| _| _|_| _|_| _| @@ -42,7 +42,7 @@ _| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _|_|_| _| _| _|_| _| _| _| _|_|_| _| _|_|_| _| -student@ubuntu:~/ascii-art$ ./ascii-art "Hello There" thinkertoy +student@ubuntu:~/ascii-art$ ./ascii-art "Hello There!" thinkertoy o o o o o-O-o o | | | | | | o diff --git a/subjects/ascii-art/ascii-art-justify.audit.en.md b/subjects/ascii-art/ascii-art-justify.audit.en.md index d55a3c6b4..904da7e4e 100644 --- a/subjects/ascii-art/ascii-art-justify.audit.en.md +++ b/subjects/ascii-art/ascii-art-justify.audit.en.md @@ -1,50 +1,83 @@ #### Functional Project Questions -##### Try passing as arguments `left standard --align=right` -###### Does it displays the correct result at the right side? +##### Try passing as arguments `"left standard --align=right"` -##### Try passing as arguments `right standard --align=left` -###### Does it displays the correct result at the left side? +###### Does it display the correct result at the right side? -##### Try passing as arguments `hello shadow --align=center` -###### Does it displays the correct result at the center? +##### Try passing as arguments `"right standard --align=left"` -##### Try passing as arguments `"1 Two 4" shadow --align=justify` -###### Does it displays the correct result justified? +###### Does it display the correct result at the left side? -##### Try passing as arguments `23/32 standard --align=right` -###### Does it displays the correct result at the right side? +##### Try passing as arguments `"hello shadow --align=center"` -##### Try passing as arguments `ABCabc123 thinkertoy --align=right` -###### Does it displays the correct result at the right side? +###### Does it display the correct result at the center? -##### Try passing as arguments `'!#$%&"' thinkertoy --align=center` -###### Does it displays the correct result at the center? +##### Try passing as arguments `""1 Two 4" shadow --align=justify"` -##### Try passing as arguments `"23Hello World!" standard --align=left` -###### Does it displays the correct result at the left side? +###### Does it display the correct result justified? -##### Try passing as arguments `"HELLO there HOW are YOU?!" thinkertoy --align=justify` -###### Does it displays the correct result justified? +##### Try passing as arguments `"23/32 standard --align=right"` -##### Try passing as arguments `"a -> A b -> B c -> C" shadow --align=right` -###### Does it displays the correct result at the right side? +###### Does it display the correct result at the right side? -##### Try reducing the terminal window and run `abcd shadow --align=right` -###### Does the representation adapt to the terminal size displaying the right result in the right side? +##### Try passing as arguments `"ABCabc123 thinkertoy --align=right"` + +###### Does it display the correct result at the right side? + +##### Try passing as arguments `"#$%&" thinkertoy --align=center"` + +###### Does it display the correct result at the center? + +##### Try passing as arguments `""23Hello World!" standard --align=left"` + +###### Does it display the correct result at the left side? + +##### Try passing as arguments `""HELLO there HOW are YOU?!" thinkertoy --align=justify"` + +###### Does it display the correct result justified? + +##### Try passing as arguments `""a -> A b -> B c -> C" shadow --align=right"` + +###### Does it display the correct result at the right side? + +##### Try reducing the terminal window and run `"abcd shadow --align=right"` -##### Try reducing the terminal window and run `ola standard --align=center` ###### Does the representation adapt to the terminal size displaying the right result in the right side? +##### Try reducing the terminal window and run `"ola standard --align=center"` + +###### Does the representation adapt to the terminal size displaying the right result in the center? + +##### Try passing as arguments a random string with lower and upper case letters, and the align flag ("--align=") followed by a random alignment (left, right, center or justify). + +###### Does it display the expected result? + +##### Try passing as arguments a random string with lower case letters, numbers and spaces, and the align flag ("--align=") followed by a random alignment (left, right, center or justify). + +###### Does it display the expected result? + +##### Try passing as arguments a random string with special characters, and the align flag ("--align=") followed by a random alignment (left, right, center or justify). + +###### Does it display the expected result? + +##### Try passing as arguments a random string with lower, upper case, spaces and numbers letters, and the align flag ("--align=") followed by a random alignment (left, right, center or justify). + +###### Does it display the expected result? + #### 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://public.01-edu.org/subjects/good-practices.en)? #### Social ###### +Did you learn anything from this project? + ###### +Would you recommend/nominate this program as an example for the rest of the school? diff --git a/subjects/ascii-art/ascii-art-output.audit.en.md b/subjects/ascii-art/ascii-art-output.audit.en.md index 0a370515a..38e7c1874 100644 --- a/subjects/ascii-art/ascii-art-output.audit.en.md +++ b/subjects/ascii-art/ascii-art-output.audit.en.md @@ -121,6 +121,18 @@ student$ cat test07.txt ``` ###### Does it save the right output in the right file? +##### Try passing as arguments a random string with lower and upper case letters, and the output flag ("--output=") followed by a random file name. +###### Does it save the right output in the right file? + +##### Try passing as arguments a random string with lower case letters, numbers and spaces, and the output flag ("--output=") followed by a random file name. +###### Does it save the right output in the right file? + +##### Try passing as arguments a random string with special characters, and the output flag ("--output=") followed by a random file name. +###### Does it save the right output in the right file? + +##### Try passing as arguments a random string with lower, upper case, spaces and numbers letters, and the output flag ("--output=") followed by a random file name. +###### Does it save the right output in the right file? + ###### Are all the test files tested saved? #### Basic diff --git a/subjects/ascii-art/ascii-art-output.en.md b/subjects/ascii-art/ascii-art-output.en.md index 446de9419..2270098f0 100644 --- a/subjects/ascii-art/ascii-art-output.en.md +++ b/subjects/ascii-art/ascii-art-output.en.md @@ -2,7 +2,7 @@ ### Objectives -- You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/ascii-art.en) as in the first subject but writing the result into a file. +- You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/ascii-art.en) as in the first subject **while** writing the result into a file. - The file must be named by using the flag `--output=`, in which `--output` is the flag and `` is the file name. @@ -13,13 +13,13 @@ This project will help you learn about : - Ways to receive data. - Ways to output data. - Manipulation of strings. -- Learning about the choice of outputs. +- Choices of outputs. ### Instructions - Your project must be written in **Go**. - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). -- It is recommended that the code should present a **test file**. +- It is recommended that the code presents a **test file**. ### Usage diff --git a/subjects/ascii-art/ascii-art-reverse.audit.en.md b/subjects/ascii-art/ascii-art-reverse.audit.en.md index 575c1e22d..2a717a566 100644 --- a/subjects/ascii-art/ascii-art-reverse.audit.en.md +++ b/subjects/ascii-art/ascii-art-reverse.audit.en.md @@ -25,6 +25,18 @@ `ABCDEFGHIJKLMNOPQRSTUVWXYZ` ###### Does it display the value above? +##### Try passing to the reverse flag a file containing a graphical representation in ASCII of a random string with lower and upper case letters. +###### Does it display the expected result? + +##### Try passing to the reverse flag a file containing a graphical representation in ASCII of a random string with lower case letters, numbers and spaces. +###### Does it display the expected result? + +##### Try passing to the reverse flag a file containing a graphical representation in ASCII of a random string with special characters. +###### Does it display the expected result? + +##### Try passing to the reverse flag a file containing a graphical representation in ASCII of a random string with lower, upper case, spaces and numbers letters. +###### Does it display the expected result? + #### Basic ###### +Does the project runs quickly and effectively? (Favoring recursive, no unnecessary data requests, etc) diff --git a/subjects/ascii-art/ascii-art.audit.en.md b/subjects/ascii-art/ascii-art.audit.en.md index 20f40d16e..cb2d162c7 100644 --- a/subjects/ascii-art/ascii-art.audit.en.md +++ b/subjects/ascii-art/ascii-art.audit.en.md @@ -106,26 +106,26 @@ ###### Does it display the right graphical representation in ASCII as above? ##### Try passing `"1a\"#FdwHywR&/()="` as argument. ``` - _ _ _ _ ______ _ _ _ _____ __ __ __ - _ ( | ) _| || |_ | ____| | | | | | | | __ \ ___ / / / / \ \ ______ -/ | __ _ V V |_ __ _| | |__ __| | __ __ | |__| | _ _ __ __ | |__) | ( _ ) / / | | | | |______| -| | / _` | _| || |_ | __| / _` | \ \ /\ / / | __ | | | | | \ \ /\ / / | _ / / _ \/\ / / | | | | ______ -| | | (_| | |_ __ _| | | | (_| | \ V V / | | | | | |_| | \ V V / | | \ \ | (_> < / / | | | | |______| -|_| \__,_| |_||_| |_| \__,_| \_/\_/ |_| |_| \__, | \_/\_/ |_| \_\ \___/\/ /_/ | | | | - __/ / \_\ /_/ - |___/ + _ _ _ _ ______ _ _ _ _____ __ __ __ + _ ( | ) _| || |_ | ____| | | | | | | | __ \ ___ / / / / \ \ ______ +/ | __ _ 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. @@ -154,26 +154,26 @@ ###### 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 |_ __ _| / __) / / ( _ ) |/ | | | | \ ` ' / _| |_ ______ / / - \ \ | | _| || |_ \__ \ / / / _ \/\ | | | | |_ _| |_ _| |______| / / - \ \ |_| |_ __ _| ( / / / _ | (_> < | | | | / , . \ |_| _ _ / / - \_\ (_) |_||_| |_| /_/ (_) \___/\/ | | | | \/|_|\/ ( ) (_) /_/ - \_\ /_/ |/ - +__ _ _ _ _ _ _ _ __ _ __ __ _ __ +\ \ | | ( | ) _| || |_ | | (_) / / ___ ( ) / / \ \ /\| |/\ _ / / + \ \ | | V V |_ __ _| / __) / / ( _ ) |/ | | | | \ ` ' / _| |_ ______ / / + \ \ | | _| || |_ \__ \ / / / _ \/\ | | | | |_ _| |_ _| |______| / / + \ \ |_| |_ __ _| ( / / / _ | (_> < | | | | / , . \ |_| _ _ / / + \_\ (_) |_||_| |_| /_/ (_) \___/\/ | | | | \/|_|\/ ( ) (_) /_/ + \_\ /_/ |/ + ``` ###### Does it display the right graphical representation in ASCII as above? ##### Try passing `"ABCDEFGHIJKLMNOPQRSTUVWXYZ"` as argument. @@ -186,7 +186,6 @@ __ _ _ _ _ _ _ _ __ _ __ __ _ /_/ \_\ |____/ \_____| |_____/ |______| |_| \_____| |_| |_| |_____| \____/ |_|\_\ |______| |_| |_| |_| \_| \____/ |_| \___\_\ |_| \_\ |_____/ |_| \____/ \/ \/ \/ /_/ \_\ |_| /_____| - ``` ###### Does it display the right graphical representation in ASCII as above? ##### Try passing `"abcdefghijklmnopqrstuvwxyz"` as argument. @@ -202,6 +201,18 @@ __ _ _ _ _ _ _ _ __ _ __ __ _ ``` ###### Does it display the right graphical representation in ASCII as above? +##### Try passing `` with at least four lower case letters and three upper case letters. +###### Does it display the right graphical representation in ASCII as expected? + +##### Try passing `` with at least five lower case letters, a space and two numbers. +###### Does it display the right graphical representation in ASCII as expected? + +##### Try passing `` with at least one upper case letters and 3 special characters. +###### Does it display the right graphical representation in ASCII as expected? + +##### Try passing `` with at least two lower case letters, two spaces, one number, two special characters and three upper case letters. +###### Does it display the right graphical representation in ASCII as expected? + #### Basic ###### +Does the project runs quickly and effectively? (Favoring recursive, no unnecessary data requests, etc) diff --git a/subjects/ascii-art/ascii-art.en.md b/subjects/ascii-art/ascii-art.en.md index 41302ae48..eb90b26dd 100644 --- a/subjects/ascii-art/ascii-art.en.md +++ b/subjects/ascii-art/ascii-art.en.md @@ -2,10 +2,10 @@ ### Objectives -Ascii-art consists on receiving a `string` has an argument and outputting the `string` in a graphic representation of ASCII. +Ascii-art consists on receiving a `string` as 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. +- Take a look at the ASCII manual. This project will help you learn about : @@ -20,14 +20,14 @@ This project will help you learn about : - Your project must be written in **Go**. - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). -- It is recommended that the code should present a **test file**. +- It is recommended that the code present a **test file**. - It will be given some [**banner**](https://github.com/01-edu/public/blob/master/subjects/ascii-art) 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`. +- Characters are separated by a new line `\n`. - Here is an example of ' ', '!' and '"'(one dot represents one space) : ```console diff --git a/subjects/go-reloaded/go-reloaded.audit.en.md b/subjects/go-reloaded/go-reloaded.audit.en.md index b9924dee7..41474c0d6 100644 --- a/subjects/go-reloaded/go-reloaded.audit.en.md +++ b/subjects/go-reloaded/go-reloaded.audit.en.md @@ -257,7 +257,7 @@ str = <<==123==>>In<<==123==>>1820,<<==123==>>Thomas<<==123==>>de<<==123==>>Colm ##### Try executing the program passing as argument: `"happy thoughts" "good luck"` `huppy thooghts guod lack` ###### Does the program returns the value above? -##### Try executing the program passing as argument: `"al's elEphAnt is overly underweight!" +##### 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? diff --git a/subjects/groupie-trackers/groupie-trackers-search-bar.audit.en.md b/subjects/groupie-trackers/groupie-trackers-search-bar.audit.en.md index 5fc6be7cf..faf4fc4a3 100644 --- a/subjects/groupie-trackers/groupie-trackers-search-bar.audit.en.md +++ b/subjects/groupie-trackers/groupie-trackers-search-bar.audit.en.md @@ -30,6 +30,18 @@ ##### Try to search for the creation date `"1965"`. ###### Does it present as result "Scorpions" and "Pink Floyd"? +##### Start typing an artist/band beginning with `"G"`. +###### Does it present as suggestion the band you were looking for? + +##### Start typing a location of one of the concerts. +###### Does it present as suggestion the location you were looking for? + +##### Try to search for an artist/band member beginning with `"R"`. +###### Does it present the artist/band you were looking for? + +##### Try to search for a creation date of an artist/band. +###### Does it present the artist/band you were looking for? + #### Basic ###### +Does the code obey the [good practices](https://public.01-edu.org/subjects/good-practices.en)? diff --git a/subjects/groupie-trackers/groupie-trackers-search-bar.en.md b/subjects/groupie-trackers/groupie-trackers-search-bar.en.md index d3692dde3..bbdf59335 100644 --- a/subjects/groupie-trackers/groupie-trackers-search-bar.en.md +++ b/subjects/groupie-trackers/groupie-trackers-search-bar.en.md @@ -15,14 +15,14 @@ Groupie-trackers-search-bar consists of creating a functional program that searc - The program must handle case sensitive. - The search bar must have typing suggestions as you write. - The search bar must identify and display in each suggestion the individual type of the search cases. (ex: Freddie Mercury -> member) - - Example if you start writing `"phil"` it should appear as suggestions `Phil Collins - member` and `Phil Collins - artist/band`. This is just an example of a display. + - For example if you start writing `"phil"` it should appear as suggestions `Phil Collins - member` and `Phil Collins - artist/band`. This is just an example of a display. This project will help you learn about : - - Manipulation, display and storage of data. - - HTML. - - [Events](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/) creation and display. - - JSON files and format. +- Manipulation, display and storage of data. +- HTML. +- [Events](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/) creation and display. +- JSON files and format. ### Instructions diff --git a/subjects/my-ls-1/my-ls-1.audit.en.md b/subjects/my-ls-1/my-ls-1.audit.en.md index fa8139df9..90c5e7e9b 100644 --- a/subjects/my-ls-1/my-ls-1.audit.en.md +++ b/subjects/my-ls-1/my-ls-1.audit.en.md @@ -1,62 +1,81 @@ #### Functional ##### Run both my-ls-1 and the system command `ls` with no arguments. -###### Does it displays the same files and/or folders in the same order? + +###### Does it display the same files and/or folders in the same order? ##### Run both my-ls-1 and the system command `ls` with the arguments: ``. -###### Does it displays the same file? + +###### Does it display the same file? ##### Run both my-ls-1 and the system command `ls` with the arguments: ``. -###### Does it displays the same files and/or folders in the same order? + +###### Does it display the same files and/or folders in the same order? ##### Run both my-ls-1 and the system command `ls` with the flag: `-l`. -###### Does it displays the same files and/or folders with the same display? + +###### Does it display the same files and/or folders with the same display? ##### Run both my-ls-1 and the system command `ls` with the arguments: `-l `. -###### Does it displays the same file with the same display? + +###### Does it display the same file with the same display? ##### Run both my-ls-1 and the system command `ls` with the arguments: `-l `. -###### Does it displays the same files and/or folders with the same display? + +###### Does it display the same files and/or folders with the same display? ##### Run both my-ls-1 and the system command `ls` with the flag: `-l /usr/bin`. -###### Does it displays the same files and/or folders with the same display? Be aware of symbolic links. + +###### Does it display the same files and/or folders with the same display? Be aware of symbolic links. ##### Run both my-ls-1 and the system command `ls` with the flag: `-R`, in a directory with folders in it. -###### Does it displays the same files and/or folders? + +###### Does it display the same files and/or folders? ##### Run both my-ls-1 and the system command `ls` with the flag: `-a`. -###### Does it displays the same files and/or folders in the same order? + +###### Does it display the same files and/or folders in the same order? ##### Run both my-ls-1 and the system command `ls` with the flag: `-r`. -###### Does it displays the same files and/or folders in the same order? + +###### Does it display the same files and/or folders in the same order? ##### Run both my-ls-1 and the system command `ls` with the flag: `-t`. -###### Does it displays the same files and/or folders in the same order? + +###### Does it display the same files and/or folders in the same order? ##### Run both my-ls-1 and the system command `ls` with the flag: `-la`. -###### Does it displays the same files and/or folders in the same order? + +###### Does it display the same files and/or folders in the same order? ##### Run both my-ls-1 and the system command `ls` with the arguments: `-l -t `. -###### Does it displays the same files and/or folders in the same order? + +###### Does it display the same files and/or folders in the same order? ##### Run both my-ls-1 and the system command `ls` with the arguments: `-lRr `, in which the directory chosen contains folders. -###### Does it displays the same files and/or folders in the same order? + +###### Does it display the same files and/or folders in the same order? #### General ###### +Does the program runs with colors as in the ls command? + ###### +Does the program has other flags except for the mandatory ones? ##### Try running the program with `-R ~` and with the command time before the program name (ex: "time ./my-ls-1 -R ~"). + ###### +Is the real time less than 1,5 seconds? #### Basic ###### +Does the code obey the [good practices](https://public.01-edu.org/subjects/good-practices.en)? + ###### +Is there a test file for this code? + ###### +Are the tests checking each possible case? #### Social ###### +Did you learn anything from this project? + ###### +Would you recommend/nominate this program as an example for the rest of the school? diff --git a/subjects/my-ls-1/my-ls-1.en.md b/subjects/my-ls-1/my-ls-1.en.md index 34b45b6bc..9963191d0 100644 --- a/subjects/my-ls-1/my-ls-1.en.md +++ b/subjects/my-ls-1/my-ls-1.en.md @@ -31,6 +31,18 @@ This project will help you learn about : - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). - It is recommended that the code should present a **test file**. +### Allowed packages + +- fmt +- os +- os/user +- strconv +- strings +- syscall +- time +- math/rand +- errors + ### Hint - We strongly recommend that you account for the implications of the option `-R` from the very beginning of your code. diff --git a/subjects/net-cat/net-cat.audit.en.md b/subjects/net-cat/net-cat.audit.en.md index 0be8de0c1..b09312e80 100644 --- a/subjects/net-cat/net-cat.audit.en.md +++ b/subjects/net-cat/net-cat.audit.en.md @@ -1,13 +1,22 @@ #### Functional -##### Try running `"./net-cat -p 8080"`. -###### Is the server listening for connections? +##### Try running `"./TCPChat"`. +###### Is the server listening for connections on the default port? -##### Try opening 3 terminals, run on the first terminal the command `"./net-cat -p "` and on the second and third terminal run the command `"./net-cat "`. +##### Try running `"./TCPChat" 2525 localhost`. +``` +[USAGE]: ./TCPChat $port +``` +###### Did server respond with usage, as above? + +##### Try running `"./TCPChat 2525"`. +###### Is the server listening for connections on the port 2525? + +##### Try opening 3 terminals, run on the first terminal the command `"./TCPChat "` and on the second and third terminal run the command `"nc "`. ###### Does both clients connect to the server with success? -##### Try opening 4 terminals, run on the first terminal the command `"./net-cat -u -p "` and on the second, third and fourth terminal run the command `"./net-cat -u "`. -###### Does all clients connect to the server with [UDP](https://www.privateinternetaccess.com/blog/2018/12/tcp-vs-udp-understanding-the-difference/) connection? +##### Try creating a server and 2 Clients. +###### Did the server responded with a linux logo and asked for the name? ##### Try creating a server and 2 Clients. ###### Do all Clients receive a message informing that the Client joined the chat? @@ -16,10 +25,10 @@ ###### Does the second Client receive the message? ##### Try creating a server and 1 Client and send some messages using this Client. Then create a new Client. -###### Can the new Client see all the messages? +###### Can the new Client see all the previous messages? ##### Try creating a server and 3 Clients and send a message using the second Client. -###### Does all the Clients(first, second and third) received the same message? +###### Does all the Clients (first, second and third) received the same message? ##### Try creating a server and use 2 or 3 different computers and create for each computer one Client. ###### Did the server/Clients connected with success? @@ -31,16 +40,27 @@ ###### Does the rest of the Clients receive a message notifying that the Client left? ##### Try creating a server and 3 Clients. Then send messages between the Clients. -###### Are the messages identified by the name of each Client and the time that the messages was sent? +``` +[2020-01-20 15:48:41][client.name]:[client.message] +``` +###### Are the messages identified by the name of each Client and the time that the messages was sent, as above? ###### Is the connections between server and Clients well established? +###### Does the project present go routines? + +###### Does the project use channels or mutexe? + +##### Are the students using just the allowed functions? + #### General ###### +Can the Clients change their names? ###### +Is the chat group informed if a Client changes his name? ###### +Does the server produce logs about Clients activities? +###### +Does the server logs saved into a file? ###### +Is there more NetCat flags implemented? +###### +Does the project present a Terminal UI using JUST this package : https://github.com/jroimartin/gocui? #### Basic diff --git a/subjects/net-cat/net-cat.en.md b/subjects/net-cat/net-cat.en.md index 0540771e8..8b7d64aae 100644 --- a/subjects/net-cat/net-cat.en.md +++ b/subjects/net-cat/net-cat.en.md @@ -2,46 +2,26 @@ ### Objectives -This project consists on recreating the **NetCat in a Server-Client Architecture** that can run in a server mode on a specified port listening for incoming connections, and it can be used in client mode, trying to connect on a specified port and transmitting information to the server. +This project consists on recreating the **NetCat in a Server-Client Architecture** that can run in a server mode on a specified port listening for incoming connections, and it can be used in client mode, trying to connect to a specified port and transmitting information to the server. -- NetCat, `nc` the system command, is a computer network utility for reading from and writing to network connections using TCP or UDP. It is used for anything involving TCP, UDP, or UNIX-domain sockets, it is able to open TCP connections, send UDP packages, listen on arbitrary TCP and UDP ports... +- NetCat, `nc` system command, is a computer network utility for reading from and writing to network connections using TCP or UDP. It is used for anything involving TCP, UDP, or UNIX-domain sockets, it is able to open TCP connections, send UDP packages, listen on arbitrary TCP and UDP ports... - To see more information about NetCat inspect the manual `man nc`. -Here is a simple example of connection and transmission between Server-Client by creating a TCP socket between server and client. +Your project must work in a similar way that NetCat works, in other words, you must create a group chat. The project must have the following features : -- Open two terminals, one for the server and the other for Client. - - Use the following commands for the server side : - - ```console - stuednt$ mawk -W interactive '$0="\033[1;32mServer: \033[0m"$0' | nc -l -p - Client: Hello it's the CLIENT talking - hello there - - ``` - - - Use the following commands for the client side : - - ```console - stuednt$ mawk -W interactive '$0="\033[1;32mClient: \033[0m"$0' | nc - Hello it's the CLIENT talking - Server: Hello there - - ``` - - - To see the host IP use the command `ifconfig` on the host machine. - -Your project must work in a similar way that NetCat works, in other words you must create a group chat. The project must present : - -- TCP or UDP connection between server and multiple clients (relation of 1 to many), the type of connection must be established by using a flag, just like `nc`, by default it uses TCP connection, if you want to use UDP connection present the flag `-u`. -- Each Client must have an user name. +- TCP connection between server and multiple clients (relation of 1 to many). +- A name requirement to the client. +- Control connections quantity. - Clients must be able to send messages to the chat. -- Messages sent, must be identified by the time that was sent and the user name of who sent the message. -- If a Client joins the chat, all the messages sent to the chat must be uploaded to the new Client. +- Do not broadcast EMPTY messages from a client. +- Messages sent, must be identified by the time that was sent and the user name of who sent the message, example : `[2020-01-20 15:48:41][client.name]:[client.message]` +- If a Client joins the chat, all the previous messages sent to the chat must be uploaded to the new Client. - If a Client connects to the server, the rest of the Clients must be informed by the server that the Client joined the group. - If a Client exits the chat, the rest of the Clients must be informed by the server that the Client left. - All Clients must receive the messages sent by other Clients. - If a Client leaves the chat, the rest of the Clients must not disconnect. +- If there is no port specified, then set as default the port 8989. Otherwise, program must respond with usage message: `[USAGE]: ./TCPChat $port` This project will help you learn about : @@ -52,70 +32,163 @@ This project will help you learn about : - TCP/UDP socket - [Channels](https://tour.golang.org/concurrency/2) - [Goroutines](https://tour.golang.org/concurrency/1) +- Mutexes - IP and [ports](https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers) -### Hints - -- Try to find out more about the flags `-u`, `-p` and `-l`. - ### Instructions -- Your project must be written in **Go**. -- Your project must use TCP or UDP. -- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). -- It is recommended that the code should present a **test file** for the server connection and the client connection. -- You have to be able to handle the errors from server side and client side. +- Your project must be written in **Go** +- Start TCP server, listen and accept connections +- Your project must have Go-routines +- Your project must have channels or Mutexes +- Maximum 10 connections +- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en) +- It is recommended that the code should present a **test file** for the server connection and the client connection +- You have to be able to handle the errors from server side and client side + +### Allowed Packages + +- io +- log +- os +- fmt +- net +- sync +- time +- bufio +- errors +- strings +- reflect ### Usage -Here is a simple example of a group chat : +```console +student$ go build +student$ ./TCPChat +Listening on the port :8989 +student$ ./TCPChat 2525 +Listening on the port :2525 +student$ ./TCPChat 2525 localhost +[USAGE]: ./TCPChat $port +``` -- Server side : +- You should answer the client with a linux logo and ask for their name, when connection is received ```console -student$ ./net-cat -p 8080 -listening on port 8080.... - +student$ nc $IP $port +Welcome to TCP-Chat! + _nnnn_ + dGGGGMMb + @p~qp~~qMb + M|@||@) M| + @,----.JM| + JS^\__/ qKL + dZP qKRb + dZP qKKb + fZP SMMb + HZM MMMM + FqM MMMM + __| ". |\dS"qML + | `. | `' \Zq +_) \.___.,| .' +\____ )MMMMMP| .' + `-' `--' +[ENTER YOUR NAME]: ``` -- Two Clients running at the same time +- Accept connection with non-empty name -- Client 2 : +The client : ```console -stuednt$ ./net-cat 192.168.1.123 8080 -wellcome, you are connected +student$ nc $IP $port +``` -enter user name : client2 -your name is client2 +Server: -client2 joined the chat... -client1 joined the chat... +```console +student$ ./TCPChat 2525 +Listening on the port :2525 +``` -hello -client2 at 18:12- hello -client1 at 18:13- hello man -how are you? -client2 at 18:15- how are you? -client1 left the chat... +Client1 (Yenlik): +```console +student$ nc localhost 2525 +Welcome to TCP-Chat! + _nnnn_ + dGGGGMMb + @p~qp~~qMb + M|@||@) M| + @,----.JM| + JS^\__/ qKL + dZP qKRb + dZP qKKb + fZP SMMb + HZM MMMM + FqM MMMM + __| ". |\dS"qML + | `. | `' \Zq +_) \.___.,| .' +\____ )MMMMMP| .' + `-' `--' +[ENTER YOUR NAME]: Yenlik +[2020-01-20 16:03:43][Yenlik]:hello +[2020-01-20 16:03:46][Yenlik]:How are you? +[2020-01-20 16:04:10][Yenlik]: +Lee has joined our chat... +[2020-01-20 16:04:15][Yenlik]: +[2020-01-20 16:04:32][Lee]:Hi everyone! +[2020-01-20 16:04:32][Yenlik]: +[2020-01-20 16:04:35][Lee]:How are you? +[2020-01-20 16:04:35][Yenlik]:great, and you? +[2020-01-20 16:04:41][Yenlik]: +[2020-01-20 16:04:44][Lee]:good! +[2020-01-20 16:04:44][Yenlik]: +[2020-01-20 16:04:50][Lee]:alright, see ya! +[2020-01-20 16:04:50][Yenlik]:bye-bye! +[2020-01-20 16:04:57][Yenlik]: +Lee has left our chat... +[2020-01-20 16:04:59][Yenlik]: ``` -- Client 1 : +Client2 (Lee): ```console -stuednt$ ./net-cat 192.168.1.123 8080 -wellcome, you are connected - -enter user name : client1 -your name is client1 +student$ nc localhost 2525 +Yenliks-MacBook-Air:simpleTCPChat ybokina$ nc localhost 2525 +Yenliks-MacBook-Air:simpleTCPChat ybokina$ nc localhost 2525 +Welcome to TCP-Chat! + _nnnn_ + dGGGGMMb + @p~qp~~qMb + M|@||@) M| + @,----.JM| + JS^\__/ qKL + dZP qKRb + dZP qKKb + fZP SMMb + HZM MMMM + FqM MMMM + __| ". |\dS"qML + | `. | `' \Zq +_) \.___.,| .' +\____ )MMMMMP| .' + `-' `--' +[ENTER YOUR NAME]: Lee +[2020-01-20 16:04:15][Lee]:Hi everyone! +[2020-01-20 16:04:32][Lee]:How are you? +[2020-01-20 16:04:35][Lee]: +[2020-01-20 16:04:41][Yenlik]:great, and you? +[2020-01-20 16:04:41][Lee]:good! +[2020-01-20 16:04:44][Lee]:alright, see ya! +[2020-01-20 16:04:50][Lee]: +[2020-01-20 16:04:57][Yenlik]:bye-bye! +[2020-01-20 16:04:57][Lee]:^C +``` -client2 joined the chat... -client1 joined the chat... +## Bonus -client2 at 18:12- hello -hello man -client1 at 18:13- hello man -client2 at 18:15- how are you? -^C -``` +- Terminal UI (you are allowed to use only this package : https://github.com/jroimartin/gocui) +- Logging into the file +- Creating more than 1 group chat diff --git a/subjects/push-swap/push-swap.audit.en.md b/subjects/push-swap/push-swap.audit.en.md index 79c30b687..0b6634c82 100644 --- a/subjects/push-swap/push-swap.audit.en.md +++ b/subjects/push-swap/push-swap.audit.en.md @@ -1,69 +1,100 @@ #### Functional ##### Try to run `"./push_swap"`. + ###### Does it display nothing? + ##### Try to run `"./push_swap 2 1 3 6 5 8"`. + ###### Does it display a valid solution and less than 9 instructions? + ##### Try to run `"./push_swap 0 1 2 3 4 5"`. + ###### Does it display nothing? + ##### Try to run `"./push_swap 0 one 2 3"`. + ``` Error ``` + ###### Does it display the right result as above? + ##### Try to run `"./push_swap 1 2 2 3"`. + ``` Error ``` + ###### Does it display the right result as above? ##### Try to run `"./push_swap <5 random numbers>"` with 5 random numbers instead of the tag. -###### Does it displays a valid solution and less than 12 instructions? + +###### Does it display a valid solution and less than 12 instructions? + +##### Try to run `"./push_swap <5 random numbers>"` with 5 different random numbers instead of the tag. +###### Does it still displays a valid solution and less than 12 instructions? ##### Try to run `"./checker "` and input nothing. + ###### Does it display nothing? ##### Try to run `"./checker 0 one 2 3"`. + ``` Error ``` + ###### Does it display the right result as above? ##### Try to run `"echo -e "sa\npb\nrrr\n" | ./checker 0 9 1 8 2 7 3 6 4 5"`. + ``` KO ``` + ###### Does it display the right result as above? ##### Try to run `"echo -e "pb\nra\npb\nra\nsa\nra\npa\npa\n" | ./checker 0 9 1 8 2"`. + ``` OK ``` + ###### Does it display the right result as above? ##### Try to run `"ARG = "4 67 3 87 23"; ./push_swap $ARG | ./checker $ARG"`. + ``` OK ``` + ###### Does it display the right result as above? #### General ##### Try to run `"$ARG= "<100 random numbers>"; ./push_swap $ARG"` with 100 random different numbers instead of the tag. -###### +Does it displays less than 700 commands? + +###### +Does it display less than 700 commands? + ##### Try to run `"$ARG= "<100 random numbers>; ./push_swap $ARG | ./checker $ARG"` with the same 100 random different numbers as before instead of the tag. + ``` OK ``` -###### +Does it displays the right result as above? + +###### +Does it display the right result as above? #### Basic ###### +Does the code obey the [good practices](https://public.01-edu.org/subjects/good-practices.en)? + ###### +Is there a test file for this code? + ###### +Are the tests checking each possible case? #### Social ###### +Did you learn anything from this project? + ###### +Would you recommend/nominate this program as an example for the rest of the school?