From e65cf850d34286684a981236160cfca6acca1803 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 3 May 2019 09:57:24 +0100 Subject: [PATCH 01/24] readmes for the exams, fprime and sortList --- subjects/fprime.md | 30 ++++++++++++++++++++++++++++++ subjects/sortList.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 subjects/fprime.md create mode 100644 subjects/sortList.md diff --git a/subjects/fprime.md b/subjects/fprime.md new file mode 100644 index 000000000..efecbf9ad --- /dev/null +++ b/subjects/fprime.md @@ -0,0 +1,30 @@ +## fprime + +### Instructions + +Write a program that takes a positive `int` and displays its prime factors on the standard output, followed by a newline. + +- Factors must be displayed in ascending order and separated by `*`, so that the expression in the output gives the right result. + +- If the number of parameters is not 1, simply display a newline. + +- The input, when there's one, will be valid. + +Example of output : + +```console +student@ubuntu:~/piscine/test$ go build +student@ubuntu:~/piscine/test$ ./test 225225 +3*3*5*5*7*11*13 +student@ubuntu:~/piscine/test$ ./test 8333325 +3*3*5*5*7*11*13*37 +student@ubuntu:~/piscine/test$ ./test 9539 +9539 +student@ubuntu:~/piscine/test$ ./test 804577 +804577 +student@ubuntu:~/piscine/test$ ./test 42 +2*3*7 +student@ubuntu:~/piscine/test$ ./test + +student@ubuntu:~/piscine/test$ +``` \ No newline at end of file diff --git a/subjects/sortList.md b/subjects/sortList.md new file mode 100644 index 000000000..58d15f797 --- /dev/null +++ b/subjects/sortList.md @@ -0,0 +1,32 @@ +## sortList + +### Instructions + +Write the following function: + +```go +func SortList (l *NodeList, cmp func(a,b int) bool) *NodeList{ + +} +``` +- This function must sort the list given as a parameter, using the function cmp to select the order to apply, and returns a pointer to the first element of the sorted list. + +- Duplications must remain. + +- Input will always be consistent. + +- You must use the `type NodeList`. + +- Functions passed as cmp will always return a value different from 0 if a and b are in the right order, 0 otherwise. + +- For example, the following function used as cmp will sort the list in ascending order : + +```go +func ascending(a, b int) bool{ + if a <= b { + return true + } else { + return false + } +} +``` \ No newline at end of file From 9a8fefe7996f5361e5101f899453f253d43feb1b Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 3 May 2019 12:34:25 +0100 Subject: [PATCH 02/24] revWstr readme for the exams --- subjects/revWstr.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 subjects/revWstr.md diff --git a/subjects/revWstr.md b/subjects/revWstr.md new file mode 100644 index 000000000..808f8b585 --- /dev/null +++ b/subjects/revWstr.md @@ -0,0 +1,26 @@ +## revWstr + +### Instructions + +Write a program that takes a string as a parameter, and prints its words in reverse. + +- A "word" is a part of the string bounded by spaces and/or tabs, or the begin/end of the string. + +- If the number of parameters is different from 1, the program will display `\n`. + +- In the parameters that are going to be tested, there won't be any additional" spaces (meaning that there won't be additionnal spaces at the beginning or at the end of the string, and words will always be separated by exactly one space). + +Example of output : + +```console +student@ubuntu:~/piscine/test$ go build +student@ubuntu:~/piscine/test$ ./test "the time of contempt precedes that of indifference" +indifference of that precedes contempt of time the +student@ubuntu:~/piscine/test$ ./test "abcdefghijklm" +abcdefghijklm +student@ubuntu:~/piscine/test$ ./test "he stared at the mountain" +mountain the at stared he +student@ubuntu:~/piscine/test$ ./test + +student@ubuntu:~/piscine/test$ +``` \ No newline at end of file From b3f978f0214e087a1e5e599a1df521532d4ddadb Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 3 May 2019 12:36:42 +0100 Subject: [PATCH 03/24] revwstr exr for the exams --- subjects/{revWstr.md => revwstr.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename subjects/{revWstr.md => revwstr.md} (100%) diff --git a/subjects/revWstr.md b/subjects/revwstr.md similarity index 100% rename from subjects/revWstr.md rename to subjects/revwstr.md From 9ab6d93d314be7811b7328aaeb0953035e75b355 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 3 May 2019 12:39:55 +0100 Subject: [PATCH 04/24] revwstr exr for the exams --- subjects/revWstr.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 subjects/revWstr.md diff --git a/subjects/revWstr.md b/subjects/revWstr.md new file mode 100644 index 000000000..61ef16101 --- /dev/null +++ b/subjects/revWstr.md @@ -0,0 +1,26 @@ +## revwstr + +### Instructions + +Write a program that takes a string as a parameter, and prints its words in reverse. + +- A "word" is a part of the string bounded by spaces and/or tabs, or the begin/end of the string. + +- If the number of parameters is different from 1, the program will display `\n`. + +- In the parameters that are going to be tested, there won't be any additional" spaces (meaning that there won't be additionnal spaces at the beginning or at the end of the string, and words will always be separated by exactly one space). + +Example of output : + +```console +student@ubuntu:~/piscine/test$ go build +student@ubuntu:~/piscine/test$ ./test "the time of contempt precedes that of indifference" +indifference of that precedes contempt of time the +student@ubuntu:~/piscine/test$ ./test "abcdefghijklm" +abcdefghijklm +student@ubuntu:~/piscine/test$ ./test "he stared at the mountain" +mountain the at stared he +student@ubuntu:~/piscine/test$ ./test + +student@ubuntu:~/piscine/test$ +``` \ No newline at end of file From 98c2112a19bfd550b9956f414128f9b414177cb1 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 3 May 2019 15:44:21 +0100 Subject: [PATCH 05/24] correction of the lenguage --- subjects/{fprime.md => fprime.en.md} | 0 subjects/{revwstr.md => revwstr.en.md} | 0 subjects/{sortList.md => sortList.en.md} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename subjects/{fprime.md => fprime.en.md} (100%) rename subjects/{revwstr.md => revwstr.en.md} (100%) rename subjects/{sortList.md => sortList.en.md} (100%) diff --git a/subjects/fprime.md b/subjects/fprime.en.md similarity index 100% rename from subjects/fprime.md rename to subjects/fprime.en.md diff --git a/subjects/revwstr.md b/subjects/revwstr.en.md similarity index 100% rename from subjects/revwstr.md rename to subjects/revwstr.en.md diff --git a/subjects/sortList.md b/subjects/sortList.en.md similarity index 100% rename from subjects/sortList.md rename to subjects/sortList.en.md From b1edc04747ee1c6e67421ec103e1a4f90978ae10 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 3 May 2019 15:47:07 +0100 Subject: [PATCH 06/24] deletion of duplicats --- subjects/revWstr.md | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 subjects/revWstr.md diff --git a/subjects/revWstr.md b/subjects/revWstr.md deleted file mode 100644 index 61ef16101..000000000 --- a/subjects/revWstr.md +++ /dev/null @@ -1,26 +0,0 @@ -## revwstr - -### Instructions - -Write a program that takes a string as a parameter, and prints its words in reverse. - -- A "word" is a part of the string bounded by spaces and/or tabs, or the begin/end of the string. - -- If the number of parameters is different from 1, the program will display `\n`. - -- In the parameters that are going to be tested, there won't be any additional" spaces (meaning that there won't be additionnal spaces at the beginning or at the end of the string, and words will always be separated by exactly one space). - -Example of output : - -```console -student@ubuntu:~/piscine/test$ go build -student@ubuntu:~/piscine/test$ ./test "the time of contempt precedes that of indifference" -indifference of that precedes contempt of time the -student@ubuntu:~/piscine/test$ ./test "abcdefghijklm" -abcdefghijklm -student@ubuntu:~/piscine/test$ ./test "he stared at the mountain" -mountain the at stared he -student@ubuntu:~/piscine/test$ ./test - -student@ubuntu:~/piscine/test$ -``` \ No newline at end of file From 973c18f73da027bb5b90d180e7a3a75047c6929a Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Fri, 3 May 2019 18:23:44 +0100 Subject: [PATCH 07/24] formatting --- subjects/fprime.en.md | 6 +++--- subjects/revwstr.en.md | 8 ++++---- subjects/sortList.en.md | 31 ++++++++++++++++++------------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/subjects/fprime.en.md b/subjects/fprime.en.md index efecbf9ad..3335cdd2e 100644 --- a/subjects/fprime.en.md +++ b/subjects/fprime.en.md @@ -6,9 +6,9 @@ Write a program that takes a positive `int` and displays its prime factors on th - Factors must be displayed in ascending order and separated by `*`, so that the expression in the output gives the right result. -- If the number of parameters is not 1, simply display a newline. +- If the number of parameters is not 1, the program displays a newline. -- The input, when there's one, will be valid. +- The input, when there is one, will always be valid. Example of output : @@ -27,4 +27,4 @@ student@ubuntu:~/piscine/test$ ./test 42 student@ubuntu:~/piscine/test$ ./test student@ubuntu:~/piscine/test$ -``` \ No newline at end of file +``` diff --git a/subjects/revwstr.en.md b/subjects/revwstr.en.md index 808f8b585..a59eb631b 100644 --- a/subjects/revwstr.en.md +++ b/subjects/revwstr.en.md @@ -4,13 +4,13 @@ Write a program that takes a string as a parameter, and prints its words in reverse. -- A "word" is a part of the string bounded by spaces and/or tabs, or the begin/end of the string. +- A word is a sequence of **alphanumerical** characters. - If the number of parameters is different from 1, the program will display `\n`. -- In the parameters that are going to be tested, there won't be any additional" spaces (meaning that there won't be additionnal spaces at the beginning or at the end of the string, and words will always be separated by exactly one space). +- In the parameters that are going to be tested, there will not be any additional spaces. (meaning that there will not be additionnal spaces at the beginning or at the end of the string, and words will always be separated by exactly one space). -Example of output : +Examples of outputs : ```console student@ubuntu:~/piscine/test$ go build @@ -23,4 +23,4 @@ mountain the at stared he student@ubuntu:~/piscine/test$ ./test student@ubuntu:~/piscine/test$ -``` \ No newline at end of file +``` diff --git a/subjects/sortList.en.md b/subjects/sortList.en.md index 58d15f797..16fe29c56 100644 --- a/subjects/sortList.en.md +++ b/subjects/sortList.en.md @@ -2,24 +2,29 @@ ### Instructions -Write the following function: +Write a function that must: -```go -func SortList (l *NodeList, cmp func(a,b int) bool) *NodeList{ - -} -``` -- This function must sort the list given as a parameter, using the function cmp to select the order to apply, and returns a pointer to the first element of the sorted list. +- Sort the list given as a parameter, using the function cmp to select the order to apply, -- Duplications must remain. +- Return a pointer to the first element of the sorted list. -- Input will always be consistent. +Duplications must remain. -- You must use the `type NodeList`. +Inputs will always be consistent. -- Functions passed as cmp will always return a value different from 0 if a and b are in the right order, 0 otherwise. +The `type NodeList` must be used. -- For example, the following function used as cmp will sort the list in ascending order : +Functions passed as `cmp` will always return `true` if `a` and `b` are in the right order, otherwise it will return `false`. + +### Expected function + +```go +func SortList (l *NodeList, cmp func(a,b int) bool) *NodeList{ + +} +``` + +- For example, the following function used as `cmp` will sort the list in ascending order : ```go func ascending(a, b int) bool{ @@ -29,4 +34,4 @@ func ascending(a, b int) bool{ return false } } -``` \ No newline at end of file +``` From 2b2708c0b047cce1cbba45666be9ff854216e8e8 Mon Sep 17 00:00:00 2001 From: Xavier Petit Date: Fri, 3 May 2019 16:50:49 +0100 Subject: [PATCH 08/24] Determine partitions with GPT labels instead of number. --- scripts/install_client.sh | 8 +------- scripts/system/etc/gdm3/PostLogin/Default | 14 ++------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/scripts/install_client.sh b/scripts/install_client.sh index c56597820..2be595d93 100755 --- a/scripts/install_client.sh +++ b/scripts/install_client.sh @@ -61,13 +61,7 @@ cd /tmp/system sed -i -e "s|::DISK::|$DISK|g" etc/udev/rules.d/10-local.rules # Fourth local partition -PART=$(lsblk -o tran,kname,hotplug,type,fstype -pr | - grep -v usb | - grep '0 part' | - cut -d' ' -f2 | - sort | - head -n4 | - tail -n1) +PART=$(lsblk -pro kname,partlabel | grep 01-tmp-system | cut -d' ' -f1) sed -i -e "s|::PART::|$PART|g" usr/share/initramfs-tools/scripts/init-premount/reformat apt-get -y install overlayroot diff --git a/scripts/system/etc/gdm3/PostLogin/Default b/scripts/system/etc/gdm3/PostLogin/Default index d0fa55e0d..0f6051594 100755 --- a/scripts/system/etc/gdm3/PostLogin/Default +++ b/scripts/system/etc/gdm3/PostLogin/Default @@ -29,11 +29,7 @@ set -x sleep 0.5 # Find the first removable F2FS partition -PART=$(lsblk -o tran,kname,hotplug,type,fstype -pr | - grep -e '1 part f2fs' -e '1 disk f2fs' | - cut -d' ' -f2 | - sort | - head -n1) +PART=$(lsblk -pro kname,partlabel | grep 01-home) # Make sure the mountpoints are free ( @@ -47,13 +43,7 @@ then mount -o noatime "$PART" /mnt else # No removable F2FS partition found, use the third local partition instead - PART=$(lsblk -o tran,kname,hotplug,type,fstype -pr | - grep -v usb | - grep '0 part' | - cut -d' ' -f2 | - sort | - head -n3 | - tail -n1) + PART=$(lsblk -pro kname,partlabel | grep 01-tmp-home) if test -z "$PART" then From 2764d5fb68c352b0384eebebdde3d5a4fefccdb1 Mon Sep 17 00:00:00 2001 From: Xavier Petit Date: Fri, 3 May 2019 17:05:42 +0100 Subject: [PATCH 09/24] Update comments --- scripts/install_client.sh | 1 - scripts/system/etc/gdm3/PostLogin/Default | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/install_client.sh b/scripts/install_client.sh index 2be595d93..f91b40220 100755 --- a/scripts/install_client.sh +++ b/scripts/install_client.sh @@ -60,7 +60,6 @@ cp -r system /tmp cd /tmp/system sed -i -e "s|::DISK::|$DISK|g" etc/udev/rules.d/10-local.rules -# Fourth local partition PART=$(lsblk -pro kname,partlabel | grep 01-tmp-system | cut -d' ' -f1) sed -i -e "s|::PART::|$PART|g" usr/share/initramfs-tools/scripts/init-premount/reformat diff --git a/scripts/system/etc/gdm3/PostLogin/Default b/scripts/system/etc/gdm3/PostLogin/Default index 0f6051594..18b0bb909 100755 --- a/scripts/system/etc/gdm3/PostLogin/Default +++ b/scripts/system/etc/gdm3/PostLogin/Default @@ -28,7 +28,7 @@ set -x sleep 0.5 -# Find the first removable F2FS partition +# Find the removable F2FS partition PART=$(lsblk -pro kname,partlabel | grep 01-home) # Make sure the mountpoints are free @@ -42,7 +42,7 @@ if test "$PART" then mount -o noatime "$PART" /mnt else - # No removable F2FS partition found, use the third local partition instead + # No removable F2FS partition found PART=$(lsblk -pro kname,partlabel | grep 01-tmp-home) if test -z "$PART" From f4a69fecc82bfae9476a8664cb1a9b6d9373171f Mon Sep 17 00:00:00 2001 From: Xavier Petit Date: Fri, 3 May 2019 18:22:29 +0100 Subject: [PATCH 10/24] One-line log --- scripts/system/etc/gdm3/PostLogin/Default | 3 +-- scripts/system/etc/gdm3/PostSession/Default | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/system/etc/gdm3/PostLogin/Default b/scripts/system/etc/gdm3/PostLogin/Default index 18b0bb909..3557d3223 100755 --- a/scripts/system/etc/gdm3/PostLogin/Default +++ b/scripts/system/etc/gdm3/PostLogin/Default @@ -3,8 +3,7 @@ # Mount home as an overlay filesystem # Log stdout & stderr -exec > >(tee -i /tmp/gdm3_postlogin.log) -exec 2>&1 +exec > >(tee -i /tmp/gdm3_postlogin.log) 2>&1 # Treat unset variables as an error when substituting. set -u diff --git a/scripts/system/etc/gdm3/PostSession/Default b/scripts/system/etc/gdm3/PostSession/Default index 803df8845..034bd6a80 100755 --- a/scripts/system/etc/gdm3/PostSession/Default +++ b/scripts/system/etc/gdm3/PostSession/Default @@ -1,8 +1,7 @@ #!/bin/bash # Log stdout & stderr -exec > >(tee -i /tmp/gdm3_postsession.log) -exec 2>&1 +exec > >(tee -i /tmp/gdm3_postsession.log) 2>&1 # Exit immediately if a command exits with a non-zero status. set -e From da5c41713c863fb7af2ae1524414622e52158991 Mon Sep 17 00:00:00 2001 From: Xavier Petit Date: Fri, 3 May 2019 18:23:45 +0100 Subject: [PATCH 11/24] Fix bug --- scripts/system/etc/gdm3/PostLogin/Default | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/system/etc/gdm3/PostLogin/Default b/scripts/system/etc/gdm3/PostLogin/Default index 3557d3223..904367da7 100755 --- a/scripts/system/etc/gdm3/PostLogin/Default +++ b/scripts/system/etc/gdm3/PostLogin/Default @@ -28,7 +28,7 @@ set -x sleep 0.5 # Find the removable F2FS partition -PART=$(lsblk -pro kname,partlabel | grep 01-home) +PART=$(lsblk -pro kname,partlabel | grep 01-home | cut -d' ' -f1) # Make sure the mountpoints are free ( @@ -42,7 +42,7 @@ then mount -o noatime "$PART" /mnt else # No removable F2FS partition found - PART=$(lsblk -pro kname,partlabel | grep 01-tmp-home) + PART=$(lsblk -pro kname,partlabel | grep 01-tmp-home | cut -d' ' -f1) if test -z "$PART" then From 8fb26dab5581066b8886e44ee1db53f375ce09bb Mon Sep 17 00:00:00 2001 From: Augusto Date: Fri, 3 May 2019 14:36:03 +0100 Subject: [PATCH 12/24] rotate string exam exercise readme --- subjects/rostring.en.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 subjects/rostring.en.md diff --git a/subjects/rostring.en.md b/subjects/rostring.en.md new file mode 100644 index 000000000..755d91068 --- /dev/null +++ b/subjects/rostring.en.md @@ -0,0 +1,30 @@ +## rostring + +### Instructions + +Write a program that takes a string and displays this string after rotating it +one word to the left. + +Thus, the first word becomes the last, and others stay in the same order. + +A "word" is defined as a part of a string delimited either by spaces/tabs, or +by the start/end of the string. + +Words will be separated by only one space in the output. + +If the number of arguments is not one, the program displays \n. + +And its output : + +```console +student@ubuntu:~/piscine/rostring$ go build +student@ubuntu:~/piscine/rostring$ ./rostring "abc " | cat -e +abc$ +student@ubuntu:~/piscine/rostring$ ./rostring "Que la lumiere soit et la lumiere fut" +la lumiere soit et la lumiere fut Que +student@ubuntu:~/piscine/rostring$ ./rostring " AkjhZ zLKIJz , 23y" +zLKIJz , 23y AkjhZ +student@ubuntu:~/piscine/rostring$ ./rostring | cat -e +$ +student@ubuntu:~/piscine/rostring$ +``` From 2d28c3e977f8699a6a72d7b98fffc8e0ca7800c6 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Mon, 6 May 2019 12:32:47 +0100 Subject: [PATCH 13/24] formatting --- subjects/rostring.en.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/subjects/rostring.en.md b/subjects/rostring.en.md index 755d91068..36c559b18 100644 --- a/subjects/rostring.en.md +++ b/subjects/rostring.en.md @@ -7,21 +7,20 @@ one word to the left. Thus, the first word becomes the last, and others stay in the same order. -A "word" is defined as a part of a string delimited either by spaces/tabs, or -by the start/end of the string. +A word is a sequence of **alphanumerical** characters. Words will be separated by only one space in the output. -If the number of arguments is not one, the program displays \n. +If the number of arguments is not one, the program displays a newline. -And its output : +Examples of outputs : ```console student@ubuntu:~/piscine/rostring$ go build student@ubuntu:~/piscine/rostring$ ./rostring "abc " | cat -e abc$ -student@ubuntu:~/piscine/rostring$ ./rostring "Que la lumiere soit et la lumiere fut" -la lumiere soit et la lumiere fut Que +student@ubuntu:~/piscine/rostring$ ./rostring "Let there be light" +there be light There student@ubuntu:~/piscine/rostring$ ./rostring " AkjhZ zLKIJz , 23y" zLKIJz , 23y AkjhZ student@ubuntu:~/piscine/rostring$ ./rostring | cat -e From 61502bd7f7582a4bd77c79dd08bb8f4eeae9df9e Mon Sep 17 00:00:00 2001 From: Augusto Date: Fri, 3 May 2019 17:29:47 +0100 Subject: [PATCH 14/24] brackets exam exercise readme --- subjects/brackets.en.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 subjects/brackets.en.md diff --git a/subjects/brackets.en.md b/subjects/brackets.en.md new file mode 100644 index 000000000..9d4f9fc76 --- /dev/null +++ b/subjects/brackets.en.md @@ -0,0 +1,33 @@ +## brackets + +### Instructions + +Write a program that takes an undefined number of strings in arguments. For each +argument, the program prints on the standard output "OK" followed by a newline +if the expression is correctly bracketed, otherwise it prints "Error" followed by +a newline. + +Symbols considered as 'brackets' are brackets '(' and ')', square brackets '[' +and ']'and braces '{' and '}'. Every other symbols are simply ignored. + +An opening bracket must always be closed by the good closing bracket in the +correct order. A string which not contains any bracket is considered as a +correctly bracketed string. + +If there is no arguments, the program must print only a newline. + +And its output : + +```console +student@ubuntu:~/student/test$ go build +student@ubuntu:~/student/test$ ./test '(johndoe)' | cat -e +OK$ +student@ubuntu:~/student/test$ ./test '([)]' | cat -e +Error$ +student@ubuntu:~/student/test$ ./test '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e +OK$ +OK$ +student@ubuntu:~/student/test$ ./test | cat -e +$ +student@ubuntu:~/student/test$ +``` From 88cbab6b0675cd9986022c273116b1dc1fe343aa Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Mon, 6 May 2019 15:18:19 +0100 Subject: [PATCH 15/24] formatting --- subjects/brackets.en.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subjects/brackets.en.md b/subjects/brackets.en.md index 9d4f9fc76..87822e10d 100644 --- a/subjects/brackets.en.md +++ b/subjects/brackets.en.md @@ -7,16 +7,16 @@ argument, the program prints on the standard output "OK" followed by a newline if the expression is correctly bracketed, otherwise it prints "Error" followed by a newline. -Symbols considered as 'brackets' are brackets '(' and ')', square brackets '[' -and ']'and braces '{' and '}'. Every other symbols are simply ignored. +Symbols considered as `brackets` are brackets `(` and `)`, square brackets `[` +and `]`and braces `{` and `}`. Every other symbols are simply ignored. An opening bracket must always be closed by the good closing bracket in the -correct order. A string which not contains any bracket is considered as a +correct order. A string which do not contains any bracket is considered as a correctly bracketed string. If there is no arguments, the program must print only a newline. -And its output : +Examples of outputs : ```console student@ubuntu:~/student/test$ go build From c16238c54c5264c0114beef96c433c2a29306032 Mon Sep 17 00:00:00 2001 From: Frenchris <34804391+Frenchris@users.noreply.github.com> Date: Sat, 27 Apr 2019 00:14:53 +0100 Subject: [PATCH 16/24] Update of doop Added details and corrected unclearness --- subjects/doop.en.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/subjects/doop.en.md b/subjects/doop.en.md index b26aa2088..60c809d02 100644 --- a/subjects/doop.en.md +++ b/subjects/doop.en.md @@ -14,9 +14,11 @@ In case of an invalid entry the programs prints `0`. In case of an invalid number of arguments the program prints nothing. +The program has to handle the modulo and division by 0 as shown on the output examples below. + `fmt.Print` is authorized. -### Usage +Examples of outputs : ```console student@ubuntu:~/piscine/test$ go build doop.go @@ -29,10 +31,10 @@ student@ubuntu:~/piscine/test$ ./doop 1 p 1 0 student@ubuntu:~/piscine/test$ ./doop 1 + 1 2 -student@ubuntu:~/piscine/test$ ./doop 1 / 0 -No division by 0 -student@ubuntu:~/piscine/test$ ./doop 1 % 0 -No modulo by 0 -student@ubuntu:~/piscine/test$ ./doop 1 * 1 +student@ubuntu:~/piscine/test$ ./doop 1 / 0 | cat -e +No division by 0$ +student@ubuntu:~/piscine/test$ ./doop 1 % 0 | cat -e +No modulo by 0$ +student@ubuntu:~/piscine/test$ ./doop 1 "*" 1 1 ``` From 97a98c801a1dcce6c110cfc079451f0ab09d6dc0 Mon Sep 17 00:00:00 2001 From: Frenchris <34804391+Frenchris@users.noreply.github.com> Date: Sat, 27 Apr 2019 00:34:20 +0100 Subject: [PATCH 17/24] Final update --- subjects/doop.en.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subjects/doop.en.md b/subjects/doop.en.md index 60c809d02..1fdd5a9f8 100644 --- a/subjects/doop.en.md +++ b/subjects/doop.en.md @@ -10,11 +10,11 @@ The program has to be used with three arguments: - An operator - Another value -In case of an invalid entry the programs prints `0`. +In case of an invalid operator the programs prints `0`. In case of an invalid number of arguments the program prints nothing. -The program has to handle the modulo and division by 0 as shown on the output examples below. +The program has to handle the modulo and division operations by 0 as shown on the output examples below. `fmt.Print` is authorized. @@ -25,8 +25,8 @@ student@ubuntu:~/piscine/test$ go build doop.go student@ubuntu:~/piscine/test$ ./doop student@ubuntu:~/piscine/test$ ./doop 1 + 1 2 -student@ubuntu:~/piscine/test$ ./doop hello + 1 -0 +student@ubuntu:~/piscine/test$ ./doop hello + 1 | cat -e +0$ student@ubuntu:~/piscine/test$ ./doop 1 p 1 0 student@ubuntu:~/piscine/test$ ./doop 1 + 1 From 8bd51057b49ac5bde2f3a3cbc46b51b4e726b9fc Mon Sep 17 00:00:00 2001 From: xpetit Date: Mon, 6 May 2019 16:11:50 +0100 Subject: [PATCH 18/24] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..e293d2833 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +pages.01-edu.org \ No newline at end of file From c8f7b64f0b45d074d5a2ff114fd4365a7829a217 Mon Sep 17 00:00:00 2001 From: xpetit Date: Mon, 6 May 2019 16:23:49 +0100 Subject: [PATCH 19/24] Delete CNAME --- CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CNAME diff --git a/CNAME b/CNAME deleted file mode 100644 index e293d2833..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -pages.01-edu.org \ No newline at end of file From 22d92655a7e150a015de31ab3ad06153eae8d364 Mon Sep 17 00:00:00 2001 From: xpetit Date: Mon, 6 May 2019 16:24:04 +0100 Subject: [PATCH 20/24] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..e293d2833 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +pages.01-edu.org \ No newline at end of file From f07e39db542d81cd1310d2a0de611cf3d86a2f38 Mon Sep 17 00:00:00 2001 From: xpetit Date: Mon, 6 May 2019 16:33:43 +0100 Subject: [PATCH 21/24] Delete CNAME --- CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CNAME diff --git a/CNAME b/CNAME deleted file mode 100644 index e293d2833..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -pages.01-edu.org \ No newline at end of file From d8aa5bb3585e8dc819ea9fd134adfd1831541795 Mon Sep 17 00:00:00 2001 From: xpetit Date: Mon, 6 May 2019 16:33:57 +0100 Subject: [PATCH 22/24] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..bff6d96d1 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +public.01-edu.org \ No newline at end of file From 1038838cc354cc960bc318ca866d0a0852367cad Mon Sep 17 00:00:00 2001 From: xpetit Date: Mon, 6 May 2019 16:36:16 +0100 Subject: [PATCH 23/24] Delete CNAME --- CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CNAME diff --git a/CNAME b/CNAME deleted file mode 100644 index bff6d96d1..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -public.01-edu.org \ No newline at end of file From 4e575510613700def73fbbc01c29afd0c792d43f Mon Sep 17 00:00:00 2001 From: xpetit Date: Mon, 6 May 2019 16:36:28 +0100 Subject: [PATCH 24/24] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..bff6d96d1 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +public.01-edu.org \ No newline at end of file