From 2e34a3d801634503fc5cedd8f15c1e67d26512b0 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Tue, 28 Jan 2020 17:33:54 +0000 Subject: [PATCH 001/146] groupie-trackers-visualization --- ...groupie-trackers-visualization.audit.en.md | 35 +++++++++++++++++++ .../groupie-trackers-visualization.en.md | 28 +++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md create mode 100644 subjects/groupie-trackers/groupie-trackers-visualization.en.md diff --git a/subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md b/subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md new file mode 100644 index 000000000..15d5ce759 --- /dev/null +++ b/subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md @@ -0,0 +1,35 @@ +#### Functional Project Questions + +###### Does the colors used allow you to see the text properly (ex: you can't see yellow text in a white background that well)? + +###### Is the design [consistent](https://digitalcommunications.wp.st-andrews.ac.uk/2016/04/07/why-is-consistency-important-in-web-design/)? (examples: every page follows the same palette of colors, is all centered or is it everything aligned to the right, etc.) + +###### Is the design [responsive](https://smallbiztrends.com/2013/05/what-is-responsive-web-design.html)? (when you change the width/ height of the page, is the site consistent?) + +###### Is the design [interactive](https://en.m.wikipedia.org/wiki/Interactive_design)? (does it interact with the actions of the user?) + +##### Try to explore an inexistent page. + +###### Is the design for the 404 HTTP status covered? + +#### General + +###### +Is it easy to use the web site? + +###### +Does it have a background? + +#### 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://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/groupie-trackers/groupie-trackers-visualization.en.md b/subjects/groupie-trackers/groupie-trackers-visualization.en.md new file mode 100644 index 000000000..818f10514 --- /dev/null +++ b/subjects/groupie-trackers/groupie-trackers-visualization.en.md @@ -0,0 +1,28 @@ +## groupie-trackers-visualization + +### Objectives + +You must follow the same [principles](https://public.01-edu.org/subjects/groupie-trackers/groupie-trackers.en) as the first subject. + +Groupie-trackers-visualization consists on manipulating the data coming from the API and displaying it in the most presentable way possible to you, following the [*Schneiderman's 8 Golden Rules of Interface Design*](https://www.interaction-design.org/literature/article/shneiderman-s-eight-golden-rules-will-help-you-design-better-interfaces) : + +- Strive for consistency +- Enable frequent users to use shortcuts +- Offer informative feedback +- Design dialogue to yield closure +- Offer simple error handling +- Permit easy reversal of actions +- Support internal locus of control +- Reduce short-term memory load + +This project will help you learn about: + +- The basics of human-computer interface. +- The basics of CSS. +- Linking CSS and HTML. + +### Instructions + +- Your project must contain **CSS**. +- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). +- We suggest you to search for the principles of a good website design. From a8ad9e4fd03299dae1ba684a93d698c964b5e838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dosan=20=C3=84lseyit?= <54891339+alseiitov@users.noreply.github.com> Date: Sun, 2 Feb 2020 18:07:35 +0600 Subject: [PATCH 002/146] Added new case Added 0, 0 case. I thought it should print "" and lost xp( --- subjects/printchessboard.en.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subjects/printchessboard.en.md b/subjects/printchessboard.en.md index c4ac06440..eebbe8ec0 100644 --- a/subjects/printchessboard.en.md +++ b/subjects/printchessboard.en.md @@ -16,5 +16,7 @@ student@ubuntu:~/[[ROOT]]/printchessboard$ ./printchessboard 4 3 | cat -e # # $ student@ubuntu:~/[[ROOT]]/printchessboard$ ./printchessboard 7 | cat -e Error$ +student@ubuntu:~/[[ROOT]]/printchessboard$ ./printchessboard 0 0 | cat -e +Error$ student@ubuntu:~/[[ROOT]]/printchessboard$ ``` From d473f960bcdf62fa94111ba1b156a09fef19f719 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Wed, 12 Feb 2020 12:10:45 +0000 Subject: [PATCH 003/146] Fix go run bug --- scripts/configure_ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/configure_ubuntu.sh b/scripts/configure_ubuntu.sh index d0209b350..c73961fb1 100755 --- a/scripts/configure_ubuntu.sh +++ b/scripts/configure_ubuntu.sh @@ -154,7 +154,7 @@ rm -f /swapfile sed -i '/swapfile/d' /etc/fstab # Put temporary and cache folders as tmpfs -echo 'tmpfs /tmp tmpfs defaults,noatime,rw,nosuid,nodev,noexec,mode=1777,size=1G 0 0' >> /etc/fstab +echo 'tmpfs /tmp tmpfs defaults,noatime,rw,nosuid,nodev,mode=1777,size=1G 0 0' >> /etc/fstab # Install additional drivers ubuntu-drivers install ||: From c9954a4838fe8b12cda7b6243851a4746d1a1ae3 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Wed, 12 Feb 2020 14:10:26 +0000 Subject: [PATCH 004/146] Fix names groupie tracker --- subjects/groupie-tracker/.idea/.gitignore | 2 ++ subjects/groupie-tracker/.idea/groupie-tracker.iml | 9 +++++++++ subjects/groupie-tracker/.idea/misc.xml | 6 ++++++ subjects/groupie-tracker/.idea/modules.xml | 8 ++++++++ subjects/groupie-tracker/.idea/vcs.xml | 6 ++++++ .../groupie-tracker-filters.audit.en.md} | 0 .../groupie-tracker-filters.en.md} | 6 +++--- .../groupie-tracker-geolocation.audit.en.md} | 0 .../groupie-tracker-geolocation.en.md} | 6 +++--- .../groupie-tracker-search-bar.audit.en.md} | 0 .../groupie-tracker-search-bar.en.md} | 6 +++--- .../groupie-tracker.audit.en.md} | 0 .../groupie-tracker.en.md} | 2 +- 13 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 subjects/groupie-tracker/.idea/.gitignore create mode 100644 subjects/groupie-tracker/.idea/groupie-tracker.iml create mode 100644 subjects/groupie-tracker/.idea/misc.xml create mode 100644 subjects/groupie-tracker/.idea/modules.xml create mode 100644 subjects/groupie-tracker/.idea/vcs.xml rename subjects/{groupie-trackers/groupie-trackers-filters.audit.en.md => groupie-tracker/groupie-tracker-filters.audit.en.md} (100%) rename subjects/{groupie-trackers/groupie-trackers-filters.en.md => groupie-tracker/groupie-tracker-filters.en.md} (83%) rename subjects/{groupie-trackers/groupie-trackers-geolocation.audit.en.md => groupie-tracker/groupie-tracker-geolocation.audit.en.md} (100%) rename subjects/{groupie-trackers/groupie-trackers-geolocation.en.md => groupie-tracker/groupie-tracker-geolocation.en.md} (85%) rename subjects/{groupie-trackers/groupie-trackers-search-bar.audit.en.md => groupie-tracker/groupie-tracker-search-bar.audit.en.md} (100%) rename subjects/{groupie-trackers/groupie-trackers-search-bar.en.md => groupie-tracker/groupie-tracker-search-bar.en.md} (82%) rename subjects/{groupie-trackers/groupie-trackers.audit.en.md => groupie-tracker/groupie-tracker.audit.en.md} (100%) rename subjects/{groupie-trackers/groupie-trackers.en.md => groupie-tracker/groupie-tracker.en.md} (99%) diff --git a/subjects/groupie-tracker/.idea/.gitignore b/subjects/groupie-tracker/.idea/.gitignore new file mode 100644 index 000000000..e7e9d11d4 --- /dev/null +++ b/subjects/groupie-tracker/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml diff --git a/subjects/groupie-tracker/.idea/groupie-tracker.iml b/subjects/groupie-tracker/.idea/groupie-tracker.iml new file mode 100644 index 000000000..d6ebd4805 --- /dev/null +++ b/subjects/groupie-tracker/.idea/groupie-tracker.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/subjects/groupie-tracker/.idea/misc.xml b/subjects/groupie-tracker/.idea/misc.xml new file mode 100644 index 000000000..28a804d89 --- /dev/null +++ b/subjects/groupie-tracker/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/subjects/groupie-tracker/.idea/modules.xml b/subjects/groupie-tracker/.idea/modules.xml new file mode 100644 index 000000000..5dc9ad016 --- /dev/null +++ b/subjects/groupie-tracker/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/subjects/groupie-tracker/.idea/vcs.xml b/subjects/groupie-tracker/.idea/vcs.xml new file mode 100644 index 000000000..b2bdec2d7 --- /dev/null +++ b/subjects/groupie-tracker/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/subjects/groupie-trackers/groupie-trackers-filters.audit.en.md b/subjects/groupie-tracker/groupie-tracker-filters.audit.en.md similarity index 100% rename from subjects/groupie-trackers/groupie-trackers-filters.audit.en.md rename to subjects/groupie-tracker/groupie-tracker-filters.audit.en.md diff --git a/subjects/groupie-trackers/groupie-trackers-filters.en.md b/subjects/groupie-tracker/groupie-tracker-filters.en.md similarity index 83% rename from subjects/groupie-trackers/groupie-trackers-filters.en.md rename to subjects/groupie-tracker/groupie-tracker-filters.en.md index b646c3cab..618ece475 100644 --- a/subjects/groupie-trackers/groupie-trackers-filters.en.md +++ b/subjects/groupie-tracker/groupie-tracker-filters.en.md @@ -1,10 +1,10 @@ -## groupie-trackers-filters +## groupie-tracker-filters ### Objectives -You must follow the same [principles](https://public.01-edu.org/subjects/groupie-trackers/groupie-trackers.en) as the first subject. +You must follow the same [principles](https://public.01-edu.org/subjects/groupie-tracker/groupie-tracker.en) as the first subject. -- Groupie Trackers Filters consists on letting the user filter the artists/bands that will be shown. +- Groupie Tracker Filters consists on letting the user filter the artists/bands that will be shown. - Your project must incorporate at least these four filters: - filter by creation date diff --git a/subjects/groupie-trackers/groupie-trackers-geolocation.audit.en.md b/subjects/groupie-tracker/groupie-tracker-geolocation.audit.en.md similarity index 100% rename from subjects/groupie-trackers/groupie-trackers-geolocation.audit.en.md rename to subjects/groupie-tracker/groupie-tracker-geolocation.audit.en.md diff --git a/subjects/groupie-trackers/groupie-trackers-geolocation.en.md b/subjects/groupie-tracker/groupie-tracker-geolocation.en.md similarity index 85% rename from subjects/groupie-trackers/groupie-trackers-geolocation.en.md rename to subjects/groupie-tracker/groupie-tracker-geolocation.en.md index 96ea38bd0..632742d21 100644 --- a/subjects/groupie-trackers/groupie-trackers-geolocation.en.md +++ b/subjects/groupie-tracker/groupie-tracker-geolocation.en.md @@ -1,10 +1,10 @@ -## groupie-trackers-geolocation +## groupie-tracker-geolocation ### Objectives -You must follow the same [principles](https://public.01-edu.org/subjects/groupie-trackers/groupie-trackers.en) as the first subject. +You must follow the same [principles](https://public.01-edu.org/subjects/groupie-tracker/groupie-tracker.en) as the first subject. -- Groupie Trackers Geolocation consists on mapping the different concerts locations of a certain artist/band given by the Client. +- Groupie Tracker Geolocation consists on mapping the different concerts locations of a certain artist/band given by the Client. - You must use a process of converting addresses (ex: Germany Mainz) into geographic coordinates (ex: 49,59380 8,15052) which you must use to place markers for the concerts locations of a certain artist/band on a map. diff --git a/subjects/groupie-trackers/groupie-trackers-search-bar.audit.en.md b/subjects/groupie-tracker/groupie-tracker-search-bar.audit.en.md similarity index 100% rename from subjects/groupie-trackers/groupie-trackers-search-bar.audit.en.md rename to subjects/groupie-tracker/groupie-tracker-search-bar.audit.en.md diff --git a/subjects/groupie-trackers/groupie-trackers-search-bar.en.md b/subjects/groupie-tracker/groupie-tracker-search-bar.en.md similarity index 82% rename from subjects/groupie-trackers/groupie-trackers-search-bar.en.md rename to subjects/groupie-tracker/groupie-tracker-search-bar.en.md index 5a36ea60d..a71df0b68 100644 --- a/subjects/groupie-trackers/groupie-trackers-search-bar.en.md +++ b/subjects/groupie-tracker/groupie-tracker-search-bar.en.md @@ -1,10 +1,10 @@ -## groupie-trackers-search-bar +## groupie-tracker-search-bar ### Objectives -You must follow the same [principles](https://public.01-edu.org/subjects/groupie-trackers/groupie-trackers.en) as the first subject. +You must follow the same [principles](https://public.01-edu.org/subjects/groupie-tracker/groupie-tracker.en) as the first subject. -Groupie-trackers-search-bar consists of creating a functional program that searches, inside your website, for a specific input text. +Groupie-tracker-search-bar consists of creating a functional program that searches, inside your website, for a specific input text. - The program should handle at least these search cases : - artist/band name diff --git a/subjects/groupie-trackers/groupie-trackers.audit.en.md b/subjects/groupie-tracker/groupie-tracker.audit.en.md similarity index 100% rename from subjects/groupie-trackers/groupie-trackers.audit.en.md rename to subjects/groupie-tracker/groupie-tracker.audit.en.md diff --git a/subjects/groupie-trackers/groupie-trackers.en.md b/subjects/groupie-tracker/groupie-tracker.en.md similarity index 99% rename from subjects/groupie-trackers/groupie-trackers.en.md rename to subjects/groupie-tracker/groupie-tracker.en.md index 86d130aa1..82e6fa5b0 100644 --- a/subjects/groupie-trackers/groupie-trackers.en.md +++ b/subjects/groupie-tracker/groupie-tracker.en.md @@ -1,4 +1,4 @@ -## groupie-trackers +## groupie-tracker ### Objectives From cbd65a7fd594eebec2a366071f1987912ce3e83b Mon Sep 17 00:00:00 2001 From: OGordoo Date: Wed, 12 Feb 2020 14:13:19 +0000 Subject: [PATCH 005/146] removing .idea --- subjects/groupie-tracker/.idea/.gitignore | 2 -- subjects/groupie-tracker/.idea/groupie-tracker.iml | 9 --------- subjects/groupie-tracker/.idea/misc.xml | 6 ------ subjects/groupie-tracker/.idea/modules.xml | 8 -------- subjects/groupie-tracker/.idea/vcs.xml | 6 ------ 5 files changed, 31 deletions(-) delete mode 100644 subjects/groupie-tracker/.idea/.gitignore delete mode 100644 subjects/groupie-tracker/.idea/groupie-tracker.iml delete mode 100644 subjects/groupie-tracker/.idea/misc.xml delete mode 100644 subjects/groupie-tracker/.idea/modules.xml delete mode 100644 subjects/groupie-tracker/.idea/vcs.xml diff --git a/subjects/groupie-tracker/.idea/.gitignore b/subjects/groupie-tracker/.idea/.gitignore deleted file mode 100644 index e7e9d11d4..000000000 --- a/subjects/groupie-tracker/.idea/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Default ignored files -/workspace.xml diff --git a/subjects/groupie-tracker/.idea/groupie-tracker.iml b/subjects/groupie-tracker/.idea/groupie-tracker.iml deleted file mode 100644 index d6ebd4805..000000000 --- a/subjects/groupie-tracker/.idea/groupie-tracker.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/subjects/groupie-tracker/.idea/misc.xml b/subjects/groupie-tracker/.idea/misc.xml deleted file mode 100644 index 28a804d89..000000000 --- a/subjects/groupie-tracker/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/subjects/groupie-tracker/.idea/modules.xml b/subjects/groupie-tracker/.idea/modules.xml deleted file mode 100644 index 5dc9ad016..000000000 --- a/subjects/groupie-tracker/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/subjects/groupie-tracker/.idea/vcs.xml b/subjects/groupie-tracker/.idea/vcs.xml deleted file mode 100644 index b2bdec2d7..000000000 --- a/subjects/groupie-tracker/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 121f8f726fe9fc3e24e0f85dffa827806cb31b8f Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 13 Feb 2020 09:35:05 +0000 Subject: [PATCH 006/146] fix of wrong question --- subjects/groupie-tracker/groupie-tracker.audit.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/groupie-tracker/groupie-tracker.audit.en.md b/subjects/groupie-tracker/groupie-tracker.audit.en.md index 71e331597..b283d77d7 100644 --- a/subjects/groupie-tracker/groupie-tracker.audit.en.md +++ b/subjects/groupie-tracker/groupie-tracker.audit.en.md @@ -51,7 +51,7 @@ ##### Try to trigger an event using some kind of action (ex: Clicking the mouse over a certain element, pressing a key on the keyboard, resizing or closing the browser window, a form being submitted, an error occurring, etc). ###### Does the event responds as expected? -###### Did the server crashed? +###### Did the server behaved as expected?(did not crashed) ###### Does the server use the right [HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)? From 1ba636a35e766d42a3398b2effe9126ecd1035ab Mon Sep 17 00:00:00 2001 From: OGordoo Date: Tue, 28 Jan 2020 17:33:54 +0000 Subject: [PATCH 007/146] groupie-trackers-visualization --- ...groupie-trackers-visualization.audit.en.md | 35 +++++++++++++++++++ .../groupie-trackers-visualization.en.md | 28 +++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md create mode 100644 subjects/groupie-trackers/groupie-trackers-visualization.en.md diff --git a/subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md b/subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md new file mode 100644 index 000000000..15d5ce759 --- /dev/null +++ b/subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md @@ -0,0 +1,35 @@ +#### Functional Project Questions + +###### Does the colors used allow you to see the text properly (ex: you can't see yellow text in a white background that well)? + +###### Is the design [consistent](https://digitalcommunications.wp.st-andrews.ac.uk/2016/04/07/why-is-consistency-important-in-web-design/)? (examples: every page follows the same palette of colors, is all centered or is it everything aligned to the right, etc.) + +###### Is the design [responsive](https://smallbiztrends.com/2013/05/what-is-responsive-web-design.html)? (when you change the width/ height of the page, is the site consistent?) + +###### Is the design [interactive](https://en.m.wikipedia.org/wiki/Interactive_design)? (does it interact with the actions of the user?) + +##### Try to explore an inexistent page. + +###### Is the design for the 404 HTTP status covered? + +#### General + +###### +Is it easy to use the web site? + +###### +Does it have a background? + +#### 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://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/groupie-trackers/groupie-trackers-visualization.en.md b/subjects/groupie-trackers/groupie-trackers-visualization.en.md new file mode 100644 index 000000000..818f10514 --- /dev/null +++ b/subjects/groupie-trackers/groupie-trackers-visualization.en.md @@ -0,0 +1,28 @@ +## groupie-trackers-visualization + +### Objectives + +You must follow the same [principles](https://public.01-edu.org/subjects/groupie-trackers/groupie-trackers.en) as the first subject. + +Groupie-trackers-visualization consists on manipulating the data coming from the API and displaying it in the most presentable way possible to you, following the [*Schneiderman's 8 Golden Rules of Interface Design*](https://www.interaction-design.org/literature/article/shneiderman-s-eight-golden-rules-will-help-you-design-better-interfaces) : + +- Strive for consistency +- Enable frequent users to use shortcuts +- Offer informative feedback +- Design dialogue to yield closure +- Offer simple error handling +- Permit easy reversal of actions +- Support internal locus of control +- Reduce short-term memory load + +This project will help you learn about: + +- The basics of human-computer interface. +- The basics of CSS. +- Linking CSS and HTML. + +### Instructions + +- Your project must contain **CSS**. +- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). +- We suggest you to search for the principles of a good website design. From 697bc78309b333ca71b4b88da3254e200e1aaeac Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 13 Feb 2020 09:48:13 +0000 Subject: [PATCH 008/146] fixing questions --- .../groupie-tracker-visualization.audit.en.md | 35 +++++++++++++++++++ .../groupie-tracker-visualization.en.md | 28 +++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 subjects/groupie-tracker/groupie-tracker-visualization.audit.en.md create mode 100644 subjects/groupie-tracker/groupie-tracker-visualization.en.md diff --git a/subjects/groupie-tracker/groupie-tracker-visualization.audit.en.md b/subjects/groupie-tracker/groupie-tracker-visualization.audit.en.md new file mode 100644 index 000000000..a376bf83c --- /dev/null +++ b/subjects/groupie-tracker/groupie-tracker-visualization.audit.en.md @@ -0,0 +1,35 @@ +#### Functional + +###### Do the colors used allow a good visual contrast (ex: it is difficult to read a yellow text on a white background)? + +###### Is the design [consistent](https://digitalcommunications.wp.st-andrews.ac.uk/2016/04/07/why-is-consistency-important-in-web-design/)? (examples: every page follows the same palette of colors, is all centered or is it everything aligned to the right, etc.) + +###### Is the design [responsive](https://smallbiztrends.com/2013/05/what-is-responsive-web-design.html)? (when you change the width/ height of the page, is the site consistent?) + +###### Is the [interaction design](https://en.m.wikipedia.org/wiki/Interaction_design) good (is the interface easily usable)? + +##### Try to explore an inexistent page. + +###### Is the design for the 404 HTTP status covered? + +#### General + +###### +Is it easy to use the web site? + +###### +Does it have a background? + +#### 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://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? \ No newline at end of file diff --git a/subjects/groupie-tracker/groupie-tracker-visualization.en.md b/subjects/groupie-tracker/groupie-tracker-visualization.en.md new file mode 100644 index 000000000..340ba9087 --- /dev/null +++ b/subjects/groupie-tracker/groupie-tracker-visualization.en.md @@ -0,0 +1,28 @@ +## groupie-tracker-visualization + +### Objectives + +You must follow the same [principles](https://public.01-edu.org/subjects/groupie-tracker/groupie-tracker.en) as the first subject. + +Groupie-tracker-visualization consists on manipulating the data coming from the API and displaying it in the most presentable way possible to you, following the [*Schneiderman's 8 Golden Rules of Interface Design*](https://www.interaction-design.org/literature/article/shneiderman-s-eight-golden-rules-will-help-you-design-better-interfaces) : + +- Strive for consistency +- Enable frequent users to use shortcuts +- Offer informative feedback +- Design dialogue to yield closure +- Offer simple error handling +- Permit easy reversal of actions +- Support internal locus of control +- Reduce short-term memory load + +This project will help you learn about: + +- The basics of human-computer interface. +- The basics of CSS. +- Linking CSS and HTML. + +### Instructions + +- Your project must contain **CSS**. +- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). +- We suggest you to search for the principles of a good website design. From efb4eb9c61f7209b3d2cf32432e601bd751f9d07 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 13 Feb 2020 10:37:23 +0000 Subject: [PATCH 009/146] subject fix --- subjects/inverttree.en.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/subjects/inverttree.en.md b/subjects/inverttree.en.md index 5a3ca76b6..381d7d475 100644 --- a/subjects/inverttree.en.md +++ b/subjects/inverttree.en.md @@ -11,18 +11,27 @@ This means that: - 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 -### Instructions: Write a function that takes tree and inverts(flips) and returns it. -``` + +### Expected function and structure + +```go type TNode struct { Val int Left *TNode Right *TNode } + +func InvertTree(root *TNode) *TNode { + +} ``` + Example: -``` + +```shell Input: 7 / \ @@ -37,8 +46,3 @@ Output: / \ / \ 13 9 6 3 ``` -Expected function: -``` -func InvertTree(root *TNode) *TNode { -} -``` From 6853cb259569f701aa733364fc8748dbb4341bf8 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 13 Feb 2020 10:59:51 +0000 Subject: [PATCH 010/146] some corrections --- subjects/addlinkednumbers.en.md | 45 ++++++++++++++++----------------- subjects/changeorder.en.md | 38 ++++++++++++++-------------- subjects/merge.en.md | 1 - subjects/nauuo.en.md | 12 ++++----- subjects/reverse.en.md | 33 ++++++++++++------------ 5 files changed, 63 insertions(+), 66 deletions(-) diff --git a/subjects/addlinkednumbers.en.md b/subjects/addlinkednumbers.en.md index 1daf1d0ae..00fea8fc9 100644 --- a/subjects/addlinkednumbers.en.md +++ b/subjects/addlinkednumbers.en.md @@ -23,8 +23,8 @@ Write a function that adds the two numbers and returns the sum as a linked list package main type NodeAddL struct { - Next *NodeAddL - Num int + Next *NodeAddL + Num int } func AddLinkedNumbers(num1, num1 *NodeAddL) *NodeAddL { @@ -44,30 +44,29 @@ import ( ) 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() + // 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() } ``` diff --git a/subjects/changeorder.en.md b/subjects/changeorder.en.md index 6a4816c4e..0c56c5641 100644 --- a/subjects/changeorder.en.md +++ b/subjects/changeorder.en.md @@ -24,8 +24,8 @@ You have to return pointer/reference to the beginning of new list package main type NodeAddL struct { - Next *NodeAddL - Num int + Next *NodeAddL + Num int } func Changeorder(node *NodeAddL) *NodeAddL { @@ -41,26 +41,26 @@ Here is a possible program to test your function: package main import ( - "fmt" + "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() + 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() } ``` @@ -68,7 +68,7 @@ func main() { Its output: ```console -$> go build -$> ./main +$ go build +$ ./main 1 -> 3 -> 5 -> 2 -> 4 ``` diff --git a/subjects/merge.en.md b/subjects/merge.en.md index 4922b1dee..9f0d26344 100644 --- a/subjects/merge.en.md +++ b/subjects/merge.en.md @@ -66,7 +66,6 @@ Here is a possible program to test your function : ```go package main - func main() { mergedTree := &TreeNodeM{} t1 := NewRandTree() diff --git a/subjects/nauuo.en.md b/subjects/nauuo.en.md index 49cf8da0d..2d9e35e03 100644 --- a/subjects/nauuo.en.md +++ b/subjects/nauuo.en.md @@ -37,15 +37,15 @@ Here is a possible program to test your function : package main import ( - "fmt" - piscine ".." + "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)) + 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)) } ``` diff --git a/subjects/reverse.en.md b/subjects/reverse.en.md index 9535f5f3a..00af63427 100644 --- a/subjects/reverse.en.md +++ b/subjects/reverse.en.md @@ -22,8 +22,8 @@ Write a function that reverses the list and returns pointer/reference to new lin package main type NodeAddL struct { - Next *NodeAddL - Num int + Next *NodeAddL + Num int } func Reverse(node *NodeAddL) *NodeAddL { @@ -47,22 +47,21 @@ 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() + 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: From e4fe4f601461d562d1f07f0cdced4de526c35dcf Mon Sep 17 00:00:00 2001 From: lee Date: Sat, 15 Feb 2020 09:27:33 +0000 Subject: [PATCH 011/146] correcting of groupie trackers --- .../groupie-tracker/groupie-tracker.audit.en.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/subjects/groupie-tracker/groupie-tracker.audit.en.md b/subjects/groupie-tracker/groupie-tracker.audit.en.md index b283d77d7..7ea387c21 100644 --- a/subjects/groupie-tracker/groupie-tracker.audit.en.md +++ b/subjects/groupie-tracker/groupie-tracker.audit.en.md @@ -26,14 +26,16 @@ ##### Try to see the "locations" for the artist/band `"Travis Scott"` ``` - "las_vegas-usa" - "brooklyn-usa" - "boston-usa" - "washington-usa" + "santiago-chile" + "sao_paulo-usa" + "los_angeles-usa" + "houston-usa" + "atlanta-usa" + "new_orleans-usa" "philadelphia-usa" - "montreal-canada" - "toronto-usa" - "new_york-usa" + "london-uk" + "frauenfeld-switzerland" + "turku-finland" ``` ###### Does it present the right "locations" as above? From 584a3e60330fe65d1b533f3b6b67bfad400c3d4d Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 17 Feb 2020 09:28:44 +0000 Subject: [PATCH 012/146] removing extra groupie-trackers --- ...groupie-trackers-visualization.audit.en.md | 35 ------------------- .../groupie-trackers-visualization.en.md | 28 --------------- 2 files changed, 63 deletions(-) delete mode 100644 subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md delete mode 100644 subjects/groupie-trackers/groupie-trackers-visualization.en.md diff --git a/subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md b/subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md deleted file mode 100644 index 15d5ce759..000000000 --- a/subjects/groupie-trackers/groupie-trackers-visualization.audit.en.md +++ /dev/null @@ -1,35 +0,0 @@ -#### Functional Project Questions - -###### Does the colors used allow you to see the text properly (ex: you can't see yellow text in a white background that well)? - -###### Is the design [consistent](https://digitalcommunications.wp.st-andrews.ac.uk/2016/04/07/why-is-consistency-important-in-web-design/)? (examples: every page follows the same palette of colors, is all centered or is it everything aligned to the right, etc.) - -###### Is the design [responsive](https://smallbiztrends.com/2013/05/what-is-responsive-web-design.html)? (when you change the width/ height of the page, is the site consistent?) - -###### Is the design [interactive](https://en.m.wikipedia.org/wiki/Interactive_design)? (does it interact with the actions of the user?) - -##### Try to explore an inexistent page. - -###### Is the design for the 404 HTTP status covered? - -#### General - -###### +Is it easy to use the web site? - -###### +Does it have a background? - -#### 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://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/groupie-trackers/groupie-trackers-visualization.en.md b/subjects/groupie-trackers/groupie-trackers-visualization.en.md deleted file mode 100644 index 818f10514..000000000 --- a/subjects/groupie-trackers/groupie-trackers-visualization.en.md +++ /dev/null @@ -1,28 +0,0 @@ -## groupie-trackers-visualization - -### Objectives - -You must follow the same [principles](https://public.01-edu.org/subjects/groupie-trackers/groupie-trackers.en) as the first subject. - -Groupie-trackers-visualization consists on manipulating the data coming from the API and displaying it in the most presentable way possible to you, following the [*Schneiderman's 8 Golden Rules of Interface Design*](https://www.interaction-design.org/literature/article/shneiderman-s-eight-golden-rules-will-help-you-design-better-interfaces) : - -- Strive for consistency -- Enable frequent users to use shortcuts -- Offer informative feedback -- Design dialogue to yield closure -- Offer simple error handling -- Permit easy reversal of actions -- Support internal locus of control -- Reduce short-term memory load - -This project will help you learn about: - -- The basics of human-computer interface. -- The basics of CSS. -- Linking CSS and HTML. - -### Instructions - -- Your project must contain **CSS**. -- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). -- We suggest you to search for the principles of a good website design. From fbe0dd7ed2280ed485ef8c0c9f95207c0674970a Mon Sep 17 00:00:00 2001 From: OGordoo Date: Mon, 17 Feb 2020 11:40:51 +0000 Subject: [PATCH 013/146] fix names groupie trackers --- ...oupie-tracker-geolocalization.audit.en.md} | 0 ... => groupie-tracker-geolocalization.en.md} | 2 +- ...groupie-tracker-visualizations.audit.en.md | 35 +++++++++++++++++++ .../groupie-tracker-visualizations.en.md | 28 +++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) rename subjects/groupie-tracker/{groupie-tracker-geolocation.audit.en.md => groupie-tracker-geolocalization.audit.en.md} (100%) rename subjects/groupie-tracker/{groupie-tracker-geolocation.en.md => groupie-tracker-geolocalization.en.md} (97%) create mode 100644 subjects/groupie-tracker/groupie-tracker-visualizations.audit.en.md create mode 100644 subjects/groupie-tracker/groupie-tracker-visualizations.en.md diff --git a/subjects/groupie-tracker/groupie-tracker-geolocation.audit.en.md b/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md similarity index 100% rename from subjects/groupie-tracker/groupie-tracker-geolocation.audit.en.md rename to subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md diff --git a/subjects/groupie-tracker/groupie-tracker-geolocation.en.md b/subjects/groupie-tracker/groupie-tracker-geolocalization.en.md similarity index 97% rename from subjects/groupie-tracker/groupie-tracker-geolocation.en.md rename to subjects/groupie-tracker/groupie-tracker-geolocalization.en.md index 632742d21..1596ba330 100644 --- a/subjects/groupie-tracker/groupie-tracker-geolocation.en.md +++ b/subjects/groupie-tracker/groupie-tracker-geolocalization.en.md @@ -1,4 +1,4 @@ -## groupie-tracker-geolocation +## groupie-tracker-geolocalization ### Objectives diff --git a/subjects/groupie-tracker/groupie-tracker-visualizations.audit.en.md b/subjects/groupie-tracker/groupie-tracker-visualizations.audit.en.md new file mode 100644 index 000000000..a376bf83c --- /dev/null +++ b/subjects/groupie-tracker/groupie-tracker-visualizations.audit.en.md @@ -0,0 +1,35 @@ +#### Functional + +###### Do the colors used allow a good visual contrast (ex: it is difficult to read a yellow text on a white background)? + +###### Is the design [consistent](https://digitalcommunications.wp.st-andrews.ac.uk/2016/04/07/why-is-consistency-important-in-web-design/)? (examples: every page follows the same palette of colors, is all centered or is it everything aligned to the right, etc.) + +###### Is the design [responsive](https://smallbiztrends.com/2013/05/what-is-responsive-web-design.html)? (when you change the width/ height of the page, is the site consistent?) + +###### Is the [interaction design](https://en.m.wikipedia.org/wiki/Interaction_design) good (is the interface easily usable)? + +##### Try to explore an inexistent page. + +###### Is the design for the 404 HTTP status covered? + +#### General + +###### +Is it easy to use the web site? + +###### +Does it have a background? + +#### 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://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? \ No newline at end of file diff --git a/subjects/groupie-tracker/groupie-tracker-visualizations.en.md b/subjects/groupie-tracker/groupie-tracker-visualizations.en.md new file mode 100644 index 000000000..de9bea8b5 --- /dev/null +++ b/subjects/groupie-tracker/groupie-tracker-visualizations.en.md @@ -0,0 +1,28 @@ +## groupie-tracker-visualizations + +### Objectives + +You must follow the same [principles](https://public.01-edu.org/subjects/groupie-tracker/groupie-tracker.en) as the first subject. + +Groupie-tracker-visualizations consists on manipulating the data coming from the API and displaying it in the most presentable way possible to you, following the [*Schneiderman's 8 Golden Rules of Interface Design*](https://www.interaction-design.org/literature/article/shneiderman-s-eight-golden-rules-will-help-you-design-better-interfaces) : + +- Strive for consistency +- Enable frequent users to use shortcuts +- Offer informative feedback +- Design dialogue to yield closure +- Offer simple error handling +- Permit easy reversal of actions +- Support internal locus of control +- Reduce short-term memory load + +This project will help you learn about: + +- The basics of human-computer interface. +- The basics of CSS. +- Linking CSS and HTML. + +### Instructions + +- Your project must contain **CSS**. +- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). +- We suggest you to search for the principles of a good website design. From 5bbc32a04d1ce37fd4714ea99c9e72fd93245c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dosan=20=C3=84lseyit?= <54891339+alseiitov@users.noreply.github.com> Date: Tue, 18 Feb 2020 17:43:11 +0600 Subject: [PATCH 014/146] wrong artist name and city https://groupietrackers.herokuapp.com/api/artists/23 https://groupietrackers.herokuapp.com/api/locations/23 --- .../groupie-tracker-geolocalization.audit.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md b/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md index 223e57896..5c77f0a22 100644 --- a/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md +++ b/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md @@ -25,9 +25,9 @@ aarhus denmark ``` ###### Are the markers displayed in the locations above? -##### Try to input `"Imagine Dragon"` to see the concerts locations. +##### Try to input `"Imagine Dragons"` to see the concerts locations. ``` -napoca germany, +berlin germany, quebec canada, del mar usa, mexico city mexico, From e53df64f35b5c3be10964cbac87acd2e57603acc Mon Sep 17 00:00:00 2001 From: lee Date: Tue, 18 Feb 2020 11:43:35 +0000 Subject: [PATCH 015/146] correcting groupie-tracker-geolocation audit --- .../groupie-tracker-geolocalization.audit.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md b/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md index 223e57896..b9b6194ca 100644 --- a/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md +++ b/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md @@ -78,11 +78,11 @@ newark usa ##### Try to input `"Red Hot Chili Peppers"` to see the concerts locations. ``` landgraaf netherlands, -los angeles california usa, +los angeles usa, rio de janeiro brazil, athens greece, -boston massachusetts, -dana point california usa, +massachusetts usa, +california usa, florence italia, gulf shores alabama usa ``` From 6d598bd8b0a3141da715e864e3d4a883083861e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dosan=20=C3=84lseyit?= <54891339+alseiitov@users.noreply.github.com> Date: Tue, 18 Feb 2020 18:35:38 +0600 Subject: [PATCH 016/146] no city in API https://groupietrackers.herokuapp.com/api/locations/42 --- .../groupie-tracker/groupie-tracker-geolocalization.audit.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md b/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md index b9b6194ca..285ae57d4 100644 --- a/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md +++ b/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md @@ -84,7 +84,7 @@ athens greece, massachusetts usa, california usa, florence italia, -gulf shores alabama usa +alabama usa ``` ###### Are the markers displayed in the locations above? From ca665cb0acfd2966790fa52f25bb6899550beab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dosan=20=C3=84lseyit?= <54891339+alseiitov@users.noreply.github.com> Date: Tue, 18 Feb 2020 19:38:27 +0600 Subject: [PATCH 017/146] one missing location http://groupietrackers.herokuapp.com/api/artists/1 https://groupietrackers.herokuapp.com/api/locations/1 --- .../groupie-tracker/groupie-tracker-geolocalization.audit.en.md | 1 + 1 file changed, 1 insertion(+) diff --git a/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md b/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md index b9b6194ca..9d2a271cd 100644 --- a/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md +++ b/subjects/groupie-tracker/groupie-tracker-geolocalization.audit.en.md @@ -6,6 +6,7 @@ ##### Try to input `"Queen"` to see the concerts locations. ``` +north carolina usa los angeles usa, nagoya japan, osaka japan, From 48619eb42e959ce80ee7a518a29296d5222adbb8 Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 19 Feb 2020 14:29:06 +0000 Subject: [PATCH 018/146] fixing exporting permissions --- subjects/ascii-art-web/ascii-art-web-export-file.audit.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/ascii-art-web/ascii-art-web-export-file.audit.en.md b/subjects/ascii-art-web/ascii-art-web-export-file.audit.en.md index 19974e990..e3622583c 100644 --- a/subjects/ascii-art-web/ascii-art-web-export-file.audit.en.md +++ b/subjects/ascii-art-web/ascii-art-web-export-file.audit.en.md @@ -4,7 +4,7 @@ ###### Does the exported file matches the output? ##### Try to open and change the exported file. -###### Are the exported files read and write for the user only? +###### Are the exported files read and write for the user? ###### Does the project use the HTTP header [Content-Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) to indicate the media type of the resource? From d4b653525d043b2e304e76f48b51ecb5b486c6e8 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Fri, 21 Feb 2020 11:21:43 +0000 Subject: [PATCH 019/146] Add RC program --- rc/README.md | 119 ++++++++ rc/rc.go | 754 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 873 insertions(+) create mode 100644 rc/README.md create mode 100644 rc/rc.go diff --git a/rc/README.md b/rc/README.md new file mode 100644 index 000000000..065a81709 --- /dev/null +++ b/rc/README.md @@ -0,0 +1,119 @@ +## rc (restrictions checker) + +This program analyses a go source file and displays in standard output the imports, functions, array types and loops used without authorization. + +### By default: + +- NO imports and NO built-in functions are allowed. +- NO casting is allowed either. +- Only functions declared inside the source file are allowed. +- All array types are allowed +- Loops are allowed + +### Flags + +- Two flags are defined: + - `--cast` allows casting to every built-in type. + - `--no-for` prohibits the use of `for` loops in the program or function. + - `--no-array`: + - Prohibits all array types if no types are specified after the flag. + Ex. + ```console + _$ ./rc main.go fmt.* github.com/01-edu/z01.PrintRune len --no-array + ``` + All array type in main.go will cause an error message. + - Prohibits only the types specified after the flag + Ex. + ```console + _$ ./rc main.go fmt.* github.com/01-edu/z01.PrintRune len --no-array rune string + ``` + Only array from the type rune and string are prohibit. All other array from built-in types are allowed + +### Arguments: + +- First Argument: + +The program must be executed passing the go source file to be analyze as the first argument + +- The remaining argument (from 2 to ...): + + Can be (without any particular order): + + - Allowed imports and functions from a package + - `.*` for full imports (all functions from that package are allowed) + - ``.`` for partial imports (only the function is allowed) + - ``.`#amout` for certain amounts (only certain amount os a function is allowed) + - Ex: `fmt.*` (all functions from `fmt` are allowed), `github.com/01-edu/z01.PrintRune` (only `z01.PrintRune` is allowed), `append#2` (the only amount of `append`'s allowed is 2) + - Allowed built-in functions + - Use the name of the built-in function + - Ex: `make`, `append`, `len`. + - Allowed casting + - by using the type of casting, ex: for allowing `string` casting, use `string` + - Or use the flag `--cast`, to allow every type of casting + + - Import relative packages + - Use the relative path + - Ex: `../piscine`, `..`, `.` + + - Unallow for loops + - Use the flags `--no-for`. + - Note: remember to use it before the `--no-array` flag. + - ex: + ```console + _$ ./rc main.go fmt.* github.com/01-edu/z01.PrintRune len --no-array <...> --no-for + ``` + the last line produces undesired behaviors. + - Unallow literals + - Use the flag `--no-lit="{PATTERN}"` + - Note: `"{PATTERN}"` must be a valid RegExp. + - ex: + ```console + _$ ./rc main.go fmt.* github.com/01-edu/z01.PrintRune len --no-array --no-lit=[b-yB-Y] + ``` +- Optional lasts arguments + - The flag `--no-array` must be given as the last argument or to signal that all the arguments after are unallowed array types +### Usage: + +- To allow the import of the whole `fmt` package, `z01.PrintRune` and the built-in functions len in the file `main.go` + + The imports must be writen exactly the way are writen inside the source code, example: + +```console + _$ ./rc main.go fmt.* github.com/01-edu/z01.PrintRune len +``` +- More examples: + +- import "fmt" is allowed by executing + ```console + _$ ./rc sourcefile.go fmt.* + ``` + + - import "go/parser" is allowed by executing + ```console + _$ ./rc sourcefile.go go/parser.* + ``` + + - import "github.com/01-edu/z01" is allowed by executing + ```console + ./rc sourcefile.go github.com/01-edu/z01.* + ``` + + - import "../../../all/tests/go/solutions" is allowed by executing + ```console + _$ ./rc sourcefile.go ../../../all/tests/go/solutions + ``` + (no `.*` is needed, all the functions from this relative package are allowed) + +- allow all type of casting + + ```console + _$ ./rc sourcefile.go ../../../all/tests/go/solutions/ztail/ztail.go fmt.* github.com/01-edu/z01 os.* strconv.* make len append --cast + ``` + - this will allow all type of casting in the file ztail.go + +- to allow just one type of casting + + ```console + _$ ./rc sourcefile.go ../../../all/tests/go/solutions/ztail/ztail.go fmt.* github.com/01-edu/z01 os.* strconv.* make len append rune + ``` + - this will allow `rune`, but not `int8`, ..., `string`, `float32`, ... \ No newline at end of file diff --git a/rc/rc.go b/rc/rc.go new file mode 100644 index 000000000..ab6cf9aa7 --- /dev/null +++ b/rc/rc.go @@ -0,0 +1,754 @@ +package main + +import ( + "fmt" + "go/ast" + "go/parser" + "go/token" + "log" + "os" + "regexp" + "strconv" + "strings" +) + +const ( + identation = " " +) + +var ( + allowedImp map[string]map[string]bool // Map of the allowed imports + allowedFun map[string]bool // Map of the allowed built-in functions + // Is necessary an array to keep all the call instances. + callX []nodePos // Keeps the name of the called functions and the position in the file. + // A map is enough for function declarations because they are unique. + funcDeclPkg map[string]*funcBody // Keeps the name of the function associated to its body and its position in the file. + allArrayTypes = true + arraysInstances []nodePos + forStmts []nodePos + basicLits []nodePos + illegals []illegal + notAllowedArrayT []string + predeclaredTypes = []string{"bool", "byte", "complex64", "complex128", + "error", "float32", "float64", "int", "int8", + "int16", "int32", "int64", "rune", "string", + "uint", "uint8", "uint16", "uint32", "uint64", + "uintptr", + } + relativeImports []string + importPkg map[string]*pkgFunc + pkgName []string + allImports map[string]bool + openImports []string + funcOccurrences map[string]int +) + +//pkgFunc for all the functions of a given package +type pkgFunc struct { + functions []string + path string +} + +type funcImp struct { + pkg, fun string + pos token.Pos +} + +// All visitors +type callVisitor struct { + Calls []string + Fset *token.FileSet +} + +type fileVisitor struct { + funcDecl []string + funcCalls []string + selectExpr []string + arrayType []nodePos + Fset *token.FileSet +} + +type pkgVisitor struct { + Fset *token.FileSet +} + +type impVisitor struct { + Fset *token.FileSet + relativeImports []string +} + +// Get the position of the node in the file +type locate interface { + getPos(ast.Node) string +} + +func (i *impVisitor) getPos(n ast.Node) string { + return i.Fset.Position(n.Pos()).String() +} + +func (fv *fileVisitor) getPos(n ast.Node) string { + return fv.Fset.Position(n.Pos()).String() +} + +func (p *pkgVisitor) getPos(n ast.Node) string { + return p.Fset.Position(n.Pos()).String() +} +func (c *callVisitor) getPos(n ast.Node) string { + return c.Fset.Position(n.Pos()).String() +} + +type illegal struct { + T string + Name string + Pos string +} + +func (i *illegal) String() string { + return i.T + " " + i.Name + " " + i.Pos +} + +func getPkgFunc(path string, fsetPkg *token.FileSet) { + i := &impVisitor{Fset: fsetPkg} + p := &pkgVisitor{Fset: fsetPkg} + pkgs, err := parser.ParseDir(fsetPkg, path, nil, parser.AllErrors) + + if err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + + for pkgname := range pkgs { + pkg, _ := ast.NewPackage(fsetPkg, pkgs[pkgname].Files, nil, nil) + pkgName = append(pkgName, pkgname) + + ast.Walk(i, pkg) + ast.Walk(p, pkg) + + for _, v := range i.relativeImports { + if isIn(v, openImports) { + break + } + openImports = append(openImports, v) + getPkgFunc(path+"/"+v, fsetPkg) + } + } + +} + +//reformat from the data base +func splitArgs(args string) []string { + result := strings.Split(args, " ") + return result +} + +func rightFile(args string) string { + expectedFiles := splitArgs(args) + + for _, s := range expectedFiles { + if strings.Contains(s, ".go") { + return s + } + } + return "" +} + +func allowCastingAndImp(allowedImports []string) { + casted := false + for i, v := range allowedImports { + casted = allow(v, casted) + if v == "--no-array" { + allArrayTypes = false + notAllowedArrayT = append(notAllowedArrayT, allowedImports[i+1:]...) + break + } + } +} + +type flags struct { + l struct { // flag for char or string literal + noLit bool // true -> unallows + pattern string // this pattern + } +} + +// TODO: treat all the flags in this function +// For now, only --no-lit="{PATTERN}" +func parseFlags(args []string) *flags { + f := &flags{} + for _, v := range args { + var flag []string + if strings.Contains(v, "=") { + flag = strings.Split(v, "=") + } + if flag == nil { + continue + } + if flag[0] == "--no-lit" { + f.l.noLit = true + f.l.pattern = flag[1] + } + } + return f +} + +func removeAmount(s string) string { + strRm := strings.TrimFunc(s, func(c rune) bool { + return c >= '0' && c <= '9' || c == '#' + }) + return strRm +} + +//compares if the function is used a certain amount of times allowed +func allowedAmount(occurrences map[string]int, allowedImports []string) { + function := "" + funcSelector := "" + for _, v := range allowedImports { + //pkg in case it's a build in function and slice in case it's a selector function + pkg, slice := trimRelativeImport(v) + if slice != nil { + function = strings.Join(slice, ".") + funcSelector = removeAmount(function) + } else { + function = pkg + funcSelector = removeAmount(pkg) + } + if strings.ContainsAny(function, "#") { + strNbr := strings.TrimPrefix(function, funcSelector+"#") + nbr, err := strconv.Atoi(strNbr) + if err != nil { + log.Panic(err) + } + if occurrences[funcSelector] > nbr { + illegals = append(illegals, illegal{ + T: "illegal-amount", + Name: funcSelector + " allowed count " + strNbr + " your count " + strconv.Itoa(occurrences[funcSelector]), + }) + } + } + } +} + +func main() { + if len(os.Args) < 2 { + fmt.Println("No file or directory") + return + } + + var allowedImports []string + + if len(os.Args) > 2 { + allowedImports = splitArgs(os.Args[2]) + } + + allowCastingAndImp(allowedImports) + flag := parseFlags(allowedImports) + + filename := strings.TrimSpace(rightFile(os.Args[1])) + split := strings.Split(filename, "/") + path := strings.Join(split[:len(split)-1], "/") + + if path == "" { + path = "." + } + + fsetFile := token.NewFileSet() + fsetPkg := token.NewFileSet() + + fmt.Println("Parsing") + file, err := parser.ParseFile(fsetFile, filename, nil, parser.AllErrors) + + if err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + + // Get all the name of all functions declared in the file + w := &fileVisitor{Fset: fsetFile} + ast.Walk(w, file) + getPkgFunc(path, fsetPkg) + + for _, v := range w.funcDecl { + isFuncAllowed(v, fsetPkg) + } + + // TODO: Parsing the arguments for the --max-occurrences flag + allowedAmount(funcOccurrences, allowedImports) + + if flag != nil { + flag.unallowLits() + } + + analyzeArrayT() + analyzeForStmt(allowedImports) + + fmt.Println(identation + "OK") + + fmt.Println("Cheating") + + if len(illegals) > 0 { + for _, i := range illegals { + fmt.Println(identation + i.String()) + } + os.Exit(1) + } else { + fmt.Println(identation + "OK") + } +} + +func (f flags) unallowLits() { + if f.l.noLit { + for _, v := range basicLits { + if !f.isLitAllowed(v.name) { + illegals = append(illegals, illegal{ + T: "illegal-literal", + Name: v.name, + Pos: v.position, + }) + } + } + } +} + +func (f flags) isLitAllowed(s string) bool { + matched, err := regexp.Match(f.l.pattern, []byte(s)) + + if err != nil { + return true + } + + return !matched +} + +func analyzeForStmt(args []string) { + if isIn("--no-for", args) { + for _, v := range forStmts { + illegals = append(illegals, illegal{ + T: "illegal-loop", + Name: v.name, + Pos: v.position, + }) + } + } +} + +func analyzeArrayT() { + if !allArrayTypes { + l := len(notAllowedArrayT) + for _, v := range arraysInstances { + if l == 0 || + isIn(v.name, notAllowedArrayT) { + illegals = append(illegals, illegal{ + T: "illegal-array-type", + Name: v.name, + Pos: v.position, + }) + } + } + } +} + +func allow(s string, casted bool) bool { + if strings.ContainsRune(s, '.') { + allowImport(s) + } else { + if allowedFun == nil { + allowedFun = make(map[string]bool) + } + if strings.ContainsAny(s, "#") { + s = removeAmount(s) + } + allowedFun[s] = true + } + + if s == "--cast" && !casted { + for _, v := range predeclaredTypes { + allow(v, false) + } + return true + } + return casted +} + +// Returns true if the string matches the format of a relative import +func isRelativeImport(s string) bool { + relativeImport, _ := regexp.MatchString(`\.\.\\??`, s) + return relativeImport +} + +// Returns true if the string represents an import package +// i.e and expresion like . +func isImport(s string) bool { + matched, _ := regexp.MatchString(`.\..`, s) + return matched +} + +func trimRelativeImport(str string) (string, []string) { + var pkg string + var slice []string + if isImport(str) && !isRelativeImport(str) { + splited := strings.Split(str, "/") + slice = strings.Split(splited[len(splited)-1], ".") + splited[len(splited)-1] = slice[0] + pkg = strings.Join(splited, "/") + + if allowedImp[slice[0]] == nil { + allowedImp[slice[0]] = make(map[string]bool) + } + fn := slice[len(slice)-1] + allowedImp[slice[0]][fn] = true + } else { + pkg = str + } + return pkg, slice +} + +func allowImport(s string) { + if allowedImp == nil { + allowedImp = make(map[string]map[string]bool) + } + if allImports == nil { + allImports = make(map[string]bool) + } + + pkg, slice := trimRelativeImport(s) + + allImports[pkg] = true + + fn := "*" + if len(slice) > 1 { + fn = removeAmount(slice[1]) + } + + if allowedImp[pkg] == nil { + allowedImp[pkg] = make(map[string]bool) + } + allowedImp[pkg][fn] = true +} + +func addToIllegals(funcname string) { + for _, v := range callX { + if v.name == funcname { + pos := v.position + setIllegal("illegal-call", v.name, pos) + } + } + if funcDeclPkg[funcname] != nil { + pos := funcDeclPkg[funcname].position + setIllegal("illegal-call", funcname, pos) + + } +} + +// First ignoring the imported functions +func isFuncAllowed(funcname string, fset *token.FileSet) bool { + if allowedFun[funcname] { + return true + } + + if !isFuncDeclIn(funcname, funcDeclPkg) { + addToIllegals(funcname) + return false + } + bodyf := funcDeclPkg[funcname].body + + if bodyf == nil { + addToIllegals(funcname) + fmt.Println("Body is nil") + return false + } + c := &callVisitor{Fset: fset} + ast.Walk(c, bodyf) + + res := true + + for _, v := range c.Calls { + if v == funcname { + continue + } + allowed := isFuncAllowed(v, fset) + if !allowed { + addToIllegals(funcname) + for _, v := range c.Calls { + if v == funcname { + continue + } + allowed := isFuncAllowed(v, fset) + if !allowed { + addToIllegals(funcname) + } + res = res && allowed + } + } + res = res && allowed + } + return res +} + +func isFuncDeclIn(funcname string, fundecl map[string]*funcBody) bool { + return fundecl[funcname] != nil +} + +func isFuncCallIn(funcname string, funP []nodePos) bool { + for _, v := range funP { + if v.name == funcname { + return true + } + } + return false +} + +func isIn(s string, slc []string) bool { + for _, v := range slc { + if s == v { + return true + } + } + return false +} + +// Keeps the positions of each function call and declaration +type funcBody struct { + position string + body *ast.BlockStmt +} + +type nodePos struct { + position string + name string +} + +func (fv *fileVisitor) Visit(n ast.Node) ast.Visitor { + fv.checkImport(n) + if ide, ok := n.(*ast.CallExpr); ok { + if opt, ok := ide.Fun.(*ast.Ident); ok { + fv.funcCalls = append(fv.funcCalls, opt.Name) + newFun := nodePos{position: fv.getPos(n), name: opt.Name} + callX = append(callX, newFun) + } + } + + if expr, ok := n.(*ast.SelectorExpr); ok { + if x, ok := expr.X.(*ast.Ident); ok { + fv.selectExpr = append(fv.selectExpr, x.Name+"."+expr.Sel.Name) + + //saves the function in to the map, from the package + if importPkg[x.Name] != nil { + importPkg[x.Name].functions = append(importPkg[x.Name].functions, x.Name+"."+expr.Sel.Name) + } + if funcOccurrences == nil { + funcOccurrences = make(map[string]int) + } + funcOccurrences[x.Name+"."+expr.Sel.Name]++ + } + } + + if ex, ok := n.(*ast.ArrayType); ok { + if op, ok := ex.Elt.(*ast.Ident); ok { + fv.arrayType = append(fv.arrayType, nodePos{ + name: op.Name, + position: fv.getPos(n), + }) + } + + } + + if exp, ok := n.(*ast.FuncDecl); ok { + fv.funcDecl = append(fv.funcDecl, exp.Name.Name) + for _, v := range exp.Type.Params.List { + if _, ok := v.Type.(*ast.FuncType); ok { + if allowedFun == nil { + allowedFun = make(map[string]bool) + } + for _, name := range v.Names { + allowedFun[name.Name] = true + } + } + } + } + + if ex, ok := n.(*ast.AssignStmt); ok { + if exp, ok := ex.Rhs[0].(*ast.FuncLit); ok { + if ide, ok := ex.Lhs[0].(*ast.Ident); ok { + if funcDeclPkg == nil { + funcDeclPkg = make(map[string]*funcBody) + } + funcDeclPkg[ide.Name] = &funcBody{body: exp.Body, position: fv.getPos(n)} + } + } + } + + return fv +} + +func positionIsIn(illegals []illegal, pos string) bool { + for _, v := range illegals { + if v.Pos == pos { + return true + } + } + return false +} + +func (p *pkgVisitor) Visit(n ast.Node) ast.Visitor { + if exp, ok := n.(*ast.FuncDecl); ok { + if funcDeclPkg == nil { + funcDeclPkg = make(map[string]*funcBody) + } + funcDeclPkg[exp.Name.Name] = &funcBody{body: exp.Body, position: p.getPos(n)} + for _, pkg := range pkgName { + if importPkg[pkg] != nil && isIn(pkg+"."+exp.Name.Name, importPkg[pkg].functions) { + funcDeclPkg[pkg+"."+exp.Name.Name] = &funcBody{body: exp.Body, position: p.getPos(n)} + } + } + } + + if ex, ok := n.(*ast.AssignStmt); ok { + if exp, ok := ex.Rhs[0].(*ast.FuncLit); ok { + if ide, ok := ex.Lhs[0].(*ast.Ident); ok { + if funcDeclPkg == nil { + funcDeclPkg = make(map[string]*funcBody) + } + funcDeclPkg[ide.Name] = &funcBody{body: exp.Body, position: p.getPos(n)} + } + } + } + return p +} + +func setIllegal(illegalType, funcName, pos string) { + if !positionIsIn(illegals, pos) { + illegals = append(illegals, illegal{ + T: illegalType, + Name: funcName, + Pos: pos, + }) + } +} + +// Signals that exists at least one callExpr in the node +func (c *callVisitor) Visit(n ast.Node) ast.Visitor { + if id, ok := n.(*ast.BasicLit); ok { + if id.Kind != token.CHAR && id.Kind != token.STRING { + return nil + } + basicLits = append(basicLits, nodePos{position: c.getPos(n), name: id.Value}) + } + + if exp, ok := n.(*ast.CallExpr); ok { + if fun, ok := exp.Fun.(*ast.Ident); ok { + c.Calls = append(c.Calls, fun.Name) + newFun := nodePos{position: c.getPos(n), name: fun.Name} + callX = append(callX, newFun) + if funcOccurrences == nil { + funcOccurrences = make(map[string]int) + } + funcOccurrences[fun.Name]++ + return c + } + } + // SelectorExpr is when we access a value (dot opperator) + // We need to check those for specific functions + if expr, ok := n.(*ast.SelectorExpr); ok { + x, ok := expr.X.(*ast.Ident) + if !ok { + // in this case we are deep in an access + // example, fmt is banned, but pouet isn't. + // we must allow pouet.fmt.x but not fmt.x + // this is the pouet.fmt.x case. + return c + } + pkg := allowedImp[x.Name] + f := x.Name + "." + expr.Sel.Name + if funcDeclPkg[f] != nil { + c.Calls = append(c.Calls, f) + return c + } + + if pkg == nil { + if allImports[x.Name] { + pos := c.getPos(n) + setIllegal("illegal-access", f, pos) + } + return c + } + if !pkg["*"] && !pkg[expr.Sel.Name] { + // all the package is not whiteList and is not explicitly allowed + pos := c.getPos(n) + setIllegal("illegal-access", f, pos) + } + } + + if ex, ok := n.(*ast.ArrayType); ok { + if op, ok := ex.Elt.(*ast.Ident); ok { + arraysInstances = append(arraysInstances, nodePos{ + name: op.Name, + position: c.getPos(n), + }) + } + } + + if _, ok := n.(*ast.ForStmt); ok { + forStmts = append(forStmts, nodePos{ + name: "for", + position: c.getPos(n), + }) + } + + return c +} + +func (fv *fileVisitor) checkImport(n ast.Node) ast.Visitor { + if spec, ok := n.(*ast.ImportSpec); ok { + pkg := spec.Path.Value[1 : len(spec.Path.Value)-1] + if allowedImp[pkg] == nil { + pos := fv.getPos(n) + setIllegal("illegal-import", pkg, pos) + return fv + } + // if the import is named, we need to move it to the new name + name := "" + if spec.Name != nil { + name = spec.Name.Name + } else if strings.ContainsRune(pkg, '/') { + parts := strings.Split(pkg, "/") + name = parts[len(parts)-1] + } + if allowedImp[pkg] != nil { + if name != "" { + allowedImp[name] = allowedImp[pkg] + allowedImp[pkg] = nil + } + } + + if isRelativeImport(pkg) { + if importPkg == nil { + importPkg = make(map[string]*pkgFunc) + } + if name != "" { + importPkg[name] = &pkgFunc{ + path: pkg, + } + } + relativeImports = append(relativeImports, name) + } + } + return fv +} + +func (i *impVisitor) Visit(n ast.Node) ast.Visitor { + if spec, ok := n.(*ast.ImportSpec); ok { + pkg := spec.Path.Value[1 : len(spec.Path.Value)-1] + if allImports == nil { + allImports = make(map[string]bool) + } + pkgSplit := strings.Split(pkg, "/") + + allImports[pkg] = true + allImports[pkgSplit[len(pkgSplit)-1]] = true + + if isRelativeImport(pkg) { + i.relativeImports = append(i.relativeImports, pkg) + } + } + return i +} From 31845cc87862932a8f6d042418603225b53b9529 Mon Sep 17 00:00:00 2001 From: lee Date: Sun, 23 Feb 2020 11:02:38 +0000 Subject: [PATCH 020/146] adding case to addprimesum --- subjects/addprimesum.en.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subjects/addprimesum.en.md b/subjects/addprimesum.en.md index f11d99434..c6c5dafe1 100644 --- a/subjects/addprimesum.en.md +++ b/subjects/addprimesum.en.md @@ -16,5 +16,7 @@ student@ubuntu:~/[[ROOT]]/test$ ./test 7 17 student@ubuntu:~/[[ROOT]]/test$ ./test 5 7 0 -student@ubuntu:~/[[ROOT]]/test$ +student@ubuntu:~/[[ROOT]]/test$ ./test +0 +student@ubuntu:~/[[ROOT]]/test$ ``` From 17521490f73ee6f9c728f310a1bfcb268a183eb8 Mon Sep 17 00:00:00 2001 From: lee Date: Sun, 23 Feb 2020 21:07:27 +0000 Subject: [PATCH 021/146] correcting and adding cases to lcm subject --- subjects/lcm.en.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/subjects/lcm.en.md b/subjects/lcm.en.md index 98688f3e7..e58d34f6a 100644 --- a/subjects/lcm.en.md +++ b/subjects/lcm.en.md @@ -15,7 +15,7 @@ This means that: Write a function, `lcm`, that returns least common multiple. -All arguments tested will be positive `int` values. +It will be tested with positive `int` values and `0`. ### Expected function @@ -32,13 +32,9 @@ Here is a possible program to test your function : ```go package main -import ( - "fmt" - piscine ".." -) - func main() { - fmt.Println(piscine.Lcm(2, 7)) + fmt.Println(Lcm(2, 7)) + fmt.Println(Lcm(0, 4)) } ``` @@ -48,5 +44,6 @@ func main() { student@ubuntu:~/[[ROOT]]/test$ go build student@ubuntu:~/[[ROOT]]/test$ ./test 14 +0 student@ubuntu:~/[[ROOT]]/test$ ``` From a4d751f4a3f2a16920824072fca694e7c55e5c18 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Mon, 24 Feb 2020 09:59:32 +0000 Subject: [PATCH 022/146] raid1 case fixes --- subjects/raid1a.en.md | 2 +- subjects/raid1b.en.md | 2 +- subjects/raid1c.en.md | 2 +- subjects/raid1d.en.md | 2 +- subjects/raid1e.en.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/subjects/raid1a.en.md b/subjects/raid1a.en.md index aa683d8a9..0e02c9126 100644 --- a/subjects/raid1a.en.md +++ b/subjects/raid1a.en.md @@ -6,7 +6,7 @@ Write a function `Raid1a` that prints a **valid** rectangle of width `x` and of The function must draw the rectangles as in the examples. -`x` and `y` will always be positive numbers. +`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. ### Expected function diff --git a/subjects/raid1b.en.md b/subjects/raid1b.en.md index cc90bf521..41b705682 100644 --- a/subjects/raid1b.en.md +++ b/subjects/raid1b.en.md @@ -6,7 +6,7 @@ Write a function `Raid1b` that prints a **valid** rectangle of width `x` and of The function must draw the rectangles as in the examples. -`x` and `y` will always be positive numbers. +`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. ### Expected function diff --git a/subjects/raid1c.en.md b/subjects/raid1c.en.md index 82bef4324..77aa21ee4 100644 --- a/subjects/raid1c.en.md +++ b/subjects/raid1c.en.md @@ -6,7 +6,7 @@ Write a function `Raid1c` that prints a **valid** rectangle of width `x` and of The function must draw the rectangles as in the examples. -`x` and `y` will always be positive numbers. +`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. ### Expected function diff --git a/subjects/raid1d.en.md b/subjects/raid1d.en.md index 32f8495ad..3bfd67d46 100644 --- a/subjects/raid1d.en.md +++ b/subjects/raid1d.en.md @@ -6,7 +6,7 @@ Write a function `Raid1d` that prints a **valid** rectangle of width `x` and of The function must draw the rectangles as in the examples. -`x` and `y` will always be positive numbers. +`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. ### Expected function diff --git a/subjects/raid1e.en.md b/subjects/raid1e.en.md index 3762f2714..36d54a6e4 100644 --- a/subjects/raid1e.en.md +++ b/subjects/raid1e.en.md @@ -6,7 +6,7 @@ Write a function `Raid1e` that prints a **valid** rectangle of width `x` and of The function must draw the rectangles as in the examples. -`x` and `y` will always be positive numbers. +`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. ### Expected function From 486e38ff4790bb4709cbe40985763933d666d0b3 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Mon, 24 Feb 2020 10:24:09 +0000 Subject: [PATCH 023/146] fixing example in lem-in --- subjects/lem-in/lem-in.en.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/subjects/lem-in/lem-in.en.md b/subjects/lem-in/lem-in.en.md index f2fa4c18b..8611b3348 100644 --- a/subjects/lem-in/lem-in.en.md +++ b/subjects/lem-in/lem-in.en.md @@ -127,6 +127,11 @@ student$ ./lem-in test0.txt ##start 1 23 3 2 16 7 +3 16 3 +4 16 5 +5 9 3 +6 1 5 +7 4 8 ##end 0 9 5 0-4 @@ -135,12 +140,17 @@ student$ ./lem-in test0.txt 4-3 5-2 3-5 +4-2 +2-1 +7-6 +7-2 +7-4 +6-5 -L1-2 -L1-4 L2-2 -L1-0 L2-4 L3-2 -L2-0 L3-4 -L3-0 +L1-3 L3-2 +L1-4 L2-3 L3-5 +L1-0 L2-4 L3-6 +L2-0 L3-0 student$ ``` From 3cc6d7197d533292f00951e816756ed66a29caed Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Mon, 24 Feb 2020 10:36:24 +0000 Subject: [PATCH 024/146] more fixing --- subjects/lem-in/lem-in.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subjects/lem-in/lem-in.en.md b/subjects/lem-in/lem-in.en.md index 8611b3348..c20377ad5 100644 --- a/subjects/lem-in/lem-in.en.md +++ b/subjects/lem-in/lem-in.en.md @@ -147,9 +147,9 @@ student$ ./lem-in test0.txt 7-4 6-5 -L1-3 L3-2 -L1-4 L2-3 L3-5 -L1-0 L2-4 L3-6 +L1-3 L2-2 +L1-4 L2-5 L3-3 +L1-0 L2-6 L3-4 L2-0 L3-0 student$ ``` From 1c6f298ab2db46994f77ba9174c8c2d56e4caf9e Mon Sep 17 00:00:00 2001 From: Tlekbai Ali Date: Tue, 25 Feb 2020 13:08:15 +0600 Subject: [PATCH 025/146] Update condition of the subject. --- subjects/balancedstring.en.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subjects/balancedstring.en.md b/subjects/balancedstring.en.md index c42e7d5df..e9b589a85 100644 --- a/subjects/balancedstring.en.md +++ b/subjects/balancedstring.en.md @@ -4,7 +4,8 @@ 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. +Write a program that takes a string and outputs maximum amount of balanced strings without ignoring any letters. +Display output with `\n` at the end of line. If the number of arguments is not 1, display `\n`. From d5424e10d547c806326546c45e0031bf2fac9a47 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Thu, 27 Feb 2020 11:46:14 +0000 Subject: [PATCH 026/146] fixing error --- subjects/lem-in/lem-in.audit.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/lem-in/lem-in.audit.en.md b/subjects/lem-in/lem-in.audit.en.md index e2043995a..401e7da82 100644 --- a/subjects/lem-in/lem-in.audit.en.md +++ b/subjects/lem-in/lem-in.audit.en.md @@ -112,7 +112,7 @@ student$ ./lem-in example02.txt 1 4 1 2 6 0 ##end -3 4 1 +3 5 3 0-1 0-3 1-2 From b92d82687e254dd65a20360881eba88a66026dfb Mon Sep 17 00:00:00 2001 From: lee Date: Tue, 25 Feb 2020 12:02:16 +0000 Subject: [PATCH 027/146] removing todo-link --- subjects/abort.en.md | 2 +- subjects/abort.fr.md | 2 +- subjects/activebits.en.md | 2 +- subjects/activebits.fr.md | 2 +- subjects/addlinkednumbers.en.md | 44 +++++++-------- subjects/addprimesum.en.md | 4 +- subjects/addprimesum.fr.md | 2 +- subjects/advancedsortwordarr.en.md | 2 +- subjects/advancedsortwordarr.fr.md | 2 +- subjects/alphacount.en.md | 2 +- subjects/alphacount.fr.md | 12 ++--- subjects/anagram.en.md | 22 ++++---- subjects/any.en.md | 4 +- subjects/any.fr.md | 18 +++---- subjects/appendrange.en.md | 2 +- subjects/appendrange.fr.md | 10 ++-- subjects/atoi.en.md | 10 ++-- subjects/atoi.fr.md | 66 +++++++++++------------ subjects/atoibase.en.md | 2 +- subjects/atoibase.fr.md | 22 ++++---- subjects/atoibaseprog.en.md | 8 +-- subjects/atoibaseprog.fr.md | 20 +++---- subjects/atoiprog.en.md | 10 ++-- subjects/basicatoi.en.md | 10 ++-- subjects/basicatoi.fr.md | 32 +++++------ subjects/basicatoi2.en.md | 10 ++-- subjects/basicatoi2.fr.md | 42 +++++++-------- subjects/basicjoin.en.md | 2 +- subjects/basicjoin.fr.md | 2 +- subjects/boolean.en.md | 6 +-- subjects/boolean.fr.md | 6 +-- subjects/brainfuck.en.md | 14 ++--- subjects/brainfuck.fr.md | 14 ++--- subjects/btreeapplybylevel.en.md | 2 +- subjects/btreeapplybylevel.fr.md | 2 +- subjects/btreeapplyinorder.en.md | 6 +-- subjects/btreeapplyinorder.fr.md | 6 +-- subjects/btreeapplypostorder.en.md | 16 +++--- subjects/btreeapplypostorder.fr.md | 6 +-- subjects/btreeapplypreorder.en.md | 2 +- subjects/btreeapplypreorder.fr.md | 2 +- subjects/btreedeletenode.en.md | 2 +- subjects/btreedeletenode.fr.md | 2 +- subjects/btreeinsertdata.en.md | 26 ++++----- subjects/btreeinsertdata.fr.md | 26 ++++----- subjects/btreeisbinary.en.md | 2 +- subjects/btreeisbinary.fr.md | 2 +- subjects/btreelevelcount.en.md | 2 +- subjects/btreelevelcount.fr.md | 2 +- subjects/btreemax.en.md | 2 +- subjects/btreemax.fr.md | 2 +- subjects/btreemin.en.md | 2 +- subjects/btreemin.fr.md | 2 +- subjects/btreeprintroot.en.md | 14 ++--- subjects/btreeprintroot.fr.md | 18 +++---- subjects/btreesearchitem.en.md | 2 +- subjects/btreesearchitem.fr.md | 2 +- subjects/btreetransplant.en.md | 2 +- subjects/btreetransplant.fr.md | 2 +- subjects/capitalize.en.md | 2 +- subjects/capitalize.fr.md | 2 +- subjects/capitalizeprog.en.md | 6 +-- subjects/capitalizeprog.fr.md | 6 +-- subjects/cat.en.md | 14 ++--- subjects/cat.fr.md | 14 ++--- subjects/changeorder.en.md | 34 ++++++------ subjects/cl-camp1.en.md | 10 ++-- subjects/cl-camp1.fr.md | 10 ++-- subjects/cl-camp3.en.md | 6 +-- subjects/cl-camp3.fr.md | 6 +-- subjects/cl-camp4.en.md | 8 +-- subjects/cl-camp4.fr.md | 8 +-- subjects/cl-camp5.en.md | 2 +- subjects/cl-camp5.fr.md | 2 +- subjects/cl.en.md | 10 ++-- subjects/cl.fr.md | 10 ++-- subjects/cleanstr.en.md | 1 + subjects/cleanstr.fr.md | 1 + subjects/collatzcountdown.en.md | 4 +- subjects/collatzcountdown.fr.md | 2 +- subjects/comcheck.en.md | 4 +- subjects/comcheck.fr.md | 4 +- subjects/commandments.en.md | 84 ++++++++++++++--------------- subjects/commandments.fr.md | 84 ++++++++++++++--------------- subjects/compact.en.md | 10 ++-- subjects/compact.fr.md | 6 +-- subjects/compare.en.md | 2 +- subjects/compare.fr.md | 2 +- subjects/concat.en.md | 2 +- subjects/concat.fr.md | 2 +- subjects/concatparams.en.md | 2 +- subjects/concatparams.fr.md | 2 +- subjects/convertbase.en.md | 2 +- subjects/convertbase.fr.md | 2 +- subjects/countif.en.md | 2 +- subjects/countif.fr.md | 2 +- subjects/createelem.en.md | 2 +- subjects/createelem.fr.md | 2 +- subjects/displayfile.en.md | 10 ++-- subjects/displayfile.fr.md | 12 ++--- subjects/divmod.en.md | 12 ++--- subjects/divmod.fr.md | 12 ++--- subjects/enigma.en.md | 10 ++-- subjects/enigma.fr.md | 84 ++++++++++++++--------------- subjects/fibonacci.en.md | 6 +-- subjects/fibonacci.fr.md | 4 +- subjects/findnextprime.en.md | 2 +- subjects/findnextprime.fr.md | 14 ++--- subjects/firstrune.en.md | 2 +- subjects/firstrune.fr.md | 2 +- subjects/firstword.en.md | 6 +-- subjects/firstword.fr.md | 6 +-- subjects/foreach.en.md | 2 +- subjects/foreach.fr.md | 2 +- subjects/foreachprog.en.md | 2 +- subjects/fprime.en.md | 6 +-- subjects/fprime.fr.md | 6 +-- subjects/index.en.md | 2 +- subjects/index.fr.md | 2 +- subjects/inter.en.md | 4 +- subjects/inter.fr.md | 4 +- subjects/isalpha.en.md | 2 +- subjects/isalpha.fr.md | 2 +- subjects/islower.en.md | 2 +- subjects/islower.fr.md | 2 +- subjects/isnegative.en.md | 4 +- subjects/isnegative.fr.md | 4 +- subjects/isnumeric.en.md | 2 +- subjects/isnumeric.fr.md | 2 +- subjects/ispowerof2.en.md | 4 +- subjects/ispowerof2.fr.md | 4 +- subjects/isprime.en.md | 2 +- subjects/isprime.fr.md | 2 +- subjects/isprintable.en.md | 2 +- subjects/isprintable.fr.md | 2 +- subjects/issorted.en.md | 2 +- subjects/issorted.fr.md | 2 +- subjects/isupper.en.md | 2 +- subjects/iterativefactorial.en.md | 2 +- subjects/iterativefactorial.fr.md | 2 +- subjects/iterativepower.en.md | 6 +-- subjects/iterativepower.fr.md | 6 +-- subjects/itoa.en.md | 4 +- subjects/itoa.fr.md | 4 +- subjects/itoabase.en.md | 4 +- subjects/itoabase.fr.md | 4 +- subjects/itoabaseprog.en.md | 4 +- subjects/itoabaseprog.fr.md | 4 +- subjects/itoaprog.en.md | 4 +- subjects/join.en.md | 2 +- subjects/join.fr.md | 2 +- subjects/lastrune.en.md | 2 +- subjects/lastrune.fr.md | 2 +- subjects/lastword.en.md | 6 +-- subjects/lastword.fr.md | 6 +-- subjects/listat.en.md | 4 +- subjects/listat.fr.md | 4 +- subjects/listclear.en.md | 4 +- subjects/listclear.fr.md | 4 +- subjects/listfind.en.md | 4 +- subjects/listfind.fr.md | 4 +- subjects/listforeach.en.md | 6 +-- subjects/listforeach.fr.md | 6 +-- subjects/listforeachif.en.md | 10 ++-- subjects/listforeachif.fr.md | 10 ++-- subjects/listlast.en.md | 2 +- subjects/listlast.fr.md | 2 +- subjects/listmerge.en.md | 4 +- subjects/listmerge.fr.md | 2 +- subjects/listpushback.en.md | 2 +- subjects/listpushback.fr.md | 2 +- subjects/listpushfront.en.md | 2 +- subjects/listpushfront.fr.md | 2 +- subjects/listpushpara.en.md | 2 +- subjects/listpushparams.en.md | 2 +- subjects/listpushparams.fr.md | 2 +- subjects/listremoveif.en.md | 2 +- subjects/listremoveif.fr.md | 2 +- subjects/listremoveifprog.en.md | 2 +- subjects/listreverse.en.md | 2 +- subjects/listreverse.fr.md | 2 +- subjects/listsize.en.md | 2 +- subjects/listsize.fr.md | 2 +- subjects/listsort.en.md | 4 +- subjects/listsort.fr.md | 4 +- subjects/makerange.en.md | 2 +- subjects/makerange.fr.md | 2 +- subjects/map.en.md | 2 +- subjects/map.fr.md | 2 +- subjects/max.en.md | 2 +- subjects/max.fr.md | 2 +- subjects/maxprog.en.md | 2 +- subjects/nrune.en.md | 2 +- subjects/nrune.fr.md | 2 +- subjects/nruneprog.en.md | 2 +- subjects/options.en.md | 14 ++--- subjects/options.fr.md | 12 ++--- subjects/pointone.en.md | 2 +- subjects/pointone.fr.md | 2 +- subjects/printalphabet.en.md | 2 +- subjects/printalphabet.fr.md | 2 +- subjects/printcomb.en.md | 4 +- subjects/printcomb.fr.md | 4 +- subjects/printcomb2.en.md | 4 +- subjects/printcomb2.fr.md | 4 +- subjects/printcombn.en.md | 10 ++-- subjects/printcombn.fr.md | 10 ++-- subjects/printdigits.fr.md | 2 +- subjects/printdigitsprog.en.md | 2 +- subjects/printhex.en.md | 4 +- subjects/printhex.fr.md | 7 ++- subjects/printnbr.en.md | 2 +- subjects/printnbr.fr.md | 2 +- subjects/printnbrbase.en.md | 8 +-- subjects/printnbrbase.fr.md | 8 +-- subjects/printnbrinorder.en.md | 2 +- subjects/printnbrinorder.fr.md | 2 +- subjects/printreversealphabet.fr.md | 2 +- subjects/printstr.en.md | 4 +- subjects/printstr.fr.md | 4 +- subjects/printstrprog.en.md | 2 +- subjects/printwordstables.en.md | 4 +- subjects/printwordstables.fr.md | 4 +- subjects/raid2.en.md | 4 +- subjects/raid2.fr.md | 4 +- subjects/raid3.en.md | 6 +-- subjects/raid3.fr.md | 6 +-- subjects/range.en.md | 6 +-- subjects/range.fr.md | 6 +-- subjects/rectangle.en.md | 12 ++--- subjects/rectangle.fr.md | 12 ++--- subjects/recursivefactorial.en.md | 2 +- subjects/recursivefactorial.fr.md | 2 +- subjects/recursivepower.en.md | 2 +- subjects/recursivepower.fr.md | 2 +- subjects/rot13.en.md | 6 +-- subjects/rot13.fr.md | 6 +-- subjects/rot14.en.md | 2 +- subjects/rot14.fr.md | 2 +- subjects/sametree.en.md | 61 ++++++++++----------- subjects/searchreplace.en.md | 4 +- subjects/searchreplace.fr.md | 4 +- subjects/sortedlistmerge.en.md | 4 +- subjects/sortedlistmerge.fr.md | 4 +- subjects/sortintegertable.en.md | 2 +- subjects/sortlist.en.md | 6 +-- subjects/sortlist.fr.md | 6 +-- subjects/sortlistinsert.en.md | 4 +- subjects/sortlistinsert.fr.md | 4 +- subjects/sortwordarr.en.md | 2 +- subjects/sortwordarr.fr.md | 2 +- subjects/sortwordarrprog.en.md | 2 +- subjects/sortwordarrprog.fr.md | 2 +- subjects/split.en.md | 2 +- subjects/split.fr.md | 2 +- subjects/splitwhitespaces.en.md | 2 +- subjects/sqrt.en.md | 2 +- subjects/sqrt.fr.md | 2 +- subjects/strlen.en.md | 4 +- subjects/strlen.fr.md | 4 +- subjects/strlenprog.en.md | 2 +- subjects/strlenprog.fr.md | 5 +- subjects/strrev.en.md | 6 +-- subjects/strrev.fr.md | 6 +-- subjects/strrevprog.en.md | 2 +- subjects/strrevprog.fr.md | 2 +- subjects/swap.en.md | 4 +- subjects/swapprog.en.md | 2 +- subjects/switchcase.en.md | 6 +-- subjects/switchcase.fr.md | 6 +-- subjects/tabmult.en.md | 2 +- subjects/tabmult.fr.md | 2 +- subjects/tolower.en.md | 2 +- subjects/tolower.fr.md | 2 +- subjects/toupper.en.md | 2 +- subjects/trimatoi.en.md | 14 ++--- subjects/trimatoi.fr.md | 13 +++-- subjects/twosum.en.md | 5 +- subjects/ultimatedivmod.en.md | 14 ++--- subjects/ultimatepointone.en.md | 8 +-- subjects/unmatch.en.md | 4 +- subjects/unmatch.fr.md | 2 +- subjects/ztail.en.md | 10 ++-- 283 files changed, 915 insertions(+), 916 deletions(-) diff --git a/subjects/abort.en.md b/subjects/abort.en.md index dd2db0fe3..d7b7be872 100644 --- a/subjects/abort.en.md +++ b/subjects/abort.en.md @@ -14,7 +14,7 @@ func Abort(a, b, c, d, e int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/abort.fr.md b/subjects/abort.fr.md index 964905702..94b837a70 100644 --- a/subjects/abort.fr.md +++ b/subjects/abort.fr.md @@ -14,7 +14,7 @@ func Abort(a, b, c, d, e int) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/activebits.en.md b/subjects/activebits.en.md index 4a6e7393b..f5e7ad220 100644 --- a/subjects/activebits.en.md +++ b/subjects/activebits.en.md @@ -14,7 +14,7 @@ func ActiveBits(n int) uint { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/activebits.fr.md b/subjects/activebits.fr.md index 6e3962903..b3bbc65fc 100644 --- a/subjects/activebits.fr.md +++ b/subjects/activebits.fr.md @@ -14,7 +14,7 @@ func ActiveBits(n int) uint { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/addlinkednumbers.en.md b/subjects/addlinkednumbers.en.md index 00fea8fc9..393f7864e 100644 --- a/subjects/addlinkednumbers.en.md +++ b/subjects/addlinkednumbers.en.md @@ -23,8 +23,8 @@ Write a function that adds the two numbers and returns the sum as a linked list package main type NodeAddL struct { - Next *NodeAddL - Num int + Next *NodeAddL + Num int } func AddLinkedNumbers(num1, num1 *NodeAddL) *NodeAddL { @@ -40,7 +40,7 @@ Here is a possible program to test your function: package main import ( - "fmt" + "fmt" ) func pushFront(node *NodeAddL, num int) *NodeAddL { @@ -48,25 +48,25 @@ func pushFront(node *NodeAddL, num int) *NodeAddL { } 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() + // 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() } ``` diff --git a/subjects/addprimesum.en.md b/subjects/addprimesum.en.md index c6c5dafe1..418dae559 100644 --- a/subjects/addprimesum.en.md +++ b/subjects/addprimesum.en.md @@ -4,7 +4,7 @@ Write a program that takes a positive integer as argument and displays the sum of all prime numbers inferior or equal to it followed by a newline (`'\n'`). -- If the number of arguments is different from 1, or if the argument is not a positive number, the program displays `0` followed by a newline. +- If the number of arguments is different from 1, or if the argument is not a positive number, the program displays `0` followed by a newline. ### Usage @@ -18,5 +18,5 @@ student@ubuntu:~/[[ROOT]]/test$ ./test 5 7 0 student@ubuntu:~/[[ROOT]]/test$ ./test 0 -student@ubuntu:~/[[ROOT]]/test$ +student@ubuntu:~/[[ROOT]]/test$ ``` diff --git a/subjects/addprimesum.fr.md b/subjects/addprimesum.fr.md index c8b06eee4..8c431d06f 100644 --- a/subjects/addprimesum.fr.md +++ b/subjects/addprimesum.fr.md @@ -4,7 +4,7 @@ Écrire un programme qui prend un entier positif comme argument et qui affiche la somme de tous les nombres premiers inférieurs ou égaux à celui-ci, suivie d'un retour à la ligne (`'\n'`). -- Si le nombre d'arguments est différent de 1, ou si l'argument n'est pas un nombre positif, le programme affiche `0` suivi d'un retour à la ligne. +- Si le nombre d'arguments est différent de 1, ou si l'argument n'est pas un nombre positif, le programme affiche `0` suivi d'un retour à la ligne. ### Utilisation diff --git a/subjects/advancedsortwordarr.en.md b/subjects/advancedsortwordarr.en.md index 562793381..10168e531 100644 --- a/subjects/advancedsortwordarr.en.md +++ b/subjects/advancedsortwordarr.en.md @@ -14,7 +14,7 @@ func AdvancedSortWordArr(array []string, f func(a, b string) int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/advancedsortwordarr.fr.md b/subjects/advancedsortwordarr.fr.md index a1ae8a3b1..c4fcb75e8 100644 --- a/subjects/advancedsortwordarr.fr.md +++ b/subjects/advancedsortwordarr.fr.md @@ -14,7 +14,7 @@ func AdvancedSortWordArr(array []string, f func(a, b string) int) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/alphacount.en.md b/subjects/alphacount.en.md index 8895e8c2d..da478b4f3 100644 --- a/subjects/alphacount.en.md +++ b/subjects/alphacount.en.md @@ -17,7 +17,7 @@ func AlphaCount(str string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/alphacount.fr.md b/subjects/alphacount.fr.md index 8895e8c2d..32fca1f1b 100644 --- a/subjects/alphacount.fr.md +++ b/subjects/alphacount.fr.md @@ -17,20 +17,20 @@ func AlphaCount(str string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - str := "Hello 78 World! 4455 /" - nb := piscine.AlphaCount(str) - fmt.Println(nb) + str := "Hello 78 World! 4455 /" + nb := piscine.AlphaCount(str) + fmt.Println(nb) } ``` diff --git a/subjects/anagram.en.md b/subjects/anagram.en.md index 619eb2719..5b41bc904 100644 --- a/subjects/anagram.en.md +++ b/subjects/anagram.en.md @@ -35,22 +35,22 @@ Here is a possible program to test your function: ```go package main import ( - piscine ".." - "fmt" + piscine ".." + "fmt" ) func main() { - test1 := piscine.IsAnagram("listen", "silent") - fmt.Println(test1) + test1 := piscine.IsAnagram("listen", "silent") + fmt.Println(test1) - test2 := piscine.IsAnagram("alem", "school") - fmt.Println(test2) + test2 := piscine.IsAnagram("alem", "school") + fmt.Println(test2) - test3 := piscine.IsAnagram("neat", "a net") - fmt.Println(test3) + test3 := piscine.IsAnagram("neat", "a net") + fmt.Println(test3) - test4 := piscine.IsAnagram("anna madrigal", "a man and a girl") - fmt.Println(test4) + test4 := piscine.IsAnagram("anna madrigal", "a man and a girl") + fmt.Println(test4) } ``` @@ -63,4 +63,4 @@ true false true true -``` \ No newline at end of file +``` diff --git a/subjects/any.en.md b/subjects/any.en.md index 2fcca7fee..8b2f5d36f 100644 --- a/subjects/any.en.md +++ b/subjects/any.en.md @@ -4,7 +4,7 @@ Write a function `Any` that returns `true`, for a `string` array : -- if, when that `string` array is passed through an `f` function, at least one element returns `true`. +- if, when that `string` array is passed through an `f` function, at least one element returns `true`. ### Expected function @@ -16,7 +16,7 @@ func Any(f func(string) bool, arr []string) bool { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/any.fr.md b/subjects/any.fr.md index a783a4aa6..88820eea3 100644 --- a/subjects/any.fr.md +++ b/subjects/any.fr.md @@ -16,25 +16,25 @@ func Any(f func(string) bool, arr []string) bool { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - tab1 := []string{"Hello", "how", "are", "you"} - tab2 := []string{"This", "is", "4", "you"} + tab1 := []string{"Hello", "how", "are", "you"} + tab2 := []string{"This", "is", "4", "you"} - result1 := piscine.Any(piscine.IsNumeric, tab1) - result2 := piscine.Any(piscine.IsNumeric, tab2) + result1 := piscine.Any(piscine.IsNumeric, tab1) + result2 := piscine.Any(piscine.IsNumeric, tab2) - fmt.Println(result1) - fmt.Println(result2) + fmt.Println(result1) + fmt.Println(result2) } ``` diff --git a/subjects/appendrange.en.md b/subjects/appendrange.en.md index b5bd235a6..2029de17d 100644 --- a/subjects/appendrange.en.md +++ b/subjects/appendrange.en.md @@ -20,7 +20,7 @@ func AppendRange(min, max int) []int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/appendrange.fr.md b/subjects/appendrange.fr.md index 669683023..c1dc93db1 100644 --- a/subjects/appendrange.fr.md +++ b/subjects/appendrange.fr.md @@ -20,19 +20,19 @@ func AppendRange(min, max int) []int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - fmt.Println(piscine.AppendRange(5, 10)) - fmt.Println(piscine.AppendRange(10, 5)) + fmt.Println(piscine.AppendRange(5, 10)) + fmt.Println(piscine.AppendRange(10, 5)) } ``` diff --git a/subjects/atoi.en.md b/subjects/atoi.en.md index 485dd295e..5a8738a2d 100644 --- a/subjects/atoi.en.md +++ b/subjects/atoi.en.md @@ -2,13 +2,13 @@ ### Instructions -- Write a [function](TODO-LINK) that simulates the behaviour of the `Atoi` function in Go. `Atoi` transforms a number represented as a `string` in a number represented as an `int`. +- Write a function that simulates the behaviour of the `Atoi` function in Go. `Atoi` transforms a number represented as a `string` in a number represented as an `int`. -- `Atoi` returns `0` if the `string` is not considered as a valid number. For this exercise **non-valid `string` chains will be tested**. Some will contain non-digits characters. +- `Atoi` returns `0` if the `string` is not considered as a valid number. For this exercise **non-valid `string` chains will be tested**. Some will contain non-digits characters. -- For this exercise the handling of the signs + or - **does have** to be taken into account. +- For this exercise the handling of the signs + or - **does have** to be taken into account. -- This function will **only** have to return the `int`. For this exercise the `error` result of atoi is not required. +- This function will **only** have to return the `int`. For this exercise the `error` result of atoi is not required. ### Expected function @@ -20,7 +20,7 @@ func Atoi(s string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/atoi.fr.md b/subjects/atoi.fr.md index 59fe80c4d..964d84dd5 100644 --- a/subjects/atoi.fr.md +++ b/subjects/atoi.fr.md @@ -2,13 +2,13 @@ ### Instructions -- Écrire une fonction qui reproduit le comportement de la fonction `Atoi` en Go. `Atoi` transforme un nombre représenté en `string` (chaîne de caractères) en `int` (entier). +- Écrire une fonction qui reproduit le comportement de la fonction `Atoi` en Go. `Atoi` transforme un nombre représenté en `string` (chaîne de caractères) en `int` (entier). -- `Atoi` retourne `0` si la `string` n'est pas considéré un nombre valide. Pour cet exercice des **`string` non valides seront testées!**. Certaines contiendront d'autres caractères que des chiffres. +- `Atoi` retourne `0` si la `string` n'est pas considéré un nombre valide. Pour cet exercice des **`string` non valides seront testées!**. Certaines contiendront d'autres caractères que des chiffres. -- Pour cet exercice la gestion des signes + ou - **doit être** prise en compte. +- Pour cet exercice la gestion des signes + ou - **doit être** prise en compte. -- Cette fonction aura **seulement** à retourner l'`int` (entier). Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé. +- Cette fonction aura **seulement** à retourner l'`int` (entier). Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé. ### Fonction attendue @@ -20,43 +20,43 @@ func Atoi(s string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - s := "12345" - s2 := "0000000012345" - s3 := "012 345" - s4 := "Hello World!" - s5 := "+1234" - s6 := "-1234" - s7 := "++1234" - s8 := "--1234" - - n := piscine.Atoi(s) - n2 := piscine.Atoi(s2) - n3 := piscine.Atoi(s3) - n4 := piscine.Atoi(s4) - n5 := piscine.Atoi(s5) - n6 := piscine.Atoi(s6) - n7 := piscine.Atoi(s7) - n8 := piscine.Atoi(s8) - - fmt.Println(n) - fmt.Println(n2) - fmt.Println(n3) - fmt.Println(n4) - fmt.Println(n5) - fmt.Println(n6) - fmt.Println(n7) - fmt.Println(n8) + s := "12345" + s2 := "0000000012345" + s3 := "012 345" + s4 := "Hello World!" + s5 := "+1234" + s6 := "-1234" + s7 := "++1234" + s8 := "--1234" + + n := piscine.Atoi(s) + n2 := piscine.Atoi(s2) + n3 := piscine.Atoi(s3) + n4 := piscine.Atoi(s4) + n5 := piscine.Atoi(s5) + n6 := piscine.Atoi(s6) + n7 := piscine.Atoi(s7) + n8 := piscine.Atoi(s8) + + fmt.Println(n) + fmt.Println(n2) + fmt.Println(n3) + fmt.Println(n4) + fmt.Println(n5) + fmt.Println(n6) + fmt.Println(n7) + fmt.Println(n8) } ``` diff --git a/subjects/atoibase.en.md b/subjects/atoibase.en.md index 8674ec303..af936db7a 100644 --- a/subjects/atoibase.en.md +++ b/subjects/atoibase.en.md @@ -28,7 +28,7 @@ func AtoiBase(s string, base string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/atoibase.fr.md b/subjects/atoibase.fr.md index 334841b6b..fbd06a484 100644 --- a/subjects/atoibase.fr.md +++ b/subjects/atoibase.fr.md @@ -8,9 +8,9 @@ Si la base n'est pas valide elle retourne `0`: Règles de validité d'une base : -- Une base doit contenir au moins 2 caractères. -- Chaque caractère d'une base doit être unique. -- Une base ne doit pas contenir les caractères `+` ou `-`. +- Une base doit contenir au moins 2 caractères. +- Chaque caractère d'une base doit être unique. +- Une base ne doit pas contenir les caractères `+` ou `-`. Seuls des nombres en `string` valides seront testés. @@ -26,22 +26,22 @@ func AtoiBase(s string, base string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - fmt.Println(piscine.AtoiBase("125", "0123456789")) - fmt.Println(piscine.AtoiBase("1111101", "01")) - fmt.Println(piscine.AtoiBase("7D", "0123456789ABCDEF")) - fmt.Println(piscine.AtoiBase("uoi", "choumi")) - fmt.Println(piscine.AtoiBase("bbbbbab", "-ab")) + fmt.Println(piscine.AtoiBase("125", "0123456789")) + fmt.Println(piscine.AtoiBase("1111101", "01")) + fmt.Println(piscine.AtoiBase("7D", "0123456789ABCDEF")) + fmt.Println(piscine.AtoiBase("uoi", "choumi")) + fmt.Println(piscine.AtoiBase("bbbbbab", "-ab")) } ``` diff --git a/subjects/atoibaseprog.en.md b/subjects/atoibaseprog.en.md index 9dbc79a8a..10746a06e 100644 --- a/subjects/atoibaseprog.en.md +++ b/subjects/atoibaseprog.en.md @@ -19,9 +19,9 @@ If the base or the `string` number is not valid it returns `0`: Validity rules for a base : -- A base must contain at least 2 characters. -- Each character of a base must be unique. -- A base should not contain `+` or `-` characters. +- A base must contain at least 2 characters. +- Each character of a base must be unique. +- A base should not contain `+` or `-` characters. Only valid `string` numbers will be tested. @@ -37,7 +37,7 @@ func AtoiBase(s string, base string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/atoibaseprog.fr.md b/subjects/atoibaseprog.fr.md index a3b8a9ad7..1e6410d73 100644 --- a/subjects/atoibaseprog.fr.md +++ b/subjects/atoibaseprog.fr.md @@ -19,9 +19,9 @@ Si la base n'est pas valide elle retourne `0`: Règles de validité d'une base : -- Une base doit contenir au moins 2 caractères. -- Chaque caractère d'une base doit être unique. -- Une base ne doit pas contenir les caractères `+` ou `-`. +- Une base doit contenir au moins 2 caractères. +- Chaque caractère d'une base doit être unique. +- Une base ne doit pas contenir les caractères `+` ou `-`. Seuls des nombres en `string` valides seront testés. @@ -37,21 +37,21 @@ func AtoiBase(s string, base string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" + "fmt" ) func main() { - fmt.Println(AtoiBase("125", "0123456789")) - fmt.Println(AtoiBase("1111101", "01")) - fmt.Println(AtoiBase("7D", "0123456789ABCDEF")) - fmt.Println(AtoiBase("uoi", "choumi")) - fmt.Println(AtoiBase("bbbbbab", "-ab")) + fmt.Println(AtoiBase("125", "0123456789")) + fmt.Println(AtoiBase("1111101", "01")) + fmt.Println(AtoiBase("7D", "0123456789ABCDEF")) + fmt.Println(AtoiBase("uoi", "choumi")) + fmt.Println(AtoiBase("bbbbbab", "-ab")) } ``` diff --git a/subjects/atoiprog.en.md b/subjects/atoiprog.en.md index d270f821e..54517d730 100644 --- a/subjects/atoiprog.en.md +++ b/subjects/atoiprog.en.md @@ -13,13 +13,13 @@ This means that: ### Instructions -- Write a [function](TODO-LINK) that simulates the behaviour of the `Atoi` function in Go. `Atoi` transforms a number represented as a `string` in a number represented as an `int`. +- Write a [function](TODO-LINK) that simulates the behaviour of the `Atoi` function in Go. `Atoi` transforms a number represented as a `string` in a number represented as an `int`. -- `Atoi` returns `0` if the `string` is not considered as a valid number. For this exercise **non-valid `string` chains will be tested**. Some will contain non-digits characters. +- `Atoi` returns `0` if the `string` is not considered as a valid number. For this exercise **non-valid `string` chains will be tested**. Some will contain non-digits characters. -- For this exercise the handling of the signs + or - **does have** to be taken into account. +- For this exercise the handling of the signs + or - **does have** to be taken into account. -- This function will **only** have to return the `int`. For this exercise the `error` result of atoi is not required. +- This function will **only** have to return the `int`. For this exercise the `error` result of atoi is not required. ### Expected function @@ -31,7 +31,7 @@ func Atoi(s string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/basicatoi.en.md b/subjects/basicatoi.en.md index a78aa6987..6fcca0fc3 100644 --- a/subjects/basicatoi.en.md +++ b/subjects/basicatoi.en.md @@ -2,13 +2,13 @@ ### Instructions -- Write a function that simulates the behaviour of the atoi function in Go. Atoi transforms a number defined as a `string` in a number defined as an `int`. +- Write a function that simulates the behaviour of the atoi function in Go. Atoi transforms a number defined as a `string` in a number defined as an `int`. -- Atoi returns `0` if the `string` is not considered as a valid number. For this exercise **only valid** `string` chains will be tested. They will only contain one or several digits as characters. +- Atoi returns `0` if the `string` is not considered as a valid number. For this exercise **only valid** `string` chains will be tested. They will only contain one or several digits as characters. -- For this exercise the handling of the signs `+` or `-` does not have to be taken into account. +- For this exercise the handling of the signs `+` or `-` does not have to be taken into account. -- This function will **only** have to return the `int`. For this exercise the `error` return of atoi is not required. +- This function will **only** have to return the `int`. For this exercise the `error` return of atoi is not required. ### Expected function @@ -20,7 +20,7 @@ func BasicAtoi(s string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/basicatoi.fr.md b/subjects/basicatoi.fr.md index 510cf1bed..66f731780 100644 --- a/subjects/basicatoi.fr.md +++ b/subjects/basicatoi.fr.md @@ -2,13 +2,13 @@ ### Instructions -- Écrire une fonction qui reproduit le comportement de la fonction atoi en Go. Atoi transforme un nombre représenté en `string` (chaîne de caractères) en `int` (entier). +- Écrire une fonction qui reproduit le comportement de la fonction atoi en Go. Atoi transforme un nombre représenté en `string` (chaîne de caractères) en `int` (entier). -- Atoi retourne `0` si la `string` n'est pas considéré un nombre valide. Pour cet exercice **seulement des** `string` **valides** seront testées. Elles ne contiendront que un ou plusieurs chiffres comme charact. +- Atoi retourne `0` si la `string` n'est pas considéré un nombre valide. Pour cet exercice **seulement des** `string` **valides** seront testées. Elles ne contiendront que un ou plusieurs chiffres comme charact. -- Pour cet exercice la gestion des signes `+` ou `-` ne doit pas être prise en compte. +- Pour cet exercice la gestion des signes `+` ou `-` ne doit pas être prise en compte. -- Cette fonction aura **seulement** à retourner l'`int` (entier). Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé. +- Cette fonction aura **seulement** à retourner l'`int` (entier). Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé. ### Fonction attendue @@ -20,28 +20,28 @@ func BasicAtoi(s string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - s := "12345" - s2 := "0000000012345" - s3 := "000000" + s := "12345" + s2 := "0000000012345" + s3 := "000000" - n := piscine.BasicAtoi(s) - n2 := piscine.BasicAtoi(s2) - n3 := piscine.BasicAtoi(s3) + n := piscine.BasicAtoi(s) + n2 := piscine.BasicAtoi(s2) + n3 := piscine.BasicAtoi(s3) - fmt.Println(n) - fmt.Println(n2) - fmt.Println(n3) + fmt.Println(n) + fmt.Println(n2) + fmt.Println(n3) } ``` diff --git a/subjects/basicatoi2.en.md b/subjects/basicatoi2.en.md index 347ea9fdb..78a812f5e 100644 --- a/subjects/basicatoi2.en.md +++ b/subjects/basicatoi2.en.md @@ -2,13 +2,13 @@ ### Instructions -- Write a function that simulates the behaviour of the atoi function in Go. Atoi transforms a number defined as a `string` in a number defined as an `int`. +- Write a function that simulates the behaviour of the atoi function in Go. Atoi transforms a number defined as a `string` in a number defined as an `int`. -- Atoi returns `0` if the `string` is not considered as a valid number. For this exercise **non-valid `string` chains will be tested**. Some will contain non-digits characters. +- Atoi returns `0` if the `string` is not considered as a valid number. For this exercise **non-valid `string` chains will be tested**. Some will contain non-digits characters. -- For this exercise the handling of the signs `+` or `-` does not have to be taken into account. +- For this exercise the handling of the signs `+` or `-` does not have to be taken into account. -- This function will **only** have to return the `int`. For this exercise the `error` return of atoi is not required. +- This function will **only** have to return the `int`. For this exercise the `error` return of atoi is not required. ### Expected function @@ -20,7 +20,7 @@ func BasicAtoi2(s string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/basicatoi2.fr.md b/subjects/basicatoi2.fr.md index 61246a18c..d3e546f07 100644 --- a/subjects/basicatoi2.fr.md +++ b/subjects/basicatoi2.fr.md @@ -2,13 +2,13 @@ ### Instructions -- Écrire une fonction qui reproduit le comportement de la fonction atoi en Go. Atoi transforme un nombre représenté en `string` (chaîne de caractères) en `int` (entier). +- Écrire une fonction qui reproduit le comportement de la fonction atoi en Go. Atoi transforme un nombre représenté en `string` (chaîne de caractères) en `int` (entier). -- Atoi retourne `0` si la `string` n'est pas considérée comme un nombre valide. Pour cet exercice des **`string` non valides seront testées!**. Certaines contiendront d'autres caractères que des chiffres. +- Atoi retourne `0` si la `string` n'est pas considérée comme un nombre valide. Pour cet exercice des **`string` non valides seront testées!**. Certaines contiendront d'autres caractères que des chiffres. -- Pour cet exercice la gestion des signes `+` ou `-` ne doit pas être prise en compte. +- Pour cet exercice la gestion des signes `+` ou `-` ne doit pas être prise en compte. -- Cette fonction aura **seulement** à retourner l'`int` (entier). Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé. +- Cette fonction aura **seulement** à retourner l'`int` (entier). Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé. ### Fonction attendue @@ -20,31 +20,31 @@ func BasicAtoi2(s string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - s := "12345" - s2 := "0000000012345" - s3 := "012 345" - s4 := "Hello World!" - - n := piscine.BasicAtoi2(s) - n2 := piscine.BasicAtoi2(s2) - n3 := piscine.BasicAtoi2(s3) - n4 := piscine.BasicAtoi2(s4) - - fmt.Println(n) - fmt.Println(n2) - fmt.Println(n3) - fmt.Println(n4) + s := "12345" + s2 := "0000000012345" + s3 := "012 345" + s4 := "Hello World!" + + n := piscine.BasicAtoi2(s) + n2 := piscine.BasicAtoi2(s2) + n3 := piscine.BasicAtoi2(s3) + n4 := piscine.BasicAtoi2(s4) + + fmt.Println(n) + fmt.Println(n2) + fmt.Println(n3) + fmt.Println(n4) } ``` diff --git a/subjects/basicjoin.en.md b/subjects/basicjoin.en.md index 869c538b1..f04104468 100644 --- a/subjects/basicjoin.en.md +++ b/subjects/basicjoin.en.md @@ -14,7 +14,7 @@ func BasicJoin(strs []string) string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/basicjoin.fr.md b/subjects/basicjoin.fr.md index a350c684a..4a4b1a65e 100644 --- a/subjects/basicjoin.fr.md +++ b/subjects/basicjoin.fr.md @@ -14,7 +14,7 @@ func BasicJoin(strs []string) string { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/boolean.en.md b/subjects/boolean.en.md index c83c28574..cff70f99d 100644 --- a/subjects/boolean.en.md +++ b/subjects/boolean.en.md @@ -4,11 +4,11 @@ Create a `.go` file. -- The code below has to be copied in that file. +- The code below has to be copied in that file. -- The necessary changes have to be applied so that the program works. +- The necessary changes have to be applied so that the program works. -- The program must be submitted inside a folder with the name `boolean`. +- The program must be submitted inside a folder with the name `boolean`. ### Code to be copied diff --git a/subjects/boolean.fr.md b/subjects/boolean.fr.md index 1d8573364..35314bf7c 100644 --- a/subjects/boolean.fr.md +++ b/subjects/boolean.fr.md @@ -4,11 +4,11 @@ Créer un fichier `.go`. -- Le code ci-dessous doit être copié dans ce fichier. +- Le code ci-dessous doit être copié dans ce fichier. -- Les changements nécéssaires doivent être appliqués pour que le programme fonctionne. +- Les changements nécéssaires doivent être appliqués pour que le programme fonctionne. -- Le programme doit être rendu dans un dossier nommé `boolean`. +- Le programme doit être rendu dans un dossier nommé `boolean`. ### Code à copier diff --git a/subjects/brainfuck.en.md b/subjects/brainfuck.en.md index 5cf1dd5e8..32cd78308 100644 --- a/subjects/brainfuck.en.md +++ b/subjects/brainfuck.en.md @@ -9,13 +9,13 @@ The code will always be valid, with less than 4096 operations. Every operator consists of a single character : -- '>' increment the pointer -- '<' decrement the pointer -- '+' increment the pointed byte -- '-' decrement the pointed byte -- '.' print the pointed byte on standard output -- '[' go to the matching ']' if the pointed byte is 0 (loop start) -- ']' go to the matching '[' if the pointed byte is not 0 (loop end) +- '>' increment the pointer +- '<' decrement the pointer +- '+' increment the pointed byte +- '-' decrement the pointed byte +- '.' print the pointed byte on standard output +- '[' go to the matching ']' if the pointed byte is 0 (loop start) +- ']' go to the matching '[' if the pointed byte is not 0 (loop end) Any other character is a comment. diff --git a/subjects/brainfuck.fr.md b/subjects/brainfuck.fr.md index 988cec7e8..32871e9ba 100644 --- a/subjects/brainfuck.fr.md +++ b/subjects/brainfuck.fr.md @@ -9,13 +9,13 @@ Le `Brainfuck` est un langage minimaliste. Il consiste en un slice de `byte` (oc Chaque opérateur consiste en un seul caractère : -- '>' incrémente le pointeur -- '<' décrémente le pointeur -- '+' incrémente le byte pointé -- '-' décrémente le byte pointé -- '.' affiche le byte pointé sur la sortie standard -- '[' se rend à son ']' correspondant si le byte pointé est 0 (début de la boucle) -- ']' se rend à son '[' correspondant si le byte pointé n'est pas 0 (fin de la boucle) +- '>' incrémente le pointeur +- '<' décrémente le pointeur +- '+' incrémente le byte pointé +- '-' décrémente le byte pointé +- '.' affiche le byte pointé sur la sortie standard +- '[' se rend à son ']' correspondant si le byte pointé est 0 (début de la boucle) +- ']' se rend à son '[' correspondant si le byte pointé n'est pas 0 (fin de la boucle) Tout autre caractère est un commentaire. diff --git a/subjects/btreeapplybylevel.en.md b/subjects/btreeapplybylevel.en.md index 7519b0b30..47e6216b2 100644 --- a/subjects/btreeapplybylevel.en.md +++ b/subjects/btreeapplybylevel.en.md @@ -14,7 +14,7 @@ func BTreeApplyByLevel(root *TreeNode, f func(...interface{}) (int, error)) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/btreeapplybylevel.fr.md b/subjects/btreeapplybylevel.fr.md index 49e7d1030..5fa5f6dc8 100644 --- a/subjects/btreeapplybylevel.fr.md +++ b/subjects/btreeapplybylevel.fr.md @@ -14,7 +14,7 @@ func BTreeApplyByLevel(root *TreeNode, fn interface{}) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/btreeapplyinorder.en.md b/subjects/btreeapplyinorder.en.md index debf4df75..e78f7ea15 100644 --- a/subjects/btreeapplyinorder.en.md +++ b/subjects/btreeapplyinorder.en.md @@ -14,14 +14,14 @@ func BTreeApplyInorder(root *TreeNode, f func(...interface{}) (int, error)) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { diff --git a/subjects/btreeapplyinorder.fr.md b/subjects/btreeapplyinorder.fr.md index 29e9042eb..2eba00758 100644 --- a/subjects/btreeapplyinorder.fr.md +++ b/subjects/btreeapplyinorder.fr.md @@ -14,14 +14,14 @@ func BTreeApplyInorder(root *TreeNode, f func(...interface{}) (int, error)) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { diff --git a/subjects/btreeapplypostorder.en.md b/subjects/btreeapplypostorder.en.md index 13f514a6d..b2b6c8adf 100644 --- a/subjects/btreeapplypostorder.en.md +++ b/subjects/btreeapplypostorder.en.md @@ -14,22 +14,22 @@ func BTreeApplyPostorder(root *TreeNode, f func(...interface{}) (int, error)) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - root := &piscine.TreeNode{Data: "4"} - piscine.BTreeInsertData(root, "1") - piscine.BTreeInsertData(root, "7") - piscine.BTreeInsertData(root, "5") - piscine.BTreeApplyPostorder(root, fmt.Println) + root := &piscine.TreeNode{Data: "4"} + piscine.BTreeInsertData(root, "1") + piscine.BTreeInsertData(root, "7") + piscine.BTreeInsertData(root, "5") + piscine.BTreeApplyPostorder(root, fmt.Println) } ``` diff --git a/subjects/btreeapplypostorder.fr.md b/subjects/btreeapplypostorder.fr.md index 297d87ce8..3d0a2dc23 100644 --- a/subjects/btreeapplypostorder.fr.md +++ b/subjects/btreeapplypostorder.fr.md @@ -14,14 +14,14 @@ func BTreeApplyPostorder(root *piscine.TreeNode, f func(...interface{}) (int, er ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine "." + "fmt" + piscine "." ) func main() { diff --git a/subjects/btreeapplypreorder.en.md b/subjects/btreeapplypreorder.en.md index 0f3383ab9..79518befd 100644 --- a/subjects/btreeapplypreorder.en.md +++ b/subjects/btreeapplypreorder.en.md @@ -14,7 +14,7 @@ func BTreeApplyPreorder(root *TreeNode, f func(...interface{}) (int, error)) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/btreeapplypreorder.fr.md b/subjects/btreeapplypreorder.fr.md index 55d3c02df..3b8e6373c 100644 --- a/subjects/btreeapplypreorder.fr.md +++ b/subjects/btreeapplypreorder.fr.md @@ -14,7 +14,7 @@ func BTreeApplyPreorder(root *TreeNode, f func(...interface{}) (int, error)) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/btreedeletenode.en.md b/subjects/btreedeletenode.en.md index 46389306c..2c90da5c8 100644 --- a/subjects/btreedeletenode.en.md +++ b/subjects/btreedeletenode.en.md @@ -16,7 +16,7 @@ func BTreeDeleteNode(root, node *TreeNode) *TreeNode { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/btreedeletenode.fr.md b/subjects/btreedeletenode.fr.md index 008bb0c99..91a8954c4 100644 --- a/subjects/btreedeletenode.fr.md +++ b/subjects/btreedeletenode.fr.md @@ -16,7 +16,7 @@ func BTreeDeleteNode(root, node *TreeNode) *TreeNode { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/btreeinsertdata.en.md b/subjects/btreeinsertdata.en.md index fd15db5d5..86738577c 100644 --- a/subjects/btreeinsertdata.en.md +++ b/subjects/btreeinsertdata.en.md @@ -10,8 +10,8 @@ The nodes must be defined as follows : ```go type TreeNode struct { - Left, Right, Parent *TreeNode - Data string + Left, Right, Parent *TreeNode + Data string } func BTreeInsertData(root *TreeNode, data string) *TreeNode { @@ -21,25 +21,25 @@ func BTreeInsertData(root *TreeNode, data string) *TreeNode { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - root := &piscine.TreeNode{Data: "4"} - piscine.BTreeInsertData(root, "1") - piscine.BTreeInsertData(root, "7") - piscine.BTreeInsertData(root, "5") - fmt.Println(root.Left.Data) - fmt.Println(root.Data) - fmt.Println(root.Right.Left.Data) - fmt.Println(root.Right.Data) + root := &piscine.TreeNode{Data: "4"} + piscine.BTreeInsertData(root, "1") + piscine.BTreeInsertData(root, "7") + piscine.BTreeInsertData(root, "5") + fmt.Println(root.Left.Data) + fmt.Println(root.Data) + fmt.Println(root.Right.Left.Data) + fmt.Println(root.Right.Data) } ``` diff --git a/subjects/btreeinsertdata.fr.md b/subjects/btreeinsertdata.fr.md index 865200e72..e24f7636d 100644 --- a/subjects/btreeinsertdata.fr.md +++ b/subjects/btreeinsertdata.fr.md @@ -10,8 +10,8 @@ Les nodes doivent être définies comme ci-dessous : ```go type TreeNode struct { - Left, Right, Parent *TreeNode - Data string + Left, Right, Parent *TreeNode + Data string } func BTreeInsertData(root *TreeNode, data string) *TreeNode { @@ -21,25 +21,25 @@ func BTreeInsertData(root *TreeNode, data string) *TreeNode { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - root := &piscine.TreeNode{Data: "4"} - piscine.BTreeInsertData(root, "1") - piscine.BTreeInsertData(root, "7") - piscine.BTreeInsertData(root, "5") - fmt.Println(root.Left.Data) - fmt.Println(root.Data) - fmt.Println(root.Right.Left.Data) - fmt.Println(root.Right.Data) + root := &piscine.TreeNode{Data: "4"} + piscine.BTreeInsertData(root, "1") + piscine.BTreeInsertData(root, "7") + piscine.BTreeInsertData(root, "5") + fmt.Println(root.Left.Data) + fmt.Println(root.Data) + fmt.Println(root.Right.Left.Data) + fmt.Println(root.Right.Data) } ``` diff --git a/subjects/btreeisbinary.en.md b/subjects/btreeisbinary.en.md index efa222f14..ca87f236f 100644 --- a/subjects/btreeisbinary.en.md +++ b/subjects/btreeisbinary.en.md @@ -14,7 +14,7 @@ func BTreeIsBinary(root *TreeNode) bool { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/btreeisbinary.fr.md b/subjects/btreeisbinary.fr.md index b24089599..26ad752a8 100644 --- a/subjects/btreeisbinary.fr.md +++ b/subjects/btreeisbinary.fr.md @@ -14,7 +14,7 @@ func BTreeIsBinary(root *TreeNode) bool { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/btreelevelcount.en.md b/subjects/btreelevelcount.en.md index 762ab299b..0d7c47d64 100644 --- a/subjects/btreelevelcount.en.md +++ b/subjects/btreelevelcount.en.md @@ -14,7 +14,7 @@ func BTreeLevelCount(root *TreeNode) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/btreelevelcount.fr.md b/subjects/btreelevelcount.fr.md index 4e3d0090f..20a18f922 100644 --- a/subjects/btreelevelcount.fr.md +++ b/subjects/btreelevelcount.fr.md @@ -14,7 +14,7 @@ func BTreeLevelCount(root *TreeNode) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/btreemax.en.md b/subjects/btreemax.en.md index e7f571755..230c5ac47 100644 --- a/subjects/btreemax.en.md +++ b/subjects/btreemax.en.md @@ -14,7 +14,7 @@ func BTreeMax(root *TreeNode) *TreeNode { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/btreemax.fr.md b/subjects/btreemax.fr.md index 5d59fba4c..60d22364e 100644 --- a/subjects/btreemax.fr.md +++ b/subjects/btreemax.fr.md @@ -14,7 +14,7 @@ func BTreeMax(root *TreeNode) *TreeNode { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/btreemin.en.md b/subjects/btreemin.en.md index 64826e842..13bf7a888 100644 --- a/subjects/btreemin.en.md +++ b/subjects/btreemin.en.md @@ -14,7 +14,7 @@ func BTreeMin(root *TreeNode) *TreeNode { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/btreemin.fr.md b/subjects/btreemin.fr.md index bd6dff01a..0161f1874 100644 --- a/subjects/btreemin.fr.md +++ b/subjects/btreemin.fr.md @@ -14,7 +14,7 @@ func BTreeMin(root *TreeNode) *TreeNode { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/btreeprintroot.en.md b/subjects/btreeprintroot.en.md index dd6892616..91872c95b 100644 --- a/subjects/btreeprintroot.en.md +++ b/subjects/btreeprintroot.en.md @@ -20,18 +20,18 @@ func PrintRoot(root *TreeNode){ ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main func main() { - //rootNode initialized with the value "who" - //rootNode1 initialized with the value "are" - //rootNode2 initialized with the value "you" - printRoot(rootNode) - printRoot(rootNode1) - printRoot(rootNode2) + //rootNode initialized with the value "who" + //rootNode1 initialized with the value "are" + //rootNode2 initialized with the value "you" + printRoot(rootNode) + printRoot(rootNode1) + printRoot(rootNode2) } ``` diff --git a/subjects/btreeprintroot.fr.md b/subjects/btreeprintroot.fr.md index 826a25969..1ab421203 100644 --- a/subjects/btreeprintroot.fr.md +++ b/subjects/btreeprintroot.fr.md @@ -9,8 +9,8 @@ Les nodes doivent être définies comme ci-dessous: ```go type TreeNode struct { - left, right *TreeNode - data string + left, right *TreeNode + data string } func PrintRoot(root *TreeNode){ @@ -20,18 +20,18 @@ func PrintRoot(root *TreeNode){ ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main func main() { - //rootNode initialized with the value "who" - //rootNode1 initialized with the value "are" - //rootNode2 initialized with the value "you" - printRoot(rootNode) - printRoot(rootNode1) - printRoot(rootNode2) + //rootNode initialized with the value "who" + //rootNode1 initialized with the value "are" + //rootNode2 initialized with the value "you" + printRoot(rootNode) + printRoot(rootNode1) + printRoot(rootNode2) } ``` diff --git a/subjects/btreesearchitem.en.md b/subjects/btreesearchitem.en.md index 445d63e9c..00d13efbd 100644 --- a/subjects/btreesearchitem.en.md +++ b/subjects/btreesearchitem.en.md @@ -14,7 +14,7 @@ func BTreeSearchItem(root *TreeNode, elem string) *TreeNode { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/btreesearchitem.fr.md b/subjects/btreesearchitem.fr.md index faf6c1051..9e0e97e3a 100644 --- a/subjects/btreesearchitem.fr.md +++ b/subjects/btreesearchitem.fr.md @@ -14,7 +14,7 @@ func BTreeSearchItem(root *TreeNode, elem string) *TreeNode { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/btreetransplant.en.md b/subjects/btreetransplant.en.md index ed15540be..4748db9dd 100644 --- a/subjects/btreetransplant.en.md +++ b/subjects/btreetransplant.en.md @@ -14,7 +14,7 @@ func BTreeTransplant(root, node, rplc *TreeNode) *TreeNode { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/btreetransplant.fr.md b/subjects/btreetransplant.fr.md index e12683238..c5a425d60 100644 --- a/subjects/btreetransplant.fr.md +++ b/subjects/btreetransplant.fr.md @@ -14,7 +14,7 @@ func BTreeTransplant(root, node, rplc *TreeNode) *TreeNode { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/capitalize.en.md b/subjects/capitalize.en.md index 8c32b148b..24482ce4c 100644 --- a/subjects/capitalize.en.md +++ b/subjects/capitalize.en.md @@ -16,7 +16,7 @@ func Capitalize(s string) string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/capitalize.fr.md b/subjects/capitalize.fr.md index a73e81a11..1cd67916b 100644 --- a/subjects/capitalize.fr.md +++ b/subjects/capitalize.fr.md @@ -16,7 +16,7 @@ func Capitalize(s string) string { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/capitalizeprog.en.md b/subjects/capitalizeprog.en.md index 49a87b711..0151c867d 100644 --- a/subjects/capitalizeprog.en.md +++ b/subjects/capitalizeprog.en.md @@ -4,11 +4,11 @@ Write a program that capitalizes the first letter of each word **and** lowercases the rest of each word of a `string`. -- A word is a sequence of **alphanumerical** characters. +- A word is a sequence of **alphanumerical** characters. -- If there is more than one argument the program should print `Too many arguments`. +- If there is more than one argument the program should print `Too many arguments`. -- If there is no arguments given the program should print a newline ("`\n`"). +- If there is no arguments given the program should print a newline ("`\n`"). ### Usage : diff --git a/subjects/capitalizeprog.fr.md b/subjects/capitalizeprog.fr.md index 521f39c1f..1ad465d5e 100644 --- a/subjects/capitalizeprog.fr.md +++ b/subjects/capitalizeprog.fr.md @@ -4,11 +4,11 @@ Écrire un programme qui met en majuscule la première lettre de chaque mot et en minuscule les autres lettres du reste du mot d'une `string`. -- Un mot est une suite de caractères **alphanumériques**. +- Un mot est une suite de caractères **alphanumériques**. -- Si il y a plus d'un argument le programme doit afficher `Too many arguments`. +- Si il y a plus d'un argument le programme doit afficher `Too many arguments`. -- Si il n'y a pas d'arguments le programme doit afficher un retour à la ligne (`'\n'`). +- Si il n'y a pas d'arguments le programme doit afficher un retour à la ligne (`'\n'`). ### Utilisation : diff --git a/subjects/cat.en.md b/subjects/cat.en.md index 6667d9a8b..bb9b18c1e 100644 --- a/subjects/cat.en.md +++ b/subjects/cat.en.md @@ -4,23 +4,23 @@ Write a program that has the same behaviour as the system's `cat` command-line. -- The `options` do not have to be handled. +- The `options` do not have to be handled. -- If the program is called without arguments it should take the `input` and print it back (as shown with the "Hello" example below). +- If the program is called without arguments it should take the `input` and print it back (as shown with the "Hello" example below). -- In the program folder create two files named `quest8.txt` and `quest8T.txt`. +- In the program folder create two files named `quest8.txt` and `quest8T.txt`. -- Copy to the `quest8.txt` file the following sentence : +- Copy to the `quest8.txt` file the following sentence : `"Programming is a skill best acquired by practice and example rather than from books" by Alan Turing` -- Copy to the `quest8T.txt` file the following sentence : +- Copy to the `quest8T.txt` file the following sentence : `"Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence."` -- In case of error the program should print the error. +- In case of error the program should print the error. -- The program must be submitted inside a folder named `cat`. +- The program must be submitted inside a folder named `cat`. ```console student@ubuntu:~/[[ROOT]]/cat$ go build diff --git a/subjects/cat.fr.md b/subjects/cat.fr.md index dba3f97c1..4629e309f 100644 --- a/subjects/cat.fr.md +++ b/subjects/cat.fr.md @@ -4,23 +4,23 @@ Écrire un programme qui a le même comportement que la ligne de commande `cat`. -- Les `options` ne doivent pas être gérés. +- Les `options` ne doivent pas être gérés. -- Si le programme est éxécuté sans arguments il doit prendre l'`input` et l'afficher. +- Si le programme est éxécuté sans arguments il doit prendre l'`input` et l'afficher. -- Dans le dossier du programme créer deux fichiers nommés `quest8.txt` et `quest8T.txt`. +- Dans le dossier du programme créer deux fichiers nommés `quest8.txt` et `quest8T.txt`. -- Copier dans le fichier `quest8.txt` la phrase suivante : +- Copier dans le fichier `quest8.txt` la phrase suivante : `"Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing` -- Copier dans le fichier `quest8T.txt` la phrase suivante : +- Copier dans le fichier `quest8T.txt` la phrase suivante : `"Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence."` -- En cas d'erreur le programme doit afficher l'erreur. +- En cas d'erreur le programme doit afficher l'erreur. -- Le programme doit être rendu dans un dossier nommé `cat`. +- Le programme doit être rendu dans un dossier nommé `cat`. ### Utilisation: diff --git a/subjects/changeorder.en.md b/subjects/changeorder.en.md index 0c56c5641..7f044ba07 100644 --- a/subjects/changeorder.en.md +++ b/subjects/changeorder.en.md @@ -24,8 +24,8 @@ You have to return pointer/reference to the beginning of new list package main type NodeAddL struct { - Next *NodeAddL - Num int + Next *NodeAddL + Num int } func Changeorder(node *NodeAddL) *NodeAddL { @@ -41,26 +41,26 @@ Here is a possible program to test your function: package main import ( - "fmt" + "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() + 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() } ``` diff --git a/subjects/cl-camp1.en.md b/subjects/cl-camp1.en.md index c03a15d2d..d559cec06 100644 --- a/subjects/cl-camp1.en.md +++ b/subjects/cl-camp1.en.md @@ -10,11 +10,11 @@ The instincts are coming back... Put in a file `mastertheLS` the command line that will: -- list the files and directories of the current directory. -- Ignore the hidden files, the "." and the "..". -- Separates the resuls with commas. -- Order them by ascending order of creation date. -- Have the directories ends with a `/`. +- list the files and directories of the current directory. +- Ignore the hidden files, the "." and the "..". +- Separates the resuls with commas. +- Order them by ascending order of creation date. +- Have the directories ends with a `/`. ### Hint diff --git a/subjects/cl-camp1.fr.md b/subjects/cl-camp1.fr.md index 6f63db485..8ffabc991 100644 --- a/subjects/cl-camp1.fr.md +++ b/subjects/cl-camp1.fr.md @@ -10,11 +10,11 @@ Les instincts resurgissent... Mettez dans un fichier `mastertheLS` la ligne de commande qui: -- listera les fichiers et dossiers dans le dossier courant. -- Ignorera les fichiers cachés, le "." et le "..". -- Separarera le resultat avec des virgules. -- Les triera pas ordre croissant de date de création. -- Placera un `/` en face des dossiers. +- listera les fichiers et dossiers dans le dossier courant. +- Ignorera les fichiers cachés, le "." et le "..". +- Separarera le resultat avec des virgules. +- Les triera pas ordre croissant de date de création. +- Placera un `/` en face des dossiers. ### Indice diff --git a/subjects/cl-camp3.en.md b/subjects/cl-camp3.en.md index 5372dcba5..9e6f12a24 100644 --- a/subjects/cl-camp3.en.md +++ b/subjects/cl-camp3.en.md @@ -6,9 +6,9 @@ Create a file `look`, which will look for and show, in the current directory and its sub-folders all the files : -- starting with an `a` or, -- all the files ending with a `z` or, -- all files starting with `z` and ending with `a!`. +- starting with an `a` or, +- all the files ending with a `z` or, +- all files starting with `z` and ending with `a!`. ### Hint diff --git a/subjects/cl-camp3.fr.md b/subjects/cl-camp3.fr.md index d96b147e6..558e16b61 100644 --- a/subjects/cl-camp3.fr.md +++ b/subjects/cl-camp3.fr.md @@ -6,9 +6,9 @@ Créer un fichier `look`, qui cherchera et montrera, dans le répertoire courant et ses sous-répertoires, tous les fichiers qui: -- commence avec `a` et, -- tous les fichiers qui se terminent avec `z` et, -- tous les fichiers qui commencent avec `z` et qui se finissent avec `a!`. +- commence avec `a` et, +- tous les fichiers qui se terminent avec `z` et, +- tous les fichiers qui commencent avec `z` et qui se finissent avec `a!`. ### Indice diff --git a/subjects/cl-camp4.en.md b/subjects/cl-camp4.en.md index 7ebb9bb4a..7033b3104 100644 --- a/subjects/cl-camp4.en.md +++ b/subjects/cl-camp4.en.md @@ -6,13 +6,13 @@ Create a file `myfamily.sh`, which will show a subject's family (key: relatives). -- The quotes have to be removed. +- The quotes have to be removed. -- The subject will be decided depending on his ID which will be contained in the environment variable HERO_ID. +- The subject will be decided depending on his ID which will be contained in the environment variable HERO_ID. -* Where to look : https://[[DOMAIN]]/assets/superhero/all.json +* Where to look : https://[[DOMAIN]]/assets/superhero/all.json -* What to use : curl, jq and others... +* What to use : curl, jq and others... ### Usage diff --git a/subjects/cl-camp4.fr.md b/subjects/cl-camp4.fr.md index b9a6d09e7..0b2305f6a 100644 --- a/subjects/cl-camp4.fr.md +++ b/subjects/cl-camp4.fr.md @@ -6,13 +6,13 @@ Créer un fichier `myfamily.sh`, qui affichera la famille d'un individu (clef: relatives). -- Les guillemets doivent être enlevés. +- Les guillemets doivent être enlevés. -- L'individu sera choisi en fonction de son ID qui sera contenu dans la variable d'environment HERO_ID. +- L'individu sera choisi en fonction de son ID qui sera contenu dans la variable d'environment HERO_ID. -* Où chercher : https://[[DOMAIN]]/assets/superhero/all.json +* Où chercher : https://[[DOMAIN]]/assets/superhero/all.json -* Quoi utiliser : `curl`, `jq` et d'autres... +* Quoi utiliser : `curl`, `jq` et d'autres... ### Utilisation diff --git a/subjects/cl-camp5.en.md b/subjects/cl-camp5.en.md index 7b68ade9f..37210ce32 100644 --- a/subjects/cl-camp5.en.md +++ b/subjects/cl-camp5.en.md @@ -6,7 +6,7 @@ Create a file `lookagain.sh`, which will look for, from the current directory and its sub-folders all the files: -- all the files ending with `.sh`. +- all the files ending with `.sh`. That command will only show the name of the files without the `.sh`. diff --git a/subjects/cl-camp5.fr.md b/subjects/cl-camp5.fr.md index ec919d710..10595ab79 100644 --- a/subjects/cl-camp5.fr.md +++ b/subjects/cl-camp5.fr.md @@ -6,7 +6,7 @@ Créer un fichier `lookagain.sh`, qui cherchera et montrera, dans le répertoire courant et ses sous-répertoires, tous les fichiers qui: -- qui finissent avec `.sh`. +- qui finissent avec `.sh`. Cette commande montrera le nom des fichiers sans le`.sh`. diff --git a/subjects/cl.en.md b/subjects/cl.en.md index 2aea2c97c..ef81d4901 100644 --- a/subjects/cl.en.md +++ b/subjects/cl.en.md @@ -10,11 +10,11 @@ The instincts are coming back... Put in a file `mastertheLS` the command line that will: -- list the files and folders of the current folder. -- Ignore the hidden files, the "." and the "..". -- Separates the resuls with commas. -- Order them by ascending order of creation date. -- Have the folders have a `/` in front of them. +- list the files and folders of the current folder. +- Ignore the hidden files, the "." and the "..". +- Separates the results with commas. +- Order them by ascending order of creation date. +- Have the folders have a `/` in front of them. ### Hint diff --git a/subjects/cl.fr.md b/subjects/cl.fr.md index 2aea2c97c..ef81d4901 100644 --- a/subjects/cl.fr.md +++ b/subjects/cl.fr.md @@ -10,11 +10,11 @@ The instincts are coming back... Put in a file `mastertheLS` the command line that will: -- list the files and folders of the current folder. -- Ignore the hidden files, the "." and the "..". -- Separates the resuls with commas. -- Order them by ascending order of creation date. -- Have the folders have a `/` in front of them. +- list the files and folders of the current folder. +- Ignore the hidden files, the "." and the "..". +- Separates the results with commas. +- Order them by ascending order of creation date. +- Have the folders have a `/` in front of them. ### Hint diff --git a/subjects/cleanstr.en.md b/subjects/cleanstr.en.md index 418ca119b..1cf0283db 100644 --- a/subjects/cleanstr.en.md +++ b/subjects/cleanstr.en.md @@ -3,6 +3,7 @@ ### Instructions Write a **program** that takes a `string`, and displays this `string` with exactly: + - one space between words. - without spaces nor tabs at the beginning nor at the end. - with the result followed by a newline ("`\n`"). diff --git a/subjects/cleanstr.fr.md b/subjects/cleanstr.fr.md index a55ac162f..5f7c17f8b 100644 --- a/subjects/cleanstr.fr.md +++ b/subjects/cleanstr.fr.md @@ -3,6 +3,7 @@ ### Instructions Écrire un programme qui prend une `string`, et qui affiche cette `string` avec exactement: + - un espace entre les mots. - aucun espace ni de tabulation ni au début ni à la fin. - le résultat avecsuivi d'un saut de ligne("`\n`"). diff --git a/subjects/collatzcountdown.en.md b/subjects/collatzcountdown.en.md index 6c0581f1a..e6759c810 100644 --- a/subjects/collatzcountdown.en.md +++ b/subjects/collatzcountdown.en.md @@ -4,7 +4,7 @@ Write a function, `CollatzCountdown`, that returns the number of steps necessary to reach 1 using the collatz countdown. -- It must return `-1` if `start` is equal to `0` or negative. +- It must return `-1` if `start` is equal to `0` or negative. ### Expected function @@ -16,7 +16,7 @@ func CollatzCountdown(start int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/collatzcountdown.fr.md b/subjects/collatzcountdown.fr.md index 1650ff29e..d6baaa0a2 100644 --- a/subjects/collatzcountdown.fr.md +++ b/subjects/collatzcountdown.fr.md @@ -16,7 +16,7 @@ func CollatzCountdown(start int) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/comcheck.en.md b/subjects/comcheck.en.md index fb7472f1d..19d14407d 100644 --- a/subjects/comcheck.en.md +++ b/subjects/comcheck.en.md @@ -4,9 +4,9 @@ Write a program `comcheck` that displays on the standard output `Alert!!!` followed by newline (`'\n'`) if at least one of the arguments passed in parameter matches the `string`: -- `01`, `galaxy` or `galaxy 01`. +- `01`, `galaxy` or `galaxy 01`. -- If none of the parameters match, the program displays a nothing. +- If none of the parameters match, the program displays a nothing. ### Usage diff --git a/subjects/comcheck.fr.md b/subjects/comcheck.fr.md index d2a24d0dc..d03524915 100644 --- a/subjects/comcheck.fr.md +++ b/subjects/comcheck.fr.md @@ -4,9 +4,9 @@ écrire un programme `comcheck` qui affiche sur la sortie standard `Alert!!!` suivi d'un retour à la ligne (`'\n'`) si au moins un des arguments passé ne paramètre correspond aux `string`: -- `01`, `galaxy` ou `galaxy 01`. +- `01`, `galaxy` ou `galaxy 01`. -- si aucun des paramètres correspond, le programme affiche rien. +- si aucun des paramètres correspond, le programme affiche rien. ### Usage diff --git a/subjects/commandments.en.md b/subjects/commandments.en.md index 9081d208c..e2fe4082c 100644 --- a/subjects/commandments.en.md +++ b/subjects/commandments.en.md @@ -16,89 +16,89 @@ A few basic principles to follow ### The Commandements _(read them)_ -- Le numérique est ta passion. +- Le numérique est ta passion. -- Ton objectif à 42 : développer ton talent et tes compétences pour le marché du numérique. +- Ton objectif à 42 : développer ton talent et tes compétences pour le marché du numérique. -- L’objectif de 42 pour toi : te faire accéder au marché de l’emploi, à une longue et pérenne carrière dans le numérique, et te faire progresser socialement. +- L’objectif de 42 pour toi : te faire accéder au marché de l’emploi, à une longue et pérenne carrière dans le numérique, et te faire progresser socialement. -- L’ambition de 42 pour toi : être un pionnier du numérique de demain. +- L’ambition de 42 pour toi : être un pionnier du numérique de demain. -- Il est de ta responsabilité de gérer ta progression : 42 te propose un parcours individualisé adapté à ton rythme. +- Il est de ta responsabilité de gérer ta progression : 42 te propose un parcours individualisé adapté à ton rythme. -- Des challenges jalonnent ton parcours. 42 ne fournira aucun élément de solution. C’est ton rôle de chercher et trouver par toi-même ces solutions pour atteindre l’objectif. +- Des challenges jalonnent ton parcours. 42 ne fournira aucun élément de solution. C’est ton rôle de chercher et trouver par toi-même ces solutions pour atteindre l’objectif. -- Sois actif. N’attend pas que les choses se fassent pour toi. 42 est un parcours 100% pratique. +- Sois actif. N’attend pas que les choses se fassent pour toi. 42 est un parcours 100% pratique. -- Sois autonome dans ton cursus. N’attend pas que l’on te dise quoi faire. +- Sois autonome dans ton cursus. N’attend pas que l’on te dise quoi faire. -- Sois collaboratif, autant sur les projets solos que les projets de groupe. Face aux challenges à resoudre, l’échange et le debat sont tes meilleures armes. +- Sois collaboratif, autant sur les projets solos que les projets de groupe. Face aux challenges à resoudre, l’échange et le debat sont tes meilleures armes. -- Ne "crois" pas. Sois sûr. Techniquement, relationnelement, organisationellement, administrativement. +- Ne "crois" pas. Sois sûr. Techniquement, relationnelement, organisationellement, administrativement. -- Pour être sûr, teste, contrôle. +- Pour être sûr, teste, contrôle. -- N’ai pas peur de te tromper, d’échouer. L’échec est une étape normale vers le succès. +- N’ai pas peur de te tromper, d’échouer. L’échec est une étape normale vers le succès. -- Teste à nouveau. Collabore davantage pour tester davantage. +- Teste à nouveau. Collabore davantage pour tester davantage. -- Ose. Le risque est de se tromper. Voir le commandement 12. +- Ose. Le risque est de se tromper. Voir le commandement 12. -- Sois rigoureux dans ton travail. +- Sois rigoureux dans ton travail. -- Sois investi dans ton cursus : 50 heures par semaine est un minimum. Ta capacité de travail est une valeur. L’école est ouverte 24h/24 et 7j/7. +- Sois investi dans ton cursus : 50 heures par semaine est un minimum. Ta capacité de travail est une valeur. L’école est ouverte 24h/24 et 7j/7. -- Sois régulier dans ton travail. Un jour oui, un jour non, un coup nocturne, un coup diurne... le chaos t’empêche d’avancer. +- Sois régulier dans ton travail. Un jour oui, un jour non, un coup nocturne, un coup diurne... le chaos t’empêche d’avancer. -- Prévois un groupe de travail large et hétérogène pour y trouver facilement des idées neuves et des groupes de projet. +- Prévois un groupe de travail large et hétérogène pour y trouver facilement des idées neuves et des groupes de projet. -- Pour tes collaborations et ton travail en groupe, privilégie des étudiants qui n’ont pas déjà la solution au problème. +- Pour tes collaborations et ton travail en groupe, privilégie des étudiants qui n’ont pas déjà la solution au problème. -- Sois investi dans ton groupe de projet, et ne le laisse pas faire ton travail à ta place. +- Sois investi dans ton groupe de projet, et ne le laisse pas faire ton travail à ta place. -- Ton groupe de projet est solidaire, son succès comme son échec est de la responsabilité de tous, et les conflits se règlent en interne. +- Ton groupe de projet est solidaire, son succès comme son échec est de la responsabilité de tous, et les conflits se règlent en interne. -- Travaille à l’école. Faire du peer-learning, collaborer, cela demande d’être physiquement avec les autres. A distance cela ne fonctionne pas. +- Travaille à l’école. Faire du peer-learning, collaborer, cela demande d’être physiquement avec les autres. A distance cela ne fonctionne pas. -- Implique toi dans les évaluations de tes projets. Elles te permettent de prendre du recul. +- Implique toi dans les évaluations de tes projets. Elles te permettent de prendre du recul. -- Implique toi dans tes évaluations des projets des autres. La qualité de la communauté en dépend. +- Implique toi dans tes évaluations des projets des autres. La qualité de la communauté en dépend. -- Sois juste et teste rigoureusement tes projets comme ceux des autres en évaluation avec tes propres jeux de tests. +- Sois juste et teste rigoureusement tes projets comme ceux des autres en évaluation avec tes propres jeux de tests. -- Joue pleinement le jeu de ta scolarité dans l’état d’esprit demandé, fait tous les exercices et projets demandés. +- Joue pleinement le jeu de ta scolarité dans l’état d’esprit demandé, fait tous les exercices et projets demandés. -- Ne cherche pas des biais et des failles dans le système. Tu vas fausser ta propre formation et ta valeur sur le marché. +- Ne cherche pas des biais et des failles dans le système. Tu vas fausser ta propre formation et ta valeur sur le marché. -- Ne triche pas intentionellement. C’est amoral, cela contredit le commandement 12, et c’est du temps inutilement passé à ne pas développer tes compétences pour faire croire aux autres que tu sais coder alors que ce n’est pas le cas. +- Ne triche pas intentionellement. C’est amoral, cela contredit le commandement 12, et c’est du temps inutilement passé à ne pas développer tes compétences pour faire croire aux autres que tu sais coder alors que ce n’est pas le cas. -- Ne rends pas un projet que tu ne serais pas capable de reproduire seul à huis clos. Même si c’est parfois involontaire, c’est aussi de la triche. +- Ne rends pas un projet que tu ne serais pas capable de reproduire seul à huis clos. Même si c’est parfois involontaire, c’est aussi de la triche. -- C’est pas pour tes parents que tu travailles, ni pour le staff. C’est pour toi. +- C’est pas pour tes parents que tu travailles, ni pour le staff. C’est pour toi. -- Participe à la vie de la communauté, à son épanouissement, et sa qualité en sortie de formation. +- Participe à la vie de la communauté, à son épanouissement, et sa qualité en sortie de formation. -- Aide au respect de ces commandements par la communauté. +- Aide au respect de ces commandements par la communauté. -- Sois bienveillant et empathique vis à vis de tes camarades comme des personnes avec qui tu interagis, échanges, débats. +- Sois bienveillant et empathique vis à vis de tes camarades comme des personnes avec qui tu interagis, échanges, débats. -- N’ai pas peur du monde professionnel. +- N’ai pas peur du monde professionnel. -- Respecte le matériel. Des consignes spécifiques sont données en ce sens. +- Respecte le matériel. Des consignes spécifiques sont données en ce sens. -- Respecte les locaux. Des consignes spécifiques sont données en ce sens. +- Respecte les locaux. Des consignes spécifiques sont données en ce sens. -- Respecte les gens, étudiants, staffs, partenaires, visiteurs. +- Respecte les gens, étudiants, staffs, partenaires, visiteurs. -- Respecte la loi en vigueur dans le pays. +- Respecte la loi en vigueur dans le pays. -- Respecte les lois et consignes en vigueur liées à la consommation d’alcool. +- Respecte les lois et consignes en vigueur liées à la consommation d’alcool. -- Respecte les lois et consignes en vigueur liées à la consommation de tabac, stupéfiants, ou produits assimilés. +- Respecte les lois et consignes en vigueur liées à la consommation de tabac, stupéfiants, ou produits assimilés. -- N’hésite pas à interagir avec le staff, pour parler de tes problèmes, pour remonter des problèmes dans le cursus, pour contribuer au cursus. +- N’hésite pas à interagir avec le staff, pour parler de tes problèmes, pour remonter des problèmes dans le cursus, pour contribuer au cursus. -- Si tu t’interroges ou ne comprends pas nos choix pédagogiques, demande nous. On ne fait généralement rien au hasard. +- Si tu t’interroges ou ne comprends pas nos choix pédagogiques, demande nous. On ne fait généralement rien au hasard. ### Required diff --git a/subjects/commandments.fr.md b/subjects/commandments.fr.md index 9081d208c..e2fe4082c 100644 --- a/subjects/commandments.fr.md +++ b/subjects/commandments.fr.md @@ -16,89 +16,89 @@ A few basic principles to follow ### The Commandements _(read them)_ -- Le numérique est ta passion. +- Le numérique est ta passion. -- Ton objectif à 42 : développer ton talent et tes compétences pour le marché du numérique. +- Ton objectif à 42 : développer ton talent et tes compétences pour le marché du numérique. -- L’objectif de 42 pour toi : te faire accéder au marché de l’emploi, à une longue et pérenne carrière dans le numérique, et te faire progresser socialement. +- L’objectif de 42 pour toi : te faire accéder au marché de l’emploi, à une longue et pérenne carrière dans le numérique, et te faire progresser socialement. -- L’ambition de 42 pour toi : être un pionnier du numérique de demain. +- L’ambition de 42 pour toi : être un pionnier du numérique de demain. -- Il est de ta responsabilité de gérer ta progression : 42 te propose un parcours individualisé adapté à ton rythme. +- Il est de ta responsabilité de gérer ta progression : 42 te propose un parcours individualisé adapté à ton rythme. -- Des challenges jalonnent ton parcours. 42 ne fournira aucun élément de solution. C’est ton rôle de chercher et trouver par toi-même ces solutions pour atteindre l’objectif. +- Des challenges jalonnent ton parcours. 42 ne fournira aucun élément de solution. C’est ton rôle de chercher et trouver par toi-même ces solutions pour atteindre l’objectif. -- Sois actif. N’attend pas que les choses se fassent pour toi. 42 est un parcours 100% pratique. +- Sois actif. N’attend pas que les choses se fassent pour toi. 42 est un parcours 100% pratique. -- Sois autonome dans ton cursus. N’attend pas que l’on te dise quoi faire. +- Sois autonome dans ton cursus. N’attend pas que l’on te dise quoi faire. -- Sois collaboratif, autant sur les projets solos que les projets de groupe. Face aux challenges à resoudre, l’échange et le debat sont tes meilleures armes. +- Sois collaboratif, autant sur les projets solos que les projets de groupe. Face aux challenges à resoudre, l’échange et le debat sont tes meilleures armes. -- Ne "crois" pas. Sois sûr. Techniquement, relationnelement, organisationellement, administrativement. +- Ne "crois" pas. Sois sûr. Techniquement, relationnelement, organisationellement, administrativement. -- Pour être sûr, teste, contrôle. +- Pour être sûr, teste, contrôle. -- N’ai pas peur de te tromper, d’échouer. L’échec est une étape normale vers le succès. +- N’ai pas peur de te tromper, d’échouer. L’échec est une étape normale vers le succès. -- Teste à nouveau. Collabore davantage pour tester davantage. +- Teste à nouveau. Collabore davantage pour tester davantage. -- Ose. Le risque est de se tromper. Voir le commandement 12. +- Ose. Le risque est de se tromper. Voir le commandement 12. -- Sois rigoureux dans ton travail. +- Sois rigoureux dans ton travail. -- Sois investi dans ton cursus : 50 heures par semaine est un minimum. Ta capacité de travail est une valeur. L’école est ouverte 24h/24 et 7j/7. +- Sois investi dans ton cursus : 50 heures par semaine est un minimum. Ta capacité de travail est une valeur. L’école est ouverte 24h/24 et 7j/7. -- Sois régulier dans ton travail. Un jour oui, un jour non, un coup nocturne, un coup diurne... le chaos t’empêche d’avancer. +- Sois régulier dans ton travail. Un jour oui, un jour non, un coup nocturne, un coup diurne... le chaos t’empêche d’avancer. -- Prévois un groupe de travail large et hétérogène pour y trouver facilement des idées neuves et des groupes de projet. +- Prévois un groupe de travail large et hétérogène pour y trouver facilement des idées neuves et des groupes de projet. -- Pour tes collaborations et ton travail en groupe, privilégie des étudiants qui n’ont pas déjà la solution au problème. +- Pour tes collaborations et ton travail en groupe, privilégie des étudiants qui n’ont pas déjà la solution au problème. -- Sois investi dans ton groupe de projet, et ne le laisse pas faire ton travail à ta place. +- Sois investi dans ton groupe de projet, et ne le laisse pas faire ton travail à ta place. -- Ton groupe de projet est solidaire, son succès comme son échec est de la responsabilité de tous, et les conflits se règlent en interne. +- Ton groupe de projet est solidaire, son succès comme son échec est de la responsabilité de tous, et les conflits se règlent en interne. -- Travaille à l’école. Faire du peer-learning, collaborer, cela demande d’être physiquement avec les autres. A distance cela ne fonctionne pas. +- Travaille à l’école. Faire du peer-learning, collaborer, cela demande d’être physiquement avec les autres. A distance cela ne fonctionne pas. -- Implique toi dans les évaluations de tes projets. Elles te permettent de prendre du recul. +- Implique toi dans les évaluations de tes projets. Elles te permettent de prendre du recul. -- Implique toi dans tes évaluations des projets des autres. La qualité de la communauté en dépend. +- Implique toi dans tes évaluations des projets des autres. La qualité de la communauté en dépend. -- Sois juste et teste rigoureusement tes projets comme ceux des autres en évaluation avec tes propres jeux de tests. +- Sois juste et teste rigoureusement tes projets comme ceux des autres en évaluation avec tes propres jeux de tests. -- Joue pleinement le jeu de ta scolarité dans l’état d’esprit demandé, fait tous les exercices et projets demandés. +- Joue pleinement le jeu de ta scolarité dans l’état d’esprit demandé, fait tous les exercices et projets demandés. -- Ne cherche pas des biais et des failles dans le système. Tu vas fausser ta propre formation et ta valeur sur le marché. +- Ne cherche pas des biais et des failles dans le système. Tu vas fausser ta propre formation et ta valeur sur le marché. -- Ne triche pas intentionellement. C’est amoral, cela contredit le commandement 12, et c’est du temps inutilement passé à ne pas développer tes compétences pour faire croire aux autres que tu sais coder alors que ce n’est pas le cas. +- Ne triche pas intentionellement. C’est amoral, cela contredit le commandement 12, et c’est du temps inutilement passé à ne pas développer tes compétences pour faire croire aux autres que tu sais coder alors que ce n’est pas le cas. -- Ne rends pas un projet que tu ne serais pas capable de reproduire seul à huis clos. Même si c’est parfois involontaire, c’est aussi de la triche. +- Ne rends pas un projet que tu ne serais pas capable de reproduire seul à huis clos. Même si c’est parfois involontaire, c’est aussi de la triche. -- C’est pas pour tes parents que tu travailles, ni pour le staff. C’est pour toi. +- C’est pas pour tes parents que tu travailles, ni pour le staff. C’est pour toi. -- Participe à la vie de la communauté, à son épanouissement, et sa qualité en sortie de formation. +- Participe à la vie de la communauté, à son épanouissement, et sa qualité en sortie de formation. -- Aide au respect de ces commandements par la communauté. +- Aide au respect de ces commandements par la communauté. -- Sois bienveillant et empathique vis à vis de tes camarades comme des personnes avec qui tu interagis, échanges, débats. +- Sois bienveillant et empathique vis à vis de tes camarades comme des personnes avec qui tu interagis, échanges, débats. -- N’ai pas peur du monde professionnel. +- N’ai pas peur du monde professionnel. -- Respecte le matériel. Des consignes spécifiques sont données en ce sens. +- Respecte le matériel. Des consignes spécifiques sont données en ce sens. -- Respecte les locaux. Des consignes spécifiques sont données en ce sens. +- Respecte les locaux. Des consignes spécifiques sont données en ce sens. -- Respecte les gens, étudiants, staffs, partenaires, visiteurs. +- Respecte les gens, étudiants, staffs, partenaires, visiteurs. -- Respecte la loi en vigueur dans le pays. +- Respecte la loi en vigueur dans le pays. -- Respecte les lois et consignes en vigueur liées à la consommation d’alcool. +- Respecte les lois et consignes en vigueur liées à la consommation d’alcool. -- Respecte les lois et consignes en vigueur liées à la consommation de tabac, stupéfiants, ou produits assimilés. +- Respecte les lois et consignes en vigueur liées à la consommation de tabac, stupéfiants, ou produits assimilés. -- N’hésite pas à interagir avec le staff, pour parler de tes problèmes, pour remonter des problèmes dans le cursus, pour contribuer au cursus. +- N’hésite pas à interagir avec le staff, pour parler de tes problèmes, pour remonter des problèmes dans le cursus, pour contribuer au cursus. -- Si tu t’interroges ou ne comprends pas nos choix pédagogiques, demande nous. On ne fait généralement rien au hasard. +- Si tu t’interroges ou ne comprends pas nos choix pédagogiques, demande nous. On ne fait généralement rien au hasard. ### Required diff --git a/subjects/compact.en.md b/subjects/compact.en.md index 1ba211318..51b4527ed 100644 --- a/subjects/compact.en.md +++ b/subjects/compact.en.md @@ -5,9 +5,9 @@ Write a function `Compact` that takes a pointer to a slice of strings as the argument. This function must: -- Return the number of elements with non-`nil`. +- Return the number of elements with non-`nil`. -- Compact, i.e., delete the elements with `nil` in the slice. +- Compact, i.e., delete the elements with `nil` in the slice. ### Expected functions @@ -19,15 +19,15 @@ func Compact(ptr *[]string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( - "fmt" + "fmt" - piscine ".." + piscine ".." ) const N = 6 diff --git a/subjects/compact.fr.md b/subjects/compact.fr.md index 9a1e4a5d0..16b094d90 100644 --- a/subjects/compact.fr.md +++ b/subjects/compact.fr.md @@ -19,15 +19,15 @@ func Compact(ptr *[]string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" + "fmt" - piscine ".." + piscine ".." ) const N = 6 diff --git a/subjects/compare.en.md b/subjects/compare.en.md index 9a543e0cf..d1bb0ea11 100644 --- a/subjects/compare.en.md +++ b/subjects/compare.en.md @@ -14,7 +14,7 @@ func Compare(a, b string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/compare.fr.md b/subjects/compare.fr.md index 8805720d0..67f08cab8 100644 --- a/subjects/compare.fr.md +++ b/subjects/compare.fr.md @@ -14,7 +14,7 @@ func Compare(a, b string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/concat.en.md b/subjects/concat.en.md index eff5227d4..7e0c1a04b 100644 --- a/subjects/concat.en.md +++ b/subjects/concat.en.md @@ -14,7 +14,7 @@ func Concat(str1 string, str2 string) string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/concat.fr.md b/subjects/concat.fr.md index c8720d77d..948ef1de3 100644 --- a/subjects/concat.fr.md +++ b/subjects/concat.fr.md @@ -14,7 +14,7 @@ func Concat(str1 string, str2 string) string { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/concatparams.en.md b/subjects/concatparams.en.md index 18289c174..62f287328 100644 --- a/subjects/concatparams.en.md +++ b/subjects/concatparams.en.md @@ -16,7 +16,7 @@ func ConcatParams(args []string) string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/concatparams.fr.md b/subjects/concatparams.fr.md index 1cd22cd69..01cfb0743 100644 --- a/subjects/concatparams.fr.md +++ b/subjects/concatparams.fr.md @@ -16,7 +16,7 @@ func ConcatParams(args []string) string { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/convertbase.en.md b/subjects/convertbase.en.md index 8e29bc79e..5ef8ef577 100644 --- a/subjects/convertbase.en.md +++ b/subjects/convertbase.en.md @@ -18,7 +18,7 @@ func ConvertBase(nbr, baseFrom, baseTo string) string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/convertbase.fr.md b/subjects/convertbase.fr.md index 4f7050889..545abdf84 100644 --- a/subjects/convertbase.fr.md +++ b/subjects/convertbase.fr.md @@ -18,7 +18,7 @@ func ConvertBase(nbr, baseFrom, baseTo string) string { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/countif.en.md b/subjects/countif.en.md index 576a3d2fe..05e84754c 100644 --- a/subjects/countif.en.md +++ b/subjects/countif.en.md @@ -14,7 +14,7 @@ func CountIf(f func(string) bool, tab []string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/countif.fr.md b/subjects/countif.fr.md index 92d3d3b9e..591e99bfe 100644 --- a/subjects/countif.fr.md +++ b/subjects/countif.fr.md @@ -14,7 +14,7 @@ func CountIf(f func(string) bool, tab []string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/createelem.en.md b/subjects/createelem.en.md index dcb80f1d9..13bae7444 100644 --- a/subjects/createelem.en.md +++ b/subjects/createelem.en.md @@ -18,7 +18,7 @@ func CreateElem(n *Node, value int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/createelem.fr.md b/subjects/createelem.fr.md index ddfaa30ae..efae0c952 100644 --- a/subjects/createelem.fr.md +++ b/subjects/createelem.fr.md @@ -18,7 +18,7 @@ func CreateElem(n *Node, value int) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/displayfile.en.md b/subjects/displayfile.en.md index e13028467..ceff04405 100644 --- a/subjects/displayfile.en.md +++ b/subjects/displayfile.en.md @@ -4,13 +4,13 @@ Write a program that displays, on the standard output, the content of a file given as argument. -- Create a file `quest8.txt` and write into it the sentence `Almost there!!` +- Create a file `quest8.txt` and write into it the sentence `Almost there!!` -- The argument of the program in this case should be, `quest8.txt`. +- The argument of the program in this case should be, `quest8.txt`. -- In case of error the program should print one the below messages accordingly: - - `File name missing`. - - `Too many arguments`. +- In case of error the program should print one the below messages accordingly: + - `File name missing`. + - `Too many arguments`. ### Usage : diff --git a/subjects/displayfile.fr.md b/subjects/displayfile.fr.md index c98641e60..3460b5662 100644 --- a/subjects/displayfile.fr.md +++ b/subjects/displayfile.fr.md @@ -4,15 +4,15 @@ Écrire un programme qui affiche, sur la sortie standard, le contenu d'un fichier donné en argument. -- Créer un fichier `quest8.txt` et écrire dedans la phrase `Almost there!!` +- Créer un fichier `quest8.txt` et écrire dedans la phrase `Almost there!!` -- L'argument pour ce programme sera, dans ce cas, `quest8.txt`. +- L'argument pour ce programme sera, dans ce cas, `quest8.txt`. -- En cas d'erreur le programme doit afficher un des deux messages suivants de manière approprié: - - `File name missing`. - - `Too many arguments`. +- En cas d'erreur le programme doit afficher un des deux messages suivants de manière approprié: + - `File name missing`. + - `Too many arguments`. -### Utilisation: +### Utilisation : ```console student@ubuntu:~/[[ROOT]]/test$ go build diff --git a/subjects/divmod.en.md b/subjects/divmod.en.md index 06714df3b..fbebb9305 100644 --- a/subjects/divmod.en.md +++ b/subjects/divmod.en.md @@ -12,20 +12,20 @@ func DivMod(a int, b int, div *int, mod *int) { } ``` -- This function will divide the int **a** and **b**. -- The result of this division will be stored in the int pointed by **div**. -- The remainder of this division will be stored in the int pointed by **mod**. +- This function will divide the int **a** and **b**. +- The result of this division will be stored in the int pointed by **div**. +- The remainder of this division will be stored in the int pointed by **mod**. ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { diff --git a/subjects/divmod.fr.md b/subjects/divmod.fr.md index 5f586d30e..125db71cc 100644 --- a/subjects/divmod.fr.md +++ b/subjects/divmod.fr.md @@ -12,20 +12,20 @@ func DivMod(a int, b int, div *int, mod *int) { } ``` -- Cette fonction divisera les int **a** et **b**. -- Le résultat de la division sera stocké dans l'int pointé par **div**. -- Le reste de cette division sera stocké dans l'int pointé par **mod**. +- Cette fonction divisera les int **a** et **b**. +- Le résultat de la division sera stocké dans l'int pointé par **div**. +- Le reste de cette division sera stocké dans l'int pointé par **mod**. ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { diff --git a/subjects/enigma.en.md b/subjects/enigma.en.md index c3da457e7..426254e4b 100644 --- a/subjects/enigma.en.md +++ b/subjects/enigma.en.md @@ -6,10 +6,10 @@ Write a function called `Enigma` that receives pointers to as arguments and move This function will put : -- `a` into `c`. -- `c` into `d`. -- `d` into `b`. -- `b` into `a`. +- `a` into `c`. +- `c` into `d`. +- `d` into `b`. +- `b` into `a`. ### Expected function @@ -21,7 +21,7 @@ func Enigma(a ***int, b *int, c *******int, d ****int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/enigma.fr.md b/subjects/enigma.fr.md index 72b024ca5..8b268587a 100644 --- a/subjects/enigma.fr.md +++ b/subjects/enigma.fr.md @@ -5,10 +5,10 @@ Écrire une fonction nommé `Enigma` qui prends des pointeurs comme arguments et qui interchanges leurs valeurs pour les cacher. Cette fonction déplacera : -- `a` dans `c`. -- `c` dans `d`. -- `d` dans `b`. -- `b` dans `a`. +- `a` dans `c`. +- `c` dans `d`. +- `d` dans `b`. +- `b` dans `a`. ### Fonction attendue @@ -20,52 +20,52 @@ func Enigma(a ***int, b *int, c *******int, d ****int) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - x := 5 - y := &x - z := &y - a := &z - - w := 2 - b := &w - - u := 7 - e := &u - f := &e - g := &f - h := &g - i := &h - j := &i - c := &j - - k := 6 - l := &k - m := &l - n := &m - d := &n - - fmt.Println(***a) - fmt.Println(*b) - fmt.Println(*******c) - fmt.Println(****d) - - student.Enigma(a, b, c, d) - - fmt.Println("After using Enigma") - fmt.Println(***a) - fmt.Println(*b) - fmt.Println(*******c) - fmt.Println(****d) + x := 5 + y := &x + z := &y + a := &z + + w := 2 + b := &w + + u := 7 + e := &u + f := &e + g := &f + h := &g + i := &h + j := &i + c := &j + + k := 6 + l := &k + m := &l + n := &m + d := &n + + fmt.Println(***a) + fmt.Println(*b) + fmt.Println(*******c) + fmt.Println(****d) + + student.Enigma(a, b, c, d) + + fmt.Println("After using Enigma") + fmt.Println(***a) + fmt.Println(*b) + fmt.Println(*******c) + fmt.Println(****d) } ``` diff --git a/subjects/fibonacci.en.md b/subjects/fibonacci.en.md index 96059c762..6b7b298e6 100644 --- a/subjects/fibonacci.en.md +++ b/subjects/fibonacci.en.md @@ -24,14 +24,14 @@ func Fibonacci(index int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( -        "fmt" -        piscine ".." + "fmt" + piscine ".." ) func main() { diff --git a/subjects/fibonacci.fr.md b/subjects/fibonacci.fr.md index 173f6ae43..8d05b3ef2 100644 --- a/subjects/fibonacci.fr.md +++ b/subjects/fibonacci.fr.md @@ -30,8 +30,8 @@ Voici un éventuel `main.go` : package main import ( -        "fmt" -        piscine ".." + "fmt" + piscine ".." ) func main() { diff --git a/subjects/findnextprime.en.md b/subjects/findnextprime.en.md index 9ceeab00c..79cfc5786 100644 --- a/subjects/findnextprime.en.md +++ b/subjects/findnextprime.en.md @@ -16,7 +16,7 @@ func FindNextPrime(nb int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/findnextprime.fr.md b/subjects/findnextprime.fr.md index 5ca592762..2cfc23235 100644 --- a/subjects/findnextprime.fr.md +++ b/subjects/findnextprime.fr.md @@ -16,21 +16,21 @@ func FindNextPrime(nb int) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( -        "fmt" -        piscine ".." + "fmt" + piscine ".." ) func main() { - arg1 := 5 - arg2 := 4 - fmt.Println(piscine.FindNextPrime(arg1)) - fmt.Println(piscine.FindNextPrime(arg2)) + arg1 := 5 + arg2 := 4 + fmt.Println(piscine.FindNextPrime(arg1)) + fmt.Println(piscine.FindNextPrime(arg2)) } ``` diff --git a/subjects/firstrune.en.md b/subjects/firstrune.en.md index 848882db1..971d5ffdb 100644 --- a/subjects/firstrune.en.md +++ b/subjects/firstrune.en.md @@ -14,7 +14,7 @@ func FirstRune(s string) rune { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/firstrune.fr.md b/subjects/firstrune.fr.md index 341311e75..17b39e4e0 100644 --- a/subjects/firstrune.fr.md +++ b/subjects/firstrune.fr.md @@ -14,7 +14,7 @@ func FirstRune(s string) rune { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/firstword.en.md b/subjects/firstword.en.md index 971862b3c..06a5df88c 100644 --- a/subjects/firstword.en.md +++ b/subjects/firstword.en.md @@ -4,11 +4,11 @@ Write a program that takes a `string` and displays its first word, followed by a newline (`'\n'`). -- A word is a section of `string` delimited by spaces or by the start/end of the `string`. +- A word is a section of `string` delimited by spaces or by the start/end of the `string`. -- The output will be followed by a newline (`'\n'`). +- The output will be followed by a newline (`'\n'`). -- If the number of parameters is not 1, or if there are no words, the program displays a newline (`'\n'`). +- If the number of parameters is not 1, or if there are no words, the program displays a newline (`'\n'`). ### Usage diff --git a/subjects/firstword.fr.md b/subjects/firstword.fr.md index aeb27f8f3..5bca5b64c 100644 --- a/subjects/firstword.fr.md +++ b/subjects/firstword.fr.md @@ -4,11 +4,11 @@ Écrire un programme qui prend une `string` et qui affiche son premier mot, suivi d'un retour à la ligne (`'\n'`). -- Un mot est une section de `string` délimité par des espace ou par le début/fin d'une `string`. +- Un mot est une section de `string` délimité par des espace ou par le début/fin d'une `string`. -- L'output sera suivi d'un retour à la ligne (`'\n'`). +- L'output sera suivi d'un retour à la ligne (`'\n'`). -- Si le nombre de paramètres n'est pas 1, ou si il n'y a pas de mots, le programme affiche un retour à la ligne (`'\n'`). +- Si le nombre de paramètres n'est pas 1, ou si il n'y a pas de mots, le programme affiche un retour à la ligne (`'\n'`). ### Utilisation diff --git a/subjects/foreach.en.md b/subjects/foreach.en.md index a89661b11..afd1a34d3 100644 --- a/subjects/foreach.en.md +++ b/subjects/foreach.en.md @@ -14,7 +14,7 @@ func ForEach(f func(int), arr []int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/foreach.fr.md b/subjects/foreach.fr.md index c39355625..6f69a27bc 100644 --- a/subjects/foreach.fr.md +++ b/subjects/foreach.fr.md @@ -14,7 +14,7 @@ func ForEach(f func(int), arr []int) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/foreachprog.en.md b/subjects/foreachprog.en.md index b24e45c8f..0465bdb89 100644 --- a/subjects/foreachprog.en.md +++ b/subjects/foreachprog.en.md @@ -25,7 +25,7 @@ func ForEach(f func(int), arr []int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/fprime.en.md b/subjects/fprime.en.md index 2e99ae99a..db2c2a601 100644 --- a/subjects/fprime.en.md +++ b/subjects/fprime.en.md @@ -4,11 +4,11 @@ Write a program that takes a positive `int` and displays its prime factors, followed by a newline (`'\n'`). -- Factors must be displayed in ascending order and separated by `*`. +- Factors must be displayed in ascending order and separated by `*`. -- If the number of parameters is different from 1, the program displays a newline. +- If the number of parameters is different from 1, the program displays a newline. -- The input, when there is one, will always be valid. +- The input, when there is one, will always be valid. ### Usage diff --git a/subjects/fprime.fr.md b/subjects/fprime.fr.md index 7a2264905..7dbb7f7bc 100644 --- a/subjects/fprime.fr.md +++ b/subjects/fprime.fr.md @@ -4,11 +4,11 @@ Écrire un programme qui prend un `int` positif et qui affiche ses facteurs premiers sur la sortie standard, suivi d'un retour à la ligne (`'\n'`). -- Les facteurs doivent être affichés en ordre croissant et séparés par `*`. +- Les facteurs doivent être affichés en ordre croissant et séparés par `*`. -- Si le nombre de paramètres est différent de 1, le programme affiche un retour à la ligne. +- Si le nombre de paramètres est différent de 1, le programme affiche un retour à la ligne. -- L'input (l'entrée), quand il y en a un, sera toujours valide. +- L'input (l'entrée), quand il y en a un, sera toujours valide. ### Utilisation diff --git a/subjects/index.en.md b/subjects/index.en.md index d948e1654..d1a217604 100644 --- a/subjects/index.en.md +++ b/subjects/index.en.md @@ -14,7 +14,7 @@ func Index(s string, toFind string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/index.fr.md b/subjects/index.fr.md index 059ad7eae..28b64b12c 100644 --- a/subjects/index.fr.md +++ b/subjects/index.fr.md @@ -14,7 +14,7 @@ func Index(s string, toFind string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/inter.en.md b/subjects/inter.en.md index 3a293d05c..eb8257581 100644 --- a/subjects/inter.en.md +++ b/subjects/inter.en.md @@ -4,9 +4,9 @@ Write a program that takes two `string` and displays, without doubles, the characters that appear in both `string`, in the order they appear in the first one. -- The display will be followed by a newline (`'\n'`). +- The display will be followed by a newline (`'\n'`). -- If the number of arguments is different from 2, the program displays a newline (`'\n'`). +- If the number of arguments is different from 2, the program displays a newline (`'\n'`). ### Usage diff --git a/subjects/inter.fr.md b/subjects/inter.fr.md index 5f297414a..f5aa5ff0b 100644 --- a/subjects/inter.fr.md +++ b/subjects/inter.fr.md @@ -4,9 +4,9 @@ Écrire un programme qui prend deux `string` et qui affiche, sans doublons, les caractères qui apparaissent dans les deux `string`, dans l'ordre dans lequel ils apparaissent dans la première. -- L'affichage sera suivi d'un retour à la ligne (`'\n'`). +- L'affichage sera suivi d'un retour à la ligne (`'\n'`). -- Si le nombre d'arguments est différent de 2, le programme affiche un retour à la ligne (`'\n'`). +- Si le nombre d'arguments est différent de 2, le programme affiche un retour à la ligne (`'\n'`). ### Utilisation diff --git a/subjects/isalpha.en.md b/subjects/isalpha.en.md index 79a0913bf..6fefc896e 100644 --- a/subjects/isalpha.en.md +++ b/subjects/isalpha.en.md @@ -14,7 +14,7 @@ func IsAlpha(str string) bool { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/isalpha.fr.md b/subjects/isalpha.fr.md index 2de841d2d..f410a82ab 100644 --- a/subjects/isalpha.fr.md +++ b/subjects/isalpha.fr.md @@ -14,7 +14,7 @@ func IsAlpha(str string) bool { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/islower.en.md b/subjects/islower.en.md index 8cab6d15e..1e4ebd06c 100644 --- a/subjects/islower.en.md +++ b/subjects/islower.en.md @@ -14,7 +14,7 @@ func IsLower(str string) bool { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/islower.fr.md b/subjects/islower.fr.md index 21d0af35e..a0657d8d5 100644 --- a/subjects/islower.fr.md +++ b/subjects/islower.fr.md @@ -14,7 +14,7 @@ func IsLower(str string) bool { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programmes pour tester votre fonction : ```go package main diff --git a/subjects/isnegative.en.md b/subjects/isnegative.en.md index 22b7f4489..661bd32c4 100644 --- a/subjects/isnegative.en.md +++ b/subjects/isnegative.en.md @@ -2,7 +2,7 @@ ### Instructions -Write a [function](TODO-LINK) that prints `'T'` (true) on a single line if the `int` passed as parameter is negative, otherwise it prints `'F'` (false). +Write a function that prints `'T'` (true) on a single line if the `int` passed as parameter is negative, otherwise it prints `'F'` (false). ### Expected function @@ -14,7 +14,7 @@ func IsNegative(nb int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/isnegative.fr.md b/subjects/isnegative.fr.md index 55638c045..3633b5fdb 100644 --- a/subjects/isnegative.fr.md +++ b/subjects/isnegative.fr.md @@ -2,7 +2,7 @@ ### Instructions -Écrire une [fonction](TODO-LINK) qui affiche `'T'` (true) sur une seule ligne si l'`int` passé en paramètre est négatif, sinon elle affiche `'F'` (false). +Écrire une fonction qui affiche `'T'` (true) sur une seule ligne si l'`int` passé en paramètre est négatif, sinon elle affiche `'F'` (false). ### Fonction attendue @@ -14,7 +14,7 @@ func IsNegative(nb int) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/isnumeric.en.md b/subjects/isnumeric.en.md index 7e0bab04a..ff88e7c05 100644 --- a/subjects/isnumeric.en.md +++ b/subjects/isnumeric.en.md @@ -14,7 +14,7 @@ func IsNumeric(str string) bool { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/isnumeric.fr.md b/subjects/isnumeric.fr.md index a2db51efd..6ff3b314b 100644 --- a/subjects/isnumeric.fr.md +++ b/subjects/isnumeric.fr.md @@ -14,7 +14,7 @@ func IsNumeric(str string) bool { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/ispowerof2.en.md b/subjects/ispowerof2.en.md index ea16e5f1f..b88fac2b7 100644 --- a/subjects/ispowerof2.en.md +++ b/subjects/ispowerof2.en.md @@ -6,9 +6,9 @@ Write a program that determines if a given number is a power of 2. This program must print `true` if the given number is a power of 2, otherwise it prints `false`. -- If there is more than one or no argument the program should print a newline ("`\n`"). +- If there is more than one or no argument the program should print a newline ("`\n`"). -- When there is only 1 argument, it will always be a positive valid int. +- When there is only 1 argument, it will always be a positive valid int. ### Usage : diff --git a/subjects/ispowerof2.fr.md b/subjects/ispowerof2.fr.md index 899644961..257a0fa8c 100644 --- a/subjects/ispowerof2.fr.md +++ b/subjects/ispowerof2.fr.md @@ -6,9 +6,9 @@ Ce programme doit afficher `true` si le nombre donné est une puissance de 2, autrement il affiche `false`. -- Si il y a plus d'un ou aucun argument le programme doit afficher un retour à la ligne (`'\n'`). +- Si il y a plus d'un ou aucun argument le programme doit afficher un retour à la ligne (`'\n'`). -- WSi il n'y a qu'un seul argument, ce sera toujours un int positif. +- WSi il n'y a qu'un seul argument, ce sera toujours un int positif. ### Usage : diff --git a/subjects/isprime.en.md b/subjects/isprime.en.md index 3e2d0d087..5da1d49f2 100644 --- a/subjects/isprime.en.md +++ b/subjects/isprime.en.md @@ -16,7 +16,7 @@ func IsPrime(nb int) bool { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/isprime.fr.md b/subjects/isprime.fr.md index c23473258..fb488387d 100644 --- a/subjects/isprime.fr.md +++ b/subjects/isprime.fr.md @@ -16,7 +16,7 @@ func IsPrime(nb int) bool { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/isprintable.en.md b/subjects/isprintable.en.md index da19c3a9b..599592ce8 100644 --- a/subjects/isprintable.en.md +++ b/subjects/isprintable.en.md @@ -14,7 +14,7 @@ func IsPrintable(str string) bool { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/isprintable.fr.md b/subjects/isprintable.fr.md index c96ae4de3..cd8864779 100644 --- a/subjects/isprintable.fr.md +++ b/subjects/isprintable.fr.md @@ -14,7 +14,7 @@ func IsPrintable(str string) bool { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/issorted.en.md b/subjects/issorted.en.md index d0ee93332..5c6f8824a 100644 --- a/subjects/issorted.en.md +++ b/subjects/issorted.en.md @@ -19,7 +19,7 @@ func IsSorted(f func(a, b int) int, tab []int) bool { ### Usage -Here is a possible [program](TODO-LINK) to test your function (without `f`): +Here is a possible program to test your function (without `f`): ```go package main diff --git a/subjects/issorted.fr.md b/subjects/issorted.fr.md index 176eb4f32..54bfdbe09 100644 --- a/subjects/issorted.fr.md +++ b/subjects/issorted.fr.md @@ -18,7 +18,7 @@ func IsSorted(f func(a, b int) int, tab []int) bool { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction (sans `f`) : +Voici un éventuel programme pour tester votre fonction (sans `f`) : ```go package main diff --git a/subjects/isupper.en.md b/subjects/isupper.en.md index 80359b983..1fe7432e9 100644 --- a/subjects/isupper.en.md +++ b/subjects/isupper.en.md @@ -14,7 +14,7 @@ func IsUpper(str string) bool { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/iterativefactorial.en.md b/subjects/iterativefactorial.en.md index a27c1ee6f..2d58f5c54 100644 --- a/subjects/iterativefactorial.en.md +++ b/subjects/iterativefactorial.en.md @@ -16,7 +16,7 @@ func IterativeFactorial(nb int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/iterativefactorial.fr.md b/subjects/iterativefactorial.fr.md index 81e018174..bb25fcc8e 100644 --- a/subjects/iterativefactorial.fr.md +++ b/subjects/iterativefactorial.fr.md @@ -16,7 +16,7 @@ func IterativeFactorial(nb int) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/iterativepower.en.md b/subjects/iterativepower.en.md index dbc928c9e..99be7810e 100644 --- a/subjects/iterativepower.en.md +++ b/subjects/iterativepower.en.md @@ -16,14 +16,14 @@ func IterativePower(nb int, power int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( -        "fmt" -        piscine ".." + "fmt" + piscine ".." ) diff --git a/subjects/iterativepower.fr.md b/subjects/iterativepower.fr.md index 654478baf..6aba45db4 100644 --- a/subjects/iterativepower.fr.md +++ b/subjects/iterativepower.fr.md @@ -16,14 +16,14 @@ func IterativePower(nb int, power int) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( -        "fmt" -        piscine ".." + "fmt" + piscine ".." ) diff --git a/subjects/itoa.en.md b/subjects/itoa.en.md index f32591be9..f613beb43 100644 --- a/subjects/itoa.en.md +++ b/subjects/itoa.en.md @@ -2,9 +2,9 @@ ### Instructions -- Write a function that simulates the behaviour of the `Itoa` function in Go. `Itoa` transforms a number represented as an`int` in a number represented as a `string`. +- Write a function that simulates the behaviour of the `Itoa` function in Go. `Itoa` transforms a number represented as an`int` in a number represented as a `string`. -- For this exercise the handling of the signs + or - **does have** to be taken into account. +- For this exercise the handling of the signs + or - **does have** to be taken into account. ## Expected function diff --git a/subjects/itoa.fr.md b/subjects/itoa.fr.md index e7b8a100a..e6e0bad6e 100644 --- a/subjects/itoa.fr.md +++ b/subjects/itoa.fr.md @@ -2,9 +2,9 @@ ### Instructions -- Écrire une fonction qui reproduit le comportement de la fonction `Itoa` en Go. `Itoa` transforme un nombre représenté en `int` (entier) en `string` (chaîne de caractères). +- Écrire une fonction qui reproduit le comportement de la fonction `Itoa` en Go. `Itoa` transforme un nombre représenté en `int` (entier) en `string` (chaîne de caractères). -- Pour cet exercice la gestion des signes + ou - **doit être** prise en compte. +- Pour cet exercice la gestion des signes + ou - **doit être** prise en compte. ## Fonction attendue diff --git a/subjects/itoabase.en.md b/subjects/itoabase.en.md index 33338b168..17ee139e0 100644 --- a/subjects/itoabase.en.md +++ b/subjects/itoabase.en.md @@ -4,8 +4,8 @@ Write a function that: -- converts an `int` value to a `string` using the specified base in the argument -- and that returns this `string` +- converts an `int` value to a `string` using the specified base in the argument +- and that returns this `string` The base is expressed as an `int`, from 2 to 16. The characters comprising the base are the digits from 0 to 9, followed by uppercase letters from A to F. diff --git a/subjects/itoabase.fr.md b/subjects/itoabase.fr.md index ed1839422..30ed68b08 100644 --- a/subjects/itoabase.fr.md +++ b/subjects/itoabase.fr.md @@ -4,8 +4,8 @@ Écrire une fonction qui: -- convertit une valeur `int` en `string` en utilisant la base spécifiée en argument -- et qui retourne cette `string` +- convertit une valeur `int` en `string` en utilisant la base spécifiée en argument +- et qui retourne cette `string` Cette base est exprimée comme un `int`, de 2 à 16. Les caractères compris dans la base sont les chiffres de 0 à 9, suivis des lettres majuscules de A à F. diff --git a/subjects/itoabaseprog.en.md b/subjects/itoabaseprog.en.md index ec8d29fd6..e97b8cd9f 100644 --- a/subjects/itoabaseprog.en.md +++ b/subjects/itoabaseprog.en.md @@ -15,8 +15,8 @@ This means that: Write a function that: -- converts an `int` value to a `string` using the specified base in the argument -- and that returns this `string` +- converts an `int` value to a `string` using the specified base in the argument +- and that returns this `string` The base is expressed as an `int`, from 2 to 16. The characters comprising the base are the digits from 0 to 9, followed by uppercase letters from A to F. diff --git a/subjects/itoabaseprog.fr.md b/subjects/itoabaseprog.fr.md index 4af0cf4fb..d4a91fdd9 100644 --- a/subjects/itoabaseprog.fr.md +++ b/subjects/itoabaseprog.fr.md @@ -15,8 +15,8 @@ Cela signifie que: Écrire une fonction qui: -- convertit une valeur `int` en `string` en utilisant la base spécifiée en argument -- et qui retourne cette `string` +- convertit une valeur `int` en `string` en utilisant la base spécifiée en argument +- et qui retourne cette `string` Cette base est exprimée comme un `int`, de 2 à 16. Les caractères compris dans la base sont les chiffres de 0 à 9, suivis des lettres majuscules de A à F. diff --git a/subjects/itoaprog.en.md b/subjects/itoaprog.en.md index ee3f824d9..902025971 100644 --- a/subjects/itoaprog.en.md +++ b/subjects/itoaprog.en.md @@ -13,9 +13,9 @@ This means that: ### Instructions -- Write a function that simulates the behaviour of the `Itoa` function in Go. `Itoa` transforms a number represented as an`int` in a number represented as a `string`. +- Write a function that simulates the behaviour of the `Itoa` function in Go. `Itoa` transforms a number represented as an`int` in a number represented as a `string`. -- For this exercise the handling of the signs + or - **does have** to be taken into account. +- For this exercise the handling of the signs + or - **does have** to be taken into account. ## Expected function diff --git a/subjects/join.en.md b/subjects/join.en.md index fb53fa663..94851e3c1 100644 --- a/subjects/join.en.md +++ b/subjects/join.en.md @@ -14,7 +14,7 @@ func Join(strs []string, sep string) string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/join.fr.md b/subjects/join.fr.md index 3d0f9b46c..6c36ae4ab 100644 --- a/subjects/join.fr.md +++ b/subjects/join.fr.md @@ -14,7 +14,7 @@ func Join(strs []string, sep string) string{ ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/lastrune.en.md b/subjects/lastrune.en.md index dbc7e466d..d2678a696 100644 --- a/subjects/lastrune.en.md +++ b/subjects/lastrune.en.md @@ -14,7 +14,7 @@ func LastRune(s string) rune { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/lastrune.fr.md b/subjects/lastrune.fr.md index 99ab87c72..2f30f71b5 100644 --- a/subjects/lastrune.fr.md +++ b/subjects/lastrune.fr.md @@ -14,7 +14,7 @@ func LastRune(s string) rune { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/lastword.en.md b/subjects/lastword.en.md index faf259c17..d79d23e37 100644 --- a/subjects/lastword.en.md +++ b/subjects/lastword.en.md @@ -4,11 +4,11 @@ Write a program that takes a `string` and displays its last word, followed by a newline (`'\n'`). -- A word is a section of `string` delimited by spaces or by the start/end of the `string`. +- A word is a section of `string` delimited by spaces or by the start/end of the `string`. -- The output will be followed by a newline (`'\n'`). +- The output will be followed by a newline (`'\n'`). -- If the number of parameters is different from 1, or if there are no word, the program displays a newline (`'\n'`). +- If the number of parameters is different from 1, or if there are no word, the program displays a newline (`'\n'`). ### Usage diff --git a/subjects/lastword.fr.md b/subjects/lastword.fr.md index fba0f4071..b7a1e4eea 100644 --- a/subjects/lastword.fr.md +++ b/subjects/lastword.fr.md @@ -4,11 +4,11 @@ Écrire un programme qui prend une `string` et qui affiche son dernier mot, suivi d'un retour à la ligne (`'\n'`). -- Un mot est une section de `string` délimitée par des espaces ou par le début/fin d'une `string`. +- Un mot est une section de `string` délimitée par des espaces ou par le début/fin d'une `string`. -- L'output sera suivi d'un retour à la ligne (`'\n'`). +- L'output sera suivi d'un retour à la ligne (`'\n'`). -- Si le nombre de paramètres est différent de 1, ou si il n'y a pas de mot, le programme affiche un retour à la ligne (`'\n'`). +- Si le nombre de paramètres est différent de 1, ou si il n'y a pas de mot, le programme affiche un retour à la ligne (`'\n'`). ### Utilisation diff --git a/subjects/listat.en.md b/subjects/listat.en.md index c9ed4d2f4..05a1a675d 100644 --- a/subjects/listat.en.md +++ b/subjects/listat.en.md @@ -4,7 +4,7 @@ Write a function `ListAt` that takes a pointer to the list `l` and an `int pos` as parameters. This function should return the `NodeL` in the position `pos` of the linked list `l`. -- In case of error the function should return `nil`. +- In case of error the function should return `nil`. ### Expected function and structure @@ -22,7 +22,7 @@ func ListAt(l *NodeL, pos int) *NodeL{ ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listat.fr.md b/subjects/listat.fr.md index 53a2537d4..e84afc9ac 100644 --- a/subjects/listat.fr.md +++ b/subjects/listat.fr.md @@ -4,7 +4,7 @@ Écrire une fonction `ListAt` qui prend un pointeur sur la liste `l` et un `int pos` comme paramètres. Cette fonction devra afficher la `NodeL` à la position `pos` de la liste chaînée `l`. -- En cas d'erreur la fonction affichera `nil`. +- En cas d'erreur la fonction affichera `nil`. ### Fonction et structure attendues @@ -22,7 +22,7 @@ func ListAt(l *NodeL, pos int) *NodeL{ ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listclear.en.md b/subjects/listclear.en.md index d9d9e036d..e62b3e0de 100644 --- a/subjects/listclear.en.md +++ b/subjects/listclear.en.md @@ -4,7 +4,7 @@ Write a function `ListClear` that deletes all `nodes` from a linked list `l`. -- Tip: assign the list's pointer to `nil`. +- Tip: assign the list's pointer to `nil`. ### Expected function and structure @@ -16,7 +16,7 @@ func ListClear(l *List) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listclear.fr.md b/subjects/listclear.fr.md index b4175b85d..5cbfab0e7 100644 --- a/subjects/listclear.fr.md +++ b/subjects/listclear.fr.md @@ -4,7 +4,7 @@ Écrire une fonction `ListClear` qui efface toutes les `nodes` d'une liste chaînée `l`. -- Indice: assigner le pointeur de la liste à `nil`. +- Indice: assigner le pointeur de la liste à `nil`. ### Fonction et structure attendues @@ -16,7 +16,7 @@ func ListClear(l *List) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listfind.en.md b/subjects/listfind.en.md index 3386e7e78..861c5fa69 100644 --- a/subjects/listfind.en.md +++ b/subjects/listfind.en.md @@ -4,7 +4,7 @@ Write a function `ListFind` that returns the address of the first node in the list `l` that is determined to be equal to `ref` by the function `CompStr`. -- For this exercise the function `CompStr` must be used. +- For this exercise the function `CompStr` must be used. ### Expected function and structure @@ -30,7 +30,7 @@ func ListFind(l *List, ref interface{}, comp func(a, b interface{}) bool) *inter ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listfind.fr.md b/subjects/listfind.fr.md index 2841556dc..8415665e1 100644 --- a/subjects/listfind.fr.md +++ b/subjects/listfind.fr.md @@ -4,7 +4,7 @@ Écrire une fonction `ListFind` qui retourne l'adresse de la première node dans la liste `l` qui est déterminée comme étant égale à `ref` par la fonction `CompStr`. -- Pour cet exercice la fonction `CompStr` doit être utilisée. +- Pour cet exercice la fonction `CompStr` doit être utilisée. ### Fonction et structure attendues @@ -30,7 +30,7 @@ func ListFind(l *List, ref interface{}, comp func(a, b interface{}) bool) *inter ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listforeach.en.md b/subjects/listforeach.en.md index e785be33c..7c6ef7086 100644 --- a/subjects/listforeach.en.md +++ b/subjects/listforeach.en.md @@ -4,9 +4,9 @@ Write a function `ListForEach` that applies a function given as argument to the data within each node of the list `l`. -- The function given as argument must have a pointer as argument: `l *List` +- The function given as argument must have a pointer as argument: `l *List` -- Copy the functions `Add2_node` and `Subtract3_node` in the same file as the function `ListForEach` is defined. +- Copy the functions `Add2_node` and `Subtract3_node` in the same file as the function `ListForEach` is defined. ### Expected function and structure @@ -45,7 +45,7 @@ func Subtract3_node(node *NodeL) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listforeach.fr.md b/subjects/listforeach.fr.md index bf20c9aa2..729f85abc 100644 --- a/subjects/listforeach.fr.md +++ b/subjects/listforeach.fr.md @@ -4,9 +4,9 @@ Écrire une fonction `ListForEach` qui applique un fonction donnée en argument à la data contenue dans chacune des nodes d'une liste `l`. -- La fonction donnée en argument doit avoir un pointeur comme argument: `l *List` +- La fonction donnée en argument doit avoir un pointeur comme argument: `l *List` -- Copier les fonctions `Add2_node` et `Subtract3_node` dans le même fichier où la fonction `ListForEach` est définie. +- Copier les fonctions `Add2_node` et `Subtract3_node` dans le même fichier où la fonction `ListForEach` est définie. ### Fonction et struture attendues @@ -45,7 +45,7 @@ func Subtract3_node(node *NodeL) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listforeachif.en.md b/subjects/listforeachif.en.md index 63fdb41ee..d2fe3f25d 100644 --- a/subjects/listforeachif.en.md +++ b/subjects/listforeachif.en.md @@ -4,13 +4,13 @@ Write a function `ListForEachIf` that applies a function given as argument to the data within some of the nodes of the list `l`. -- This function receives two functions: +- This function receives two functions: - - `f` is a function that is applied to the node. + - `f` is a function that is applied to the node. - - `cond` is a function that returns a `boolean` and it will be used to determine if the function `f` should be applied to the node. + - `cond` is a function that returns a `boolean` and it will be used to determine if the function `f` should be applied to the node. -- The function given as argument must have a pointer `*NodeL` as argument. +- The function given as argument must have a pointer `*NodeL` as argument. ### Expected function and structure @@ -62,7 +62,7 @@ func ListForEachIf(l *List, f func(*NodeL), cond func(*NodeL) bool) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listforeachif.fr.md b/subjects/listforeachif.fr.md index bb0087c23..e2afd2e6f 100644 --- a/subjects/listforeachif.fr.md +++ b/subjects/listforeachif.fr.md @@ -4,13 +4,13 @@ Écrire une fonction `ListForEachIf` qui applique un fonction donnée en argument à la data contenue dans certaines des nodes d'une liste `l`. -- Cette fonction reçoit deux fonctions: +- Cette fonction reçoit deux fonctions: - - `f` est la fonction qui est appliqué à la node. + - `f` est la fonction qui est appliqué à la node. - - `cond` est une fonction qui retourne un `boolean` et qui sera utilisée pour déterminer si la fonction`f` doit être appliquée à la node. + - `cond` est une fonction qui retourne un `boolean` et qui sera utilisée pour déterminer si la fonction`f` doit être appliquée à la node. -- La fonction donnée en argument doit avoir un pointeur `*NodeL` comme argument. +- La fonction donnée en argument doit avoir un pointeur `*NodeL` comme argument. ### Fonction et structure attendues @@ -62,7 +62,7 @@ func ListForEachIf(l *List, f func(*NodeL), cond func(*NodeL) bool) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listlast.en.md b/subjects/listlast.en.md index 26b1ce0e2..3c72f13b3 100644 --- a/subjects/listlast.en.md +++ b/subjects/listlast.en.md @@ -24,7 +24,7 @@ func ListLast(l *List) interface{} { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listlast.fr.md b/subjects/listlast.fr.md index c9b400b84..480addd42 100644 --- a/subjects/listlast.fr.md +++ b/subjects/listlast.fr.md @@ -24,7 +24,7 @@ func ListLast(l *List) interface{} { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listmerge.en.md b/subjects/listmerge.en.md index 7714cfecb..69af3a389 100644 --- a/subjects/listmerge.en.md +++ b/subjects/listmerge.en.md @@ -4,7 +4,7 @@ Write a function `ListMerge` that places elements of a list `l2` at the end of another list `l1`. -- New elements should not be created! +- New elements should not be created! ### Expected function and structure @@ -26,7 +26,7 @@ func ListMerge(l1 *List, l2 *List) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listmerge.fr.md b/subjects/listmerge.fr.md index 3d68628a3..702b926ee 100644 --- a/subjects/listmerge.fr.md +++ b/subjects/listmerge.fr.md @@ -26,7 +26,7 @@ func ListMerge(l1 *List, l2 *List) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listpushback.en.md b/subjects/listpushback.en.md index 2067a3753..4902b1010 100644 --- a/subjects/listpushback.en.md +++ b/subjects/listpushback.en.md @@ -24,7 +24,7 @@ func ListPushBack(l *List, data interface{}) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listpushback.fr.md b/subjects/listpushback.fr.md index 5f55dd67c..e76314f75 100644 --- a/subjects/listpushback.fr.md +++ b/subjects/listpushback.fr.md @@ -24,7 +24,7 @@ func ListPushBack(l *List, data interface{}) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listpushfront.en.md b/subjects/listpushfront.en.md index 938a5872a..5ae98e006 100644 --- a/subjects/listpushfront.en.md +++ b/subjects/listpushfront.en.md @@ -24,7 +24,7 @@ func ListPushFront(l *List, data interface{}) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listpushfront.fr.md b/subjects/listpushfront.fr.md index a077dd5e8..93d33569e 100644 --- a/subjects/listpushfront.fr.md +++ b/subjects/listpushfront.fr.md @@ -24,7 +24,7 @@ func ListPushFront(l *List, data interface{}) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listpushpara.en.md b/subjects/listpushpara.en.md index 98716369d..5ba32e482 100644 --- a/subjects/listpushpara.en.md +++ b/subjects/listpushpara.en.md @@ -4,7 +4,7 @@ Write a program that creates a new linked list and includes each command-line argument in to the list. -- The first argument should be at the end of the list +- The first argument should be at the end of the list And its output : diff --git a/subjects/listpushparams.en.md b/subjects/listpushparams.en.md index 8ff23cfce..b1aa8b5ec 100644 --- a/subjects/listpushparams.en.md +++ b/subjects/listpushparams.en.md @@ -4,7 +4,7 @@ Write a program that creates a new linked list and includes each command-line argument in to the list. -- The first argument should be at the end of the list +- The first argument should be at the end of the list ```` diff --git a/subjects/listpushparams.fr.md b/subjects/listpushparams.fr.md index 92d3d3b9e..591e99bfe 100644 --- a/subjects/listpushparams.fr.md +++ b/subjects/listpushparams.fr.md @@ -14,7 +14,7 @@ func CountIf(f func(string) bool, tab []string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listremoveif.en.md b/subjects/listremoveif.en.md index 427bfd273..6336f898d 100644 --- a/subjects/listremoveif.en.md +++ b/subjects/listremoveif.en.md @@ -24,7 +24,7 @@ func ListRemoveIf(l *List, data_ref interface{}) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listremoveif.fr.md b/subjects/listremoveif.fr.md index 652035671..610f9857e 100644 --- a/subjects/listremoveif.fr.md +++ b/subjects/listremoveif.fr.md @@ -24,7 +24,7 @@ func ListRemoveIf(l *List, data_ref interface{}) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listremoveifprog.en.md b/subjects/listremoveifprog.en.md index 7064813ac..db00c0c52 100644 --- a/subjects/listremoveifprog.en.md +++ b/subjects/listremoveifprog.en.md @@ -31,4 +31,4 @@ type List struct { func ListRemoveIf(l *List, data_ref interface{}) { } -``` \ No newline at end of file +``` diff --git a/subjects/listreverse.en.md b/subjects/listreverse.en.md index 4c1a1ed87..a64b5cc03 100644 --- a/subjects/listreverse.en.md +++ b/subjects/listreverse.en.md @@ -24,7 +24,7 @@ func ListReverse(l *List) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listreverse.fr.md b/subjects/listreverse.fr.md index 0ea58d91a..5bc676bec 100644 --- a/subjects/listreverse.fr.md +++ b/subjects/listreverse.fr.md @@ -24,7 +24,7 @@ func ListReverse(l *List) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listsize.en.md b/subjects/listsize.en.md index e59e97741..42bef0a8b 100644 --- a/subjects/listsize.en.md +++ b/subjects/listsize.en.md @@ -24,7 +24,7 @@ func ListSize(l *List) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listsize.fr.md b/subjects/listsize.fr.md index bc5d8495a..de0dd961f 100644 --- a/subjects/listsize.fr.md +++ b/subjects/listsize.fr.md @@ -24,7 +24,7 @@ func ListSize(l *List) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/listsort.en.md b/subjects/listsort.en.md index b7242d725..48ea4d195 100644 --- a/subjects/listsort.en.md +++ b/subjects/listsort.en.md @@ -4,7 +4,7 @@ Write a function `ListSort` that sorts the nodes of a linked list by ascending order. -- The `NodeI` structure will be the only one used. +- The `NodeI` structure will be the only one used. ### Expected function and structure @@ -21,7 +21,7 @@ func ListSort(l *NodeI) *NodeI { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/listsort.fr.md b/subjects/listsort.fr.md index 9f888c67f..f1bd1b170 100644 --- a/subjects/listsort.fr.md +++ b/subjects/listsort.fr.md @@ -4,7 +4,7 @@ Écrire une fonction `ListSort` qui trie les nodes d'une liste chaînée par ordre croissant. -- La structure `NodeI` sera la seule utilisée. +- La structure `NodeI` sera la seule utilisée. ### Fonction et structure attendues @@ -21,7 +21,7 @@ func ListSort(l *NodeI) *NodeI { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/makerange.en.md b/subjects/makerange.en.md index b25cabe01..4e3e45946 100644 --- a/subjects/makerange.en.md +++ b/subjects/makerange.en.md @@ -21,7 +21,7 @@ func MakeRange(min, max int) []int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/makerange.fr.md b/subjects/makerange.fr.md index b1894ba8d..003f1c51e 100644 --- a/subjects/makerange.fr.md +++ b/subjects/makerange.fr.md @@ -20,7 +20,7 @@ func MakeRange(min, max int) []int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/map.en.md b/subjects/map.en.md index 675602a31..3d6b1ddc7 100644 --- a/subjects/map.en.md +++ b/subjects/map.en.md @@ -14,7 +14,7 @@ func Map(f func(int) bool, arr []int) []bool { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/map.fr.md b/subjects/map.fr.md index 9fdd634a8..2be107000 100644 --- a/subjects/map.fr.md +++ b/subjects/map.fr.md @@ -14,7 +14,7 @@ func Map(f func(int) bool, arr []int) []bool { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/max.en.md b/subjects/max.en.md index 652438d19..52638b8a7 100644 --- a/subjects/max.en.md +++ b/subjects/max.en.md @@ -14,7 +14,7 @@ func Max(arr []int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/max.fr.md b/subjects/max.fr.md index 1ebf4cf56..67fba0918 100644 --- a/subjects/max.fr.md +++ b/subjects/max.fr.md @@ -14,7 +14,7 @@ func Max(arr []int) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/maxprog.en.md b/subjects/maxprog.en.md index b4c20529a..42cccadbe 100644 --- a/subjects/maxprog.en.md +++ b/subjects/maxprog.en.md @@ -25,7 +25,7 @@ func Max(arr []int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/nrune.en.md b/subjects/nrune.en.md index 3f33a0639..92f7c3987 100644 --- a/subjects/nrune.en.md +++ b/subjects/nrune.en.md @@ -16,7 +16,7 @@ func NRune(s string, n int) rune { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/nrune.fr.md b/subjects/nrune.fr.md index 0589bd063..0c9b2db8c 100644 --- a/subjects/nrune.fr.md +++ b/subjects/nrune.fr.md @@ -14,7 +14,7 @@ func NRune(s string, n int) rune { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/nruneprog.en.md b/subjects/nruneprog.en.md index c1c9f9167..951977401 100644 --- a/subjects/nruneprog.en.md +++ b/subjects/nruneprog.en.md @@ -27,7 +27,7 @@ func NRune(s string, n int) rune { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/options.en.md b/subjects/options.en.md index dd6e38c75..6a04e8c29 100644 --- a/subjects/options.en.md +++ b/subjects/options.en.md @@ -4,19 +4,19 @@ Write a program that takes an undefined number of arguments which could be considered as `options` and writes on the standard output a representation of those `options` as groups of `bytes` followed by a newline (`'\n'`). -- An `option` is an argument that begins with a `-` and that can have multiple characters which could be : +- An `option` is an argument that begins with a `-` and that can have multiple characters which could be : -abcdefghijklmnopqrstuvwxyz -- All `options` are stocked in a single `int` and each `options` represents a bit of that `int`, and should be stocked like this : +- All `options` are stocked in a single `int` and each `options` represents a bit of that `int`, and should be stocked like this : - - 00000000 00000000 00000000 00000000 - - ******zy xwvutsrq ponmlkji hgfedcba + - 00000000 00000000 00000000 00000000 + - ******zy xwvutsrq ponmlkji hgfedcba -- Launching the program without arguments or with the `-h` flag activated must print all the valid `options` on the standard output, as shown on one of the following examples. +- Launching the program without arguments or with the `-h` flag activated must print all the valid `options` on the standard output, as shown on one of the following examples. -- Please note the `-h` flag has priority over the others flags when it is called first in one of the arguments. (See the examples) +- Please note the `-h` flag has priority over the others flags when it is called first in one of the arguments. (See the examples) -- A wrong `option` must print `Invalid Option` followed by a newline. +- A wrong `option` must print `Invalid Option` followed by a newline. ## Usage diff --git a/subjects/options.fr.md b/subjects/options.fr.md index a523f64c8..6f3ad9195 100644 --- a/subjects/options.fr.md +++ b/subjects/options.fr.md @@ -4,17 +4,17 @@ Écrire un programme qui prend un nombre indéfini d'arguments qui peuvent être considérés comme des `options` et qui affiche sur la sortie standard une représentation de ces `options` comme groupes de `bytes`(octets) suivi d'un retour à la ligne (`'\n'`). -- Une `option` est un argument qui commence avec un `-` et qui peux avoir de multiples caractères qui peuvent être : +- Une `option` est un argument qui commence avec un `-` et qui peux avoir de multiples caractères qui peuvent être : -abcdefghijklmnopqrstuvwxyz -- Toutes les `options` sont stockées dans un seul `int` et chaque `option` représente un bit de cet `int`, et doit être stocké comme ci-dessous : +- Toutes les `options` sont stockées dans un seul `int` et chaque `option` représente un bit de cet `int`, et doit être stocké comme ci-dessous : - - 00000000 00000000 00000000 00000000 - - ******zy xwvutsrq ponmlkji hgfedcba + - 00000000 00000000 00000000 00000000 + - ******zy xwvutsrq ponmlkji hgfedcba -- L'éxécution du programme sans argument ou avec l'option `-h` activée doit afficher toutes les `options` valides sur la sortie standard, comme montré dans un des exemples ci-dessous. +- L'éxécution du programme sans argument ou avec l'option `-h` activée doit afficher toutes les `options` valides sur la sortie standard, comme montré dans un des exemples ci-dessous. -- Une mauvaise `option` doit afficher `Invalid Option` suivi d'un retour à la ligne. +- Une mauvaise `option` doit afficher `Invalid Option` suivi d'un retour à la ligne. ## Utilisation diff --git a/subjects/pointone.en.md b/subjects/pointone.en.md index ddd2d74df..24d0a2ca5 100644 --- a/subjects/pointone.en.md +++ b/subjects/pointone.en.md @@ -14,7 +14,7 @@ func PointOne(n *int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/pointone.fr.md b/subjects/pointone.fr.md index c39666550..f7e135a3b 100644 --- a/subjects/pointone.fr.md +++ b/subjects/pointone.fr.md @@ -14,7 +14,7 @@ func PointOne(n *int) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/printalphabet.en.md b/subjects/printalphabet.en.md index e676a275a..b682a208a 100644 --- a/subjects/printalphabet.en.md +++ b/subjects/printalphabet.en.md @@ -2,7 +2,7 @@ ### Instructions -Write a [program](TODO-LINK) that prints the Latin alphabet in lowercase on a single line. +Write a program that prints the Latin alphabet in lowercase on a single line. A line is a sequence of characters preceding the [end of line](https://en.wikipedia.org/wiki/Newline) character (`'\n'`). diff --git a/subjects/printalphabet.fr.md b/subjects/printalphabet.fr.md index 5501368a1..12a03c657 100644 --- a/subjects/printalphabet.fr.md +++ b/subjects/printalphabet.fr.md @@ -2,7 +2,7 @@ ### Instructions -Écrire un [programme](TODO-LINK) qui affiche l'alphabet latin en minuscule sur une seule ligne. +Écrire un programme qui affiche l'alphabet latin en minuscule sur une seule ligne. Une ligne est une suite de caractères précédant le caractère [fin de ligne](https://en.wikipedia.org/wiki/Newline) (`'\n'`). diff --git a/subjects/printcomb.en.md b/subjects/printcomb.en.md index c55575f35..280ce5b5a 100644 --- a/subjects/printcomb.en.md +++ b/subjects/printcomb.en.md @@ -2,7 +2,7 @@ ### Instructions -Write a [function](TODO-LINK) that prints in ascending order on a single line all unique combinations of three different digits so that the first digit is lower than the second and the second is lower than the third. +Write a function that prints in ascending order on a single line all unique combinations of three different digits so that the first digit is lower than the second and the second is lower than the third. These combinations are separated by a comma and a space. @@ -16,7 +16,7 @@ func PrintComb() { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/printcomb.fr.md b/subjects/printcomb.fr.md index 714344d45..53bae5e6d 100644 --- a/subjects/printcomb.fr.md +++ b/subjects/printcomb.fr.md @@ -2,7 +2,7 @@ ### Instructions -Écrire une [fonction](TODO-LINK) qui affiche sur une seule ligne dans l'ordre croissant toutes les combinaisons possibles de trois chiffres différents tels que le premier est inférieur au second et le second est inférieur au troisième. +Écrire une fonction qui affiche sur une seule ligne dans l'ordre croissant toutes les combinaisons possibles de trois chiffres différents tels que le premier est inférieur au second et le second est inférieur au troisième. Les combinaisons sont séparées par une virgule et un espace. @@ -16,7 +16,7 @@ func PrintComb() { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/printcomb2.en.md b/subjects/printcomb2.en.md index e287e4811..becea7252 100644 --- a/subjects/printcomb2.en.md +++ b/subjects/printcomb2.en.md @@ -2,7 +2,7 @@ ### Instructions -Write a [function](TODO-LINK) that prints in ascending order on a single line all possible combinations of two different two-digit numbers. +Write a function that prints in ascending order on a single line all possible combinations of two different two-digit numbers. These combinations are separated by a comma and a space. @@ -16,7 +16,7 @@ func PrintComb2() { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/printcomb2.fr.md b/subjects/printcomb2.fr.md index 7c640405c..cf52e375a 100644 --- a/subjects/printcomb2.fr.md +++ b/subjects/printcomb2.fr.md @@ -2,7 +2,7 @@ ### Instructions -Écrire une [fonction](TODO-LINK) qui affiche sur une seule ligne dans l'ordre croissant toutes les combinaisons possibles de deux nombres différents à deux chiffres. +Écrire une fonction qui affiche sur une seule ligne dans l'ordre croissant toutes les combinaisons possibles de deux nombres différents à deux chiffres. Les combinaisons sont séparées par une virgule et un espace. @@ -16,7 +16,7 @@ func PrintComb2() { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/printcombn.en.md b/subjects/printcombn.en.md index 80fb42b71..c26caa0d8 100644 --- a/subjects/printcombn.en.md +++ b/subjects/printcombn.en.md @@ -2,15 +2,15 @@ ### Instructions -- Write a function that prints all possible combinations of **n** different digits in ascending order. +- Write a function that prints all possible combinations of **n** different digits in ascending order. -- n will be defined as : 0 < n < 10 +- n will be defined as : 0 < n < 10 below are your references for the **printing format** expected. -- (for n = 1) '0, 1, 2, 3, ...8, 9' +- (for n = 1) '0, 1, 2, 3, ...8, 9' -- (for n = 3) '012, 013, 014, 015, 016, 017, 018, 019, 023,...689, 789' +- (for n = 3) '012, 013, 014, 015, 016, 017, 018, 019, 023,...689, 789' ### Expected function @@ -22,7 +22,7 @@ func PrintCombN(n int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/printcombn.fr.md b/subjects/printcombn.fr.md index e6fe2018a..0e3776677 100644 --- a/subjects/printcombn.fr.md +++ b/subjects/printcombn.fr.md @@ -2,15 +2,15 @@ ### Instructions -- Écrire une fonction qui affiche toutes les combinaisons possibles de **n** chiffres différents en ordre croissant. +- Écrire une fonction qui affiche toutes les combinaisons possibles de **n** chiffres différents en ordre croissant. -- n sera défini tel que: 0 < n < 10 +- n sera défini tel que: 0 < n < 10 ci-dessous vos références pour le **format d'affichage** attendu. -- (pour n = 1) '0, 1, 2, 3, ...8, 9' +- (pour n = 1) '0, 1, 2, 3, ...8, 9' -- (pour n = 3) '012, 013, 014, 015, 016, 017, 018, 019, 023,...689, 789' +- (pour n = 3) '012, 013, 014, 015, 016, 017, 018, 019, 023,...689, 789' ### Fonction attendue @@ -22,7 +22,7 @@ func PrintCombN(n int) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/printdigits.fr.md b/subjects/printdigits.fr.md index cfa96dca2..948e31d3e 100644 --- a/subjects/printdigits.fr.md +++ b/subjects/printdigits.fr.md @@ -2,7 +2,7 @@ ### Instructions -Écrire un [programme](TODO-LINK) qui affiche les chiffres décimaux dans l'ordre croissant (de `0` à `9`) sur une seule ligne. +Écrire un programme qui affiche les chiffres décimaux dans l'ordre croissant (de `0` à `9`) sur une seule ligne. Une ligne est une suite de caractères précédant le caractère [fin de ligne](https://en.wikipedia.org/wiki/Newline) (`'\n'`). diff --git a/subjects/printdigitsprog.en.md b/subjects/printdigitsprog.en.md index a0f50a9cc..ce5f387f0 100644 --- a/subjects/printdigitsprog.en.md +++ b/subjects/printdigitsprog.en.md @@ -2,7 +2,7 @@ ### Instructions -Write a [program](TODO-LINK) that prints the decimal digits in ascending order (from `0` to `9`) on a single line. +Write a program that prints the decimal digits in ascending order (from `0` to `9`) on a single line. A line is a sequence of characters preceding the [end of line](https://en.wikipedia.org/wiki/Newline) character (`'\n'`). diff --git a/subjects/printhex.en.md b/subjects/printhex.en.md index eaaffc5fd..122aea0bd 100644 --- a/subjects/printhex.en.md +++ b/subjects/printhex.en.md @@ -4,8 +4,8 @@ Write a program that takes a positive (or zero) number expressed in base 10, and displays it in base 16 (with lowercase letters) followed by a newline (`'\n'`). -- If the number of parameters is different from 1, the program displays a newline. -- Error cases have to be handled as shown in the example below. +- If the number of parameters is different from 1, the program displays a newline. +- Error cases have to be handled as shown in the example below. ### Usage diff --git a/subjects/printhex.fr.md b/subjects/printhex.fr.md index 59b3a274d..4727fe9d1 100644 --- a/subjects/printhex.fr.md +++ b/subjects/printhex.fr.md @@ -4,9 +4,8 @@ Écrire un programme qui prend un nombre positif (ou zéro) écrit en base 10, et qui l'affiche en base 16 (avec les lettres en minuscule) suivi d'un retour à la ligne (`'\n'`). -- Si le nombre de paramètres est différent de 1, le programme affiche un retour à la ligne. -- Les cas d'erreurs doivent être gérés comme montré dans l'exemple ci-dessous. - +- Si le nombre de paramètres est différent de 1, le programme affiche un retour à la ligne. +- Les cas d'erreurs doivent être gérés comme montré dans l'exemple ci-dessous. ### Utilisation @@ -22,5 +21,5 @@ student@ubuntu:~/[[ROOT]]/test$ ./test student@ubuntu:~/[[ROOT]]/test$ ./test "123 132 1" | cat -e 0$ -student@ubuntu:~/[[ROOT]]/test$ +student@ubuntu:~/[[ROOT]]/test$ ``` diff --git a/subjects/printnbr.en.md b/subjects/printnbr.en.md index 8bd391683..7f5233b43 100644 --- a/subjects/printnbr.en.md +++ b/subjects/printnbr.en.md @@ -16,7 +16,7 @@ func PrintNbr(n int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/printnbr.fr.md b/subjects/printnbr.fr.md index a1594082d..e3c97f97c 100644 --- a/subjects/printnbr.fr.md +++ b/subjects/printnbr.fr.md @@ -16,7 +16,7 @@ func PrintNbr(n int) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/printnbrbase.en.md b/subjects/printnbrbase.en.md index 840e35f78..616da104a 100644 --- a/subjects/printnbrbase.en.md +++ b/subjects/printnbrbase.en.md @@ -8,9 +8,9 @@ If the base is not valid, the function prints `NV` (Not Valid): Validity rules for a base : -- A base must contain at least 2 characters. -- Each character of a base must be unique. -- A base should not contain `+` or `-` characters. +- A base must contain at least 2 characters. +- Each character of a base must be unique. +- A base should not contain `+` or `-` characters. The function has to manage negative numbers. (as shown in the example) @@ -24,7 +24,7 @@ func PrintNbrBase(nbr int, base string) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/printnbrbase.fr.md b/subjects/printnbrbase.fr.md index 49195b9b8..76d817bac 100644 --- a/subjects/printnbrbase.fr.md +++ b/subjects/printnbrbase.fr.md @@ -8,9 +8,9 @@ Si la base n'est pas valide, la fonction affiche `NV` (Not Valid): Règles de validité d'une base : -- Une base doit contenir au moins 2 caractères. -- Chaque caractère d'une base doit être unique. -- Une base ne doit pas contenir les caractères `+` ou `-`. +- Une base doit contenir au moins 2 caractères. +- Chaque caractère d'une base doit être unique. +- Une base ne doit pas contenir les caractères `+` ou `-`. La fonction doit gérer les nombres négatifs (comme montré sur l'exemple). @@ -24,7 +24,7 @@ func PrintNbrBase(nbr int, base string) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/printnbrinorder.en.md b/subjects/printnbrinorder.en.md index 63b23bd82..832b6cb7c 100644 --- a/subjects/printnbrinorder.en.md +++ b/subjects/printnbrinorder.en.md @@ -16,7 +16,7 @@ func PrintNbrInOrder(n int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/printnbrinorder.fr.md b/subjects/printnbrinorder.fr.md index 63b23bd82..832b6cb7c 100644 --- a/subjects/printnbrinorder.fr.md +++ b/subjects/printnbrinorder.fr.md @@ -16,7 +16,7 @@ func PrintNbrInOrder(n int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/printreversealphabet.fr.md b/subjects/printreversealphabet.fr.md index b02d0d12c..382930e0e 100644 --- a/subjects/printreversealphabet.fr.md +++ b/subjects/printreversealphabet.fr.md @@ -2,7 +2,7 @@ ### Instructions -Écrire un [programme](TODO-LINK) qui affiche l'alphabet latin en minuscule dans l'ordre inverse (de `'z'` à `'a'`) sur une seule ligne. +Écrire un programme qui affiche l'alphabet latin en minuscule dans l'ordre inverse (de `'z'` à `'a'`) sur une seule ligne. Une ligne est une suite de caractères précédant le caractère [fin de ligne](https://en.wikipedia.org/wiki/Newline) (`'\n'`). diff --git a/subjects/printstr.en.md b/subjects/printstr.en.md index d85bb81dc..cd630b090 100644 --- a/subjects/printstr.en.md +++ b/subjects/printstr.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a function that prints one by one the characters of a `string` on the screen. +- Write a function that prints one by one the characters of a `string` on the screen. ### Expected function @@ -14,7 +14,7 @@ func PrintStr(str string) { ### Hints -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/printstr.fr.md b/subjects/printstr.fr.md index 6860b0890..270f31455 100644 --- a/subjects/printstr.fr.md +++ b/subjects/printstr.fr.md @@ -2,7 +2,7 @@ ### Instructions -- Écrire une fonction qui affiche un à un les caractères d'une `string` à l'écran. +- Écrire une fonction qui affiche un à un les caractères d'une `string` à l'écran. ### Fonction attendue @@ -14,7 +14,7 @@ func PrintStr(str string) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/printstrprog.en.md b/subjects/printstrprog.en.md index 59ff2a338..addf0f42d 100644 --- a/subjects/printstrprog.en.md +++ b/subjects/printstrprog.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a program that prints one by one the characters of a `string` passed as an argument of the program. +- Write a program that prints one by one the characters of a `string` passed as an argument of the program. ### Expected output : diff --git a/subjects/printwordstables.en.md b/subjects/printwordstables.en.md index fb92ca6ce..dc2f71415 100644 --- a/subjects/printwordstables.en.md +++ b/subjects/printwordstables.en.md @@ -18,12 +18,12 @@ func PrintWordsTables(table []string) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main -import piscine ".." +import piscine ".." func main() { str := "Hello how are you?" diff --git a/subjects/printwordstables.fr.md b/subjects/printwordstables.fr.md index e5be061c7..c636bc569 100644 --- a/subjects/printwordstables.fr.md +++ b/subjects/printwordstables.fr.md @@ -18,12 +18,12 @@ func PrintWordsTables(table []string) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main -import piscine ".." +import piscine ".." func main() { diff --git a/subjects/raid2.en.md b/subjects/raid2.en.md index 3313f028b..e22f7752e 100644 --- a/subjects/raid2.en.md +++ b/subjects/raid2.en.md @@ -2,9 +2,9 @@ ### Instructions -- Create a program that resolves a sudoku. +- Create a program that resolves a sudoku. -- A valid sudoku has only one possible solution. +- A valid sudoku has only one possible solution. ### Usage diff --git a/subjects/raid2.fr.md b/subjects/raid2.fr.md index b39fb9bcf..ff843ad37 100644 --- a/subjects/raid2.fr.md +++ b/subjects/raid2.fr.md @@ -2,9 +2,9 @@ ### Instructions -- Créer un programme qui résout un sudoku. +- Créer un programme qui résout un sudoku. -- Un sudoku valide a seulement une solution possible. +- Un sudoku valide a seulement une solution possible. ### Usage diff --git a/subjects/raid3.en.md b/subjects/raid3.en.md index f207f2216..a2eea0cc2 100644 --- a/subjects/raid3.en.md +++ b/subjects/raid3.en.md @@ -6,11 +6,11 @@ This raid is based on the `raid1` functions. Create a program `raid3` that takes a `string` as an argument and displays the name of the matching `raid1` and its dimensions. -- If the argument is not a `raid1` the program should print `Not a Raid function`. +- If the argument is not a `raid1` the program should print `Not a Raid function`. -- All answers must end with a newline (`'\n'`). +- All answers must end with a newline (`'\n'`). -- If there is more than one `raid1` matches, the program must display them all alphabetically ordered and separated by a `||`. +- If there is more than one `raid1` matches, the program must display them all alphabetically ordered and separated by a `||`. ### Usage diff --git a/subjects/raid3.fr.md b/subjects/raid3.fr.md index 733bd7730..8bb400df8 100644 --- a/subjects/raid3.fr.md +++ b/subjects/raid3.fr.md @@ -6,11 +6,11 @@ Ce raid est basé sur les fonctions du `raid1`. Créer un programme `raid3` qui prend une `string` comme argument et qui affiche le nom du `raid1` correspondant et ses dimensions. -- Si l'argument n'est pas un des `raid1` le programme affiche `Not a Raid function`. +- Si l'argument n'est pas un des `raid1` le programme affiche `Not a Raid function`. -- Toutes les réponses doivent se terminer avec un retour à la ligne (`'\n'`). +- Toutes les réponses doivent se terminer avec un retour à la ligne (`'\n'`). -- Si il y a plus d'un `raid1` correspondant, le programme doit les afficher tous en ordre alphabétique et séparé par un `||`. +- Si il y a plus d'un `raid1` correspondant, le programme doit les afficher tous en ordre alphabétique et séparé par un `||`. ### Utilisation diff --git a/subjects/range.en.md b/subjects/range.en.md index 18acdb1df..cdee44ce0 100644 --- a/subjects/range.en.md +++ b/subjects/range.en.md @@ -4,11 +4,11 @@ Write a program which must: -- **Allocate (with `make`)** an array of integers. +- **Allocate (with `make`)** an array of integers. -- Fill it with consecutive values that begins at the first argument and end at the second argument (Including the values of thoses arguments !). +- Fill it with consecutive values that begins at the first argument and end at the second argument (Including the values of thoses arguments !). -- That prints the array. +- That prints the array. Errors should be handled. diff --git a/subjects/range.fr.md b/subjects/range.fr.md index 46974c035..cd5bedde4 100644 --- a/subjects/range.fr.md +++ b/subjects/range.fr.md @@ -4,11 +4,11 @@ Écrire un programme qui doit: -- Allouer (avec `make`) une slice d'entiers. +- Allouer (avec `make`) une slice d'entiers. -- Le remplir avec des valeurs consécutives qui commencent au premier argument et qui finissent au deuxième (En incluant les valeurs des deux arguments !) +- Le remplir avec des valeurs consécutives qui commencent au premier argument et qui finissent au deuxième (En incluant les valeurs des deux arguments !) -- Et qui affiche cette slice. +- Et qui affiche cette slice. Les erreurs doivent être gérées. diff --git a/subjects/rectangle.en.md b/subjects/rectangle.en.md index 85f5fe23b..be3bd7866 100644 --- a/subjects/rectangle.en.md +++ b/subjects/rectangle.en.md @@ -5,15 +5,15 @@ Consider that a point is defined by its coordinates and that a rectangle is defined by the points of the upper left and lower right corners. -- Define two structures named, `point` and `rectangle`. +- Define two structures named, `point` and `rectangle`. -- The struct `point` has to have two variables, `x` and `y`, type `int`. +- The struct `point` has to have two variables, `x` and `y`, type `int`. -- The struct `rectangle` has to have two variables, `upLeft` and `downRight` type `point`. +- The struct `rectangle` has to have two variables, `upLeft` and `downRight` type `point`. -- The goal is to make a program that: - - Given a slice of points of size `n` returns the smallest rectangle that contains all the points in the vector of points. The name of that function is `defineRectangle`. - - And which calculates and prints the area of that rectangle you define. +- The goal is to make a program that: + - Given a slice of points of size `n` returns the smallest rectangle that contains all the points in the vector of points. The name of that function is `defineRectangle`. + - And which calculates and prints the area of that rectangle you define. ### Expected main and function for the program diff --git a/subjects/rectangle.fr.md b/subjects/rectangle.fr.md index 0797dea59..038f378e2 100644 --- a/subjects/rectangle.fr.md +++ b/subjects/rectangle.fr.md @@ -4,15 +4,15 @@ Considérer qu'un point est défini par ses coordonnées et qu'un rectangle est défini par les points de son coin du haut à gauche et son coin du bas à droite. -- Définir deux structures nommées, `point` et `rectangle`. +- Définir deux structures nommées, `point` et `rectangle`. -- La structure `point` doit avoir deux variables, `x` et `y`, de type `int`. +- La structure `point` doit avoir deux variables, `x` et `y`, de type `int`. -- La structure `rectangle` doit avoir deux variables, `upLeft` et `downRight` de type `point`. +- La structure `rectangle` doit avoir deux variables, `upLeft` et `downRight` de type `point`. -- Le but est de faire un programme qui: - - Avec une slice de points donnée de taille `n` retournes le plus petit rectangle qui contient tous les points dans le vecteur de points0. Le nom de cette fonction est `defineRectangle`. - - Et qui calcules et affiche l'airethe de ce rectangle défini. +- Le but est de faire un programme qui: + - Avec une slice de points donnée de taille `n` retournes le plus petit rectangle qui contient tous les points dans le vecteur de points0. Le nom de cette fonction est `defineRectangle`. + - Et qui calcules et affiche l'airethe de ce rectangle défini. ### Main et fonctions attendues pour ce programme diff --git a/subjects/recursivefactorial.en.md b/subjects/recursivefactorial.en.md index 7013a4153..84f212342 100644 --- a/subjects/recursivefactorial.en.md +++ b/subjects/recursivefactorial.en.md @@ -18,7 +18,7 @@ func RecursiveFactorial(nb int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/recursivefactorial.fr.md b/subjects/recursivefactorial.fr.md index 182500f63..4d64e80b4 100644 --- a/subjects/recursivefactorial.fr.md +++ b/subjects/recursivefactorial.fr.md @@ -18,7 +18,7 @@ func RecursiveFactorial(nb int) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/recursivepower.en.md b/subjects/recursivepower.en.md index a8e8a7eb8..9f83dbdf6 100644 --- a/subjects/recursivepower.en.md +++ b/subjects/recursivepower.en.md @@ -18,7 +18,7 @@ func RecursivePower(nb int, power int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/recursivepower.fr.md b/subjects/recursivepower.fr.md index f71823441..5d3bdc4d7 100644 --- a/subjects/recursivepower.fr.md +++ b/subjects/recursivepower.fr.md @@ -18,7 +18,7 @@ func RecursivePower(nb int, power int) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/rot13.en.md b/subjects/rot13.en.md index d21f41cc1..f1da5b6ee 100644 --- a/subjects/rot13.en.md +++ b/subjects/rot13.en.md @@ -5,11 +5,11 @@ Write a program that takes a `string` and displays it, replacing each of its letters by the letter 13 spaces ahead in alphabetical order. -- 'z' becomes 'm' and 'Z' becomes 'M'. Case remains unaffected. +- 'z' becomes 'm' and 'Z' becomes 'M'. Case remains unaffected. -- The output will be followed by a newline (`'\n'`). +- The output will be followed by a newline (`'\n'`). -- If the number of arguments is different from 1, the program displays a newline (`'\n'`). +- If the number of arguments is different from 1, the program displays a newline (`'\n'`). ### Usage diff --git a/subjects/rot13.fr.md b/subjects/rot13.fr.md index 6174cb695..a17a91e07 100644 --- a/subjects/rot13.fr.md +++ b/subjects/rot13.fr.md @@ -4,11 +4,11 @@ Écrire un programme qui prend une `string` et qui l'affiche, en remplaçant chacune de ses lettres par la lettre qui est 13 positions plus loin dans l'ordre alphabétique. -- 'z' devient 'm' et 'Z' devient 'M'. Les majuscules restent des majuscules, de même pour les minuscules. +- 'z' devient 'm' et 'Z' devient 'M'. Les majuscules restent des majuscules, de même pour les minuscules. -- l'output sera suivi d'un retour à la ligne (`'\n'`). +- l'output sera suivi d'un retour à la ligne (`'\n'`). -- Si le nombre d'arguments est différent de 1, le programme affiche un retour à la ligne (`'\n'`). +- Si le nombre d'arguments est différent de 1, le programme affiche un retour à la ligne (`'\n'`). ### Utilisation diff --git a/subjects/rot14.en.md b/subjects/rot14.en.md index 482df7c8c..db6880ee7 100644 --- a/subjects/rot14.en.md +++ b/subjects/rot14.en.md @@ -14,7 +14,7 @@ func Rot14(str string) string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/rot14.fr.md b/subjects/rot14.fr.md index a277fd2bd..62777343e 100644 --- a/subjects/rot14.fr.md +++ b/subjects/rot14.fr.md @@ -16,7 +16,7 @@ func Rot14(str string) string { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/sametree.en.md b/subjects/sametree.en.md index 9418f2d16..7750c133c 100644 --- a/subjects/sametree.en.md +++ b/subjects/sametree.en.md @@ -38,51 +38,52 @@ Example 1: Input: - 1 - / \ - 2 3 + 1 + / \ + 2 3 - [1,2,3] + [1,2,3] - 1 - / \ - 2 3 - - [1,2,3] + 1 + / \ + 2 3 + + [1,2,3] Output: true Input: - 1 - / - 2 - - [1,2], + 1 + / + 2 + + [1,2] + + 1 + \ + 2 - 1 - \ - 2 - - [1,null,2] + [1,null,2] Output: false Input: ``` - 1 - / \ - 2 1 - - [1,2,1], - - 1 - / \ - 1 2 - - [1,1,2] + 1 + / \ + 2 1 + + [1,2,1] + + 1 + / \ + 1 2 + + [1,1,2] ``` + Output: false ### Usage diff --git a/subjects/searchreplace.en.md b/subjects/searchreplace.en.md index d7a7158f3..275a72530 100644 --- a/subjects/searchreplace.en.md +++ b/subjects/searchreplace.en.md @@ -4,9 +4,9 @@ Write a program that takes 3 arguments, the first argument is a `string` in which to replace a letter (the 2nd argument) by another one (the 3rd argument). -- If the number of arguments is different from 3, the program displays a newline (`'\n'`). +- If the number of arguments is different from 3, the program displays a newline (`'\n'`). -- If the second argument is not contained in the first one (the string) then the program rewrites the `string` followed by a newline (`'\n'`). +- If the second argument is not contained in the first one (the string) then the program rewrites the `string` followed by a newline (`'\n'`). ### Usage diff --git a/subjects/searchreplace.fr.md b/subjects/searchreplace.fr.md index 2dc772ce5..de0e90a5a 100644 --- a/subjects/searchreplace.fr.md +++ b/subjects/searchreplace.fr.md @@ -4,9 +4,9 @@ Écrire un programme qui prends 3 arguments, le premier argument est une `string` dans laquelle une lettre (le 2éme argument) est remplacée par une autre (3éme argument). -- Si le nombre d'aruments n'est pas 3, le programme affiche un retour à la ligne (`'\n'`). +- Si le nombre d'aruments n'est pas 3, le programme affiche un retour à la ligne (`'\n'`). -- Si le second argument n'est pas contenu dans le premier (la `string`) alors le programme réécris la `string` suivi d'un retour à la ligne (`'\n'`). +- Si le second argument n'est pas contenu dans le premier (la `string`) alors le programme réécris la `string` suivi d'un retour à la ligne (`'\n'`). ### Utilisation diff --git a/subjects/sortedlistmerge.en.md b/subjects/sortedlistmerge.en.md index a04d27dd5..bc0428faa 100644 --- a/subjects/sortedlistmerge.en.md +++ b/subjects/sortedlistmerge.en.md @@ -4,7 +4,7 @@ Write a function `SortedListMerge` that merges two lists `n1` and `n2` in ascending order. -- During the tests `n1` and `n2` will already be initially sorted. +- During the tests `n1` and `n2` will already be initially sorted. ### Expected function and structure @@ -16,7 +16,7 @@ func SortedListMerge(n1 *NodeI, n2 *NodeI) *NodeI { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/sortedlistmerge.fr.md b/subjects/sortedlistmerge.fr.md index 542774e0e..64c39c8b8 100644 --- a/subjects/sortedlistmerge.fr.md +++ b/subjects/sortedlistmerge.fr.md @@ -4,7 +4,7 @@ Écrire une fonction `SortedListMerge` qui merge deux listes `n1` et `n2` en ordre ascendant. -- Pendant les tests `n1` et `n2` seront déjà triées. +- Pendant les tests `n1` et `n2` seront déjà triées. ### Fonction et structure attendues @@ -16,7 +16,7 @@ func SortedListMerge(n1 *NodeI, n2 *NodeI) *NodeI { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/sortintegertable.en.md b/subjects/sortintegertable.en.md index 7d5494e40..2167cb3ca 100644 --- a/subjects/sortintegertable.en.md +++ b/subjects/sortintegertable.en.md @@ -14,7 +14,7 @@ func SortIntegerTable(table []int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/sortlist.en.md b/subjects/sortlist.en.md index 53f9d8ccc..fc054af1c 100644 --- a/subjects/sortlist.en.md +++ b/subjects/sortlist.en.md @@ -4,9 +4,9 @@ Write a function that must: -- Sort the list given as a parameter, using the function cmp to select the order to apply, +- Sort the list given as a parameter, using the function cmp to select the order to apply, -- Return a pointer to the first element of the sorted list. +- Return a pointer to the first element of the sorted list. Duplications must remain. @@ -29,7 +29,7 @@ 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 : +- For example, the following function used as `cmp` will sort the list in ascending order : ```go func ascending(a, b int) bool{ diff --git a/subjects/sortlist.fr.md b/subjects/sortlist.fr.md index e6a9ff7a6..c7b52e18f 100644 --- a/subjects/sortlist.fr.md +++ b/subjects/sortlist.fr.md @@ -4,9 +4,9 @@ Écrire une fonction qui doit : -- Trier la liste donnée en paramètre en utilisant la fonction cmp pour sélectionner l'ordre à appliquer, +- Trier la liste donnée en paramètre en utilisant la fonction cmp pour sélectionner l'ordre à appliquer, -- Retourner un pointeur au premier élément de la liste triée. +- Retourner un pointeur au premier élément de la liste triée. Les duplications doivent rester. @@ -29,7 +29,7 @@ func SortList (l *NodeList, cmp func(a,b int) bool) *NodeList{ } ``` -- Par exemple, la fonction suivante utilisée comme `cmp` triera la liste dans l'ordre croissant : +- Par exemple, la fonction suivante utilisée comme `cmp` triera la liste dans l'ordre croissant : ```go func ascending(a, b int) bool{ diff --git a/subjects/sortlistinsert.en.md b/subjects/sortlistinsert.en.md index ec51d44f9..027eb9b74 100644 --- a/subjects/sortlistinsert.en.md +++ b/subjects/sortlistinsert.en.md @@ -4,7 +4,7 @@ Write a function `SortListInsert` that inserts `data_ref` in the linked list `l` while keeping the list sorted in ascending order. -- During the tests the list passed as an argument will be already sorted. +- During the tests the list passed as an argument will be already sorted. ### Expected function and structure @@ -16,7 +16,7 @@ func SortListInsert(l *NodeI, data_ref int) *NodeI{ ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/sortlistinsert.fr.md b/subjects/sortlistinsert.fr.md index 952d87d5e..c6e2112ce 100644 --- a/subjects/sortlistinsert.fr.md +++ b/subjects/sortlistinsert.fr.md @@ -5,7 +5,7 @@ Écrire une fonction `SortListInsert` qui insère `data_ref` dans la liste chaînée `l` tout en gardant cette liste triée par ordre croissant. -- Pendant les tests la liste passée en argument sera déjà triée. +- Pendant les tests la liste passée en argument sera déjà triée. ### Fonction et structure attendues @@ -17,7 +17,7 @@ func SortListInsert(l *NodeI, data_ref int) *NodeI{ ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/sortwordarr.en.md b/subjects/sortwordarr.en.md index 0d5b270de..5960ce31f 100644 --- a/subjects/sortwordarr.en.md +++ b/subjects/sortwordarr.en.md @@ -14,7 +14,7 @@ func SortWordArr(array []string) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/sortwordarr.fr.md b/subjects/sortwordarr.fr.md index 097a95c0d..07f0379ed 100644 --- a/subjects/sortwordarr.fr.md +++ b/subjects/sortwordarr.fr.md @@ -14,7 +14,7 @@ func SortWordArr(array []string) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/sortwordarrprog.en.md b/subjects/sortwordarrprog.en.md index 23914ad3e..af3f0e029 100644 --- a/subjects/sortwordarrprog.en.md +++ b/subjects/sortwordarrprog.en.md @@ -25,7 +25,7 @@ func SortWordArr(array []string) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/sortwordarrprog.fr.md b/subjects/sortwordarrprog.fr.md index 17b2f777d..639d8336f 100644 --- a/subjects/sortwordarrprog.fr.md +++ b/subjects/sortwordarrprog.fr.md @@ -25,7 +25,7 @@ func SortWordArr(array []string) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/split.en.md b/subjects/split.en.md index 3f1a14ec9..fd8e6e467 100644 --- a/subjects/split.en.md +++ b/subjects/split.en.md @@ -16,7 +16,7 @@ func Split(str, charset string) []string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/split.fr.md b/subjects/split.fr.md index 69cb3efb4..0a6d4f319 100644 --- a/subjects/split.fr.md +++ b/subjects/split.fr.md @@ -16,7 +16,7 @@ func Split(str, charset string) []string { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/splitwhitespaces.en.md b/subjects/splitwhitespaces.en.md index 14ba16c1b..d2f29673a 100644 --- a/subjects/splitwhitespaces.en.md +++ b/subjects/splitwhitespaces.en.md @@ -16,7 +16,7 @@ func SplitWhiteSpaces(str string) []string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/sqrt.en.md b/subjects/sqrt.en.md index ead4759dc..dbfe7c800 100644 --- a/subjects/sqrt.en.md +++ b/subjects/sqrt.en.md @@ -14,7 +14,7 @@ func Sqrt(nb int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/sqrt.fr.md b/subjects/sqrt.fr.md index 1df230ea5..e0c34b055 100644 --- a/subjects/sqrt.fr.md +++ b/subjects/sqrt.fr.md @@ -14,7 +14,7 @@ func Sqrt(nb int) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/strlen.en.md b/subjects/strlen.en.md index 342699099..bea50067d 100644 --- a/subjects/strlen.en.md +++ b/subjects/strlen.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a function that counts the `runes` of a `string` and that returns that count. +- Write a function that counts the `runes` of a `string` and that returns that count. ### Expected function @@ -14,7 +14,7 @@ func StrLen(str string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/strlen.fr.md b/subjects/strlen.fr.md index fc343e71a..1a45ba32c 100644 --- a/subjects/strlen.fr.md +++ b/subjects/strlen.fr.md @@ -2,7 +2,7 @@ ### Instructions -- Écrire une fonction qui compte le nombre de `runes` d'une `string` et qui retourne le nombre trouvé. +- Écrire une fonction qui compte le nombre de `runes` d'une `string` et qui retourne le nombre trouvé. ### Fonction attendue @@ -14,7 +14,7 @@ func StrLen(str string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/strlenprog.en.md b/subjects/strlenprog.en.md index e89484f39..c69e90d5a 100644 --- a/subjects/strlenprog.en.md +++ b/subjects/strlenprog.en.md @@ -25,7 +25,7 @@ func StrLen(str string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/strlenprog.fr.md b/subjects/strlenprog.fr.md index ce5205801..27e81301f 100644 --- a/subjects/strlenprog.fr.md +++ b/subjects/strlenprog.fr.md @@ -25,19 +25,18 @@ func StrLen(str string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main import ( "fmt" - piscine ".." ) func main() { str := "Hello World!" - nb := piscine.StrLen(str) + nb := StrLen(str) fmt.Println(nb) } ``` diff --git a/subjects/strrev.en.md b/subjects/strrev.en.md index e21834053..ff47f90e4 100644 --- a/subjects/strrev.en.md +++ b/subjects/strrev.en.md @@ -2,9 +2,9 @@ ### Instructions -- Write a function that reverses a `string`. +- Write a function that reverses a `string`. -- This function will **return** the s `string`. +- This function will **return** the s `string`. ### Expected function @@ -16,7 +16,7 @@ func StrRev(s string) string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/strrev.fr.md b/subjects/strrev.fr.md index 1babd18f0..0ba8c64e3 100644 --- a/subjects/strrev.fr.md +++ b/subjects/strrev.fr.md @@ -2,9 +2,9 @@ ### Instructions -- Écrire une fonction qui inverse une chaîne de caractères(`string`). +- Écrire une fonction qui inverse une chaîne de caractères(`string`). -- Cette fonction **retournera** la chaîne de caractères s(`string`). +- Cette fonction **retournera** la chaîne de caractères s(`string`). ### Fonction attendue @@ -16,7 +16,7 @@ func StrRev(s string) string { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/strrevprog.en.md b/subjects/strrevprog.en.md index 6b4a34004..c6f6574ed 100644 --- a/subjects/strrevprog.en.md +++ b/subjects/strrevprog.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a program that reverses a `string` and prints it in the standard output. +- Write a program that reverses a `string` and prints it in the standard output. ### Expected output : diff --git a/subjects/strrevprog.fr.md b/subjects/strrevprog.fr.md index 1233a6ef9..48581f8df 100644 --- a/subjects/strrevprog.fr.md +++ b/subjects/strrevprog.fr.md @@ -2,7 +2,7 @@ ### Instructions -- Écrire un programme qui inverse une `string` et qui l'affiche dans la sortie standard. +- Écrire un programme qui inverse une `string` et qui l'affiche dans la sortie standard. ### Utilisation : diff --git a/subjects/swap.en.md b/subjects/swap.en.md index 39d7ad703..09af35d90 100644 --- a/subjects/swap.en.md +++ b/subjects/swap.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a function that swaps the contents of two **pointers to an int** (`*int`). +- Write a function that swaps the contents of two **pointers to an int** (`*int`). ### Expected function @@ -14,7 +14,7 @@ func Swap(a *int, b *int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/swapprog.en.md b/subjects/swapprog.en.md index 01e2f9252..74ff54727 100644 --- a/subjects/swapprog.en.md +++ b/subjects/swapprog.en.md @@ -13,7 +13,7 @@ This means that: ### Instructions -- Write a function that swaps the contents of two **pointers to an int** (`*int`). +- Write a function that swaps the contents of two **pointers to an int** (`*int`). ### Expected function diff --git a/subjects/switchcase.en.md b/subjects/switchcase.en.md index 8301402ec..d915a0888 100644 --- a/subjects/switchcase.en.md +++ b/subjects/switchcase.en.md @@ -4,11 +4,11 @@ Write a program that takes a `string` and reverses the case of all its letters. -- Other characters remain unchanged. +- Other characters remain unchanged. -- The result must be followed by a newline (`'\n'`). +- The result must be followed by a newline (`'\n'`). -- If the number of arguments is different from 1, the program displays a newline (`'\n'`). +- If the number of arguments is different from 1, the program displays a newline (`'\n'`). ### Usage diff --git a/subjects/switchcase.fr.md b/subjects/switchcase.fr.md index 81f7b2272..a8c006487 100644 --- a/subjects/switchcase.fr.md +++ b/subjects/switchcase.fr.md @@ -4,11 +4,11 @@ Écrire un programme qui prend une `string` et qui inverses les majuscules en minuscules et vice-versa. -- Tout autre caractère reste inchangé. +- Tout autre caractère reste inchangé. -- Le résultat doit être suivi d'un retour à la ligne (`'\n'`). +- Le résultat doit être suivi d'un retour à la ligne (`'\n'`). -- Si le nombre d'arguments est différent de 1, le programme affiche un retour à la ligne (`'\n'`). +- Si le nombre d'arguments est différent de 1, le programme affiche un retour à la ligne (`'\n'`). ### Utilisation diff --git a/subjects/tabmult.en.md b/subjects/tabmult.en.md index 0d1e73a2b..0141a7338 100644 --- a/subjects/tabmult.en.md +++ b/subjects/tabmult.en.md @@ -4,7 +4,7 @@ Write a program that displays a number's multiplication table. -- The parameter will always be a strictly positive number that fits in an `int`. Said number multiplied by 9 will also fit in an `int`. +- The parameter will always be a strictly positive number that fits in an `int`. Said number multiplied by 9 will also fit in an `int`. ### Usage diff --git a/subjects/tabmult.fr.md b/subjects/tabmult.fr.md index 66cc27f20..fa47c11da 100644 --- a/subjects/tabmult.fr.md +++ b/subjects/tabmult.fr.md @@ -4,7 +4,7 @@ Écrire un programme qui affiche la table de multiplication d'un nombre. -- Le paramètre sera toujours un nombre strictement positif qui rentre dans un `int`. Ce paramètre multiplié par 9 rentrera aussi dans un `int`. +- Le paramètre sera toujours un nombre strictement positif qui rentre dans un `int`. Ce paramètre multiplié par 9 rentrera aussi dans un `int`. ### Utilisation diff --git a/subjects/tolower.en.md b/subjects/tolower.en.md index a6c1f98f6..0d509cd59 100644 --- a/subjects/tolower.en.md +++ b/subjects/tolower.en.md @@ -14,7 +14,7 @@ func ToLower(s string) string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/tolower.fr.md b/subjects/tolower.fr.md index c6863c9cc..918a0bd6d 100644 --- a/subjects/tolower.fr.md +++ b/subjects/tolower.fr.md @@ -14,7 +14,7 @@ func ToLower(s string) string { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/toupper.en.md b/subjects/toupper.en.md index 3a6a27a0e..193239c1b 100644 --- a/subjects/toupper.en.md +++ b/subjects/toupper.en.md @@ -14,7 +14,7 @@ func ToUpper(s string) string { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/trimatoi.en.md b/subjects/trimatoi.en.md index ba6571cf6..af0f39a8b 100644 --- a/subjects/trimatoi.en.md +++ b/subjects/trimatoi.en.md @@ -2,13 +2,13 @@ ### Instructions -- Write a [function](TODO-LINK) that transforms a number within a `string` in a number represented as an `int`. +- Write a function that transforms a number within a `string` in a number represented as an `int`. -- For this exercise the handling of the signs + or - **has** to be taken into account. If one of the signs is encountered before any number it should determine the sign of the returned `int`. +- For this exercise the handling of the signs + or - **has** to be taken into account. If one of the signs is encountered before any number it should determine the sign of the returned `int`. -- This function will **only** have to return the `int`. In case of invalid input, the function should return `0`. +- This function will **only** have to return the `int`. In case of invalid input, the function should return `0`. -- Note: There will never be more than one sign by string in the tests. +- Note: There will never be more than one sign by string in the tests. ### Expected function @@ -20,7 +20,7 @@ func TrimAtoi(s string) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main @@ -36,8 +36,8 @@ func main() { s3 := "012 345" s4 := "Hello World!" s5 := "sd+x1fa2W3s4" - s6 := "sd-x1fa2W3s4" - s7 := "sdx1-fa2W3s4" + s6 := "sd-x1fa2W3s4" + s7 := "sdx1-fa2W3s4" n := piscine.TrimAtoi(s) n2 := piscine.TrimAtoi(s2) diff --git a/subjects/trimatoi.fr.md b/subjects/trimatoi.fr.md index 7c1059e29..e150ada1a 100644 --- a/subjects/trimatoi.fr.md +++ b/subjects/trimatoi.fr.md @@ -2,11 +2,11 @@ ### Instructions -- 'Écrire une [function](TODO-LINK) qui transforme un nombre dans une `string` en un nombre représenté en `int`(entier). +- 'Écrire une function qui transforme un nombre dans une `string` en un nombre représenté en `int`(entier). -- Pour cet exercice la gestion des signes + ou - **doit être** prise en compte. Si un des signes se situe avant un chiffre alors il déterminera le signe de l'`int` retourné. +- Pour cet exercice la gestion des signes + ou - **doit être** prise en compte. Si un des signes se situe avant un chiffre alors il déterminera le signe de l'`int` retourné. -- Cette fonction aura **seulement** à retourner l'`int` (entier). En cas d'input invalide, la fonction devra retourné `0`. +- Cette fonction aura **seulement** à retourner l'`int` (entier). En cas d'input invalide, la fonction devra retourné `0`. ### Fonction attendue @@ -18,8 +18,7 @@ func TrimAtoi(s string) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : - +Voici un éventuel programme pour tester votre fonction : ```go package main @@ -35,8 +34,8 @@ func main() { s3 := "012 345" s4 := "Hello World!" s5 := "sd+x1fa2W3s4" - s6 := "sd-x1fa2W3s4" - s7 := "sdx1-fa2W3s4" + s6 := "sd-x1fa2W3s4" + s7 := "sdx1-fa2W3s4" n := piscine.TrimAtoi(s) n2 := piscine.TrimAtoi(s2) diff --git a/subjects/twosum.en.md b/subjects/twosum.en.md index 6b86cdcf1..bbf043fd7 100644 --- a/subjects/twosum.en.md +++ b/subjects/twosum.en.md @@ -26,19 +26,18 @@ func TwoSum(nums []int, target int) []int { } ``` -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( "fmt" - piscine ".." ) func main() { case1 := []int{1, 2, 3, 4} - out := piscine.TwoSum(case1, 5) + out := TwoSum(case1, 5) fmt.Println(out) } ``` diff --git a/subjects/ultimatedivmod.en.md b/subjects/ultimatedivmod.en.md index 3b6185479..dc02d9cfc 100644 --- a/subjects/ultimatedivmod.en.md +++ b/subjects/ultimatedivmod.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a function that will be formatted as below. +- Write a function that will be formatted as below. ### Expected function @@ -12,20 +12,20 @@ func UltimateDivMod(a *int, b *int) { } ``` -- This function will divide the int **a** and **b**. -- The result of this division will be stored in the int pointed by **a**. -- The remainder of this division will be stored in the int pointed by **b**. +- This function will divide the int **a** and **b**. +- The result of this division will be stored in the int pointed by **a**. +- The remainder of this division will be stored in the int pointed by **b**. ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { diff --git a/subjects/ultimatepointone.en.md b/subjects/ultimatepointone.en.md index af9c66097..e556c6214 100644 --- a/subjects/ultimatepointone.en.md +++ b/subjects/ultimatepointone.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a function that takes a **pointer to a pointer to a pointer to an int** as argument and gives to this int the value of 1. +- Write a function that takes a **pointer to a pointer to a pointer to an int** as argument and gives to this int the value of 1. ### Expected function @@ -14,14 +14,14 @@ func UltimatePointOne(n ***int) { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { diff --git a/subjects/unmatch.en.md b/subjects/unmatch.en.md index ba6cc6ae0..d28f63bbe 100644 --- a/subjects/unmatch.en.md +++ b/subjects/unmatch.en.md @@ -4,7 +4,7 @@ Write a function, `Unmatch`, that returns the element of the slice (arr) that does not have a correspondent pair. -- If all the number have a correspondent pair, it shoud return `-1`. +- If all the number have a correspondent pair, it shoud return `-1`. ### Expected function @@ -16,7 +16,7 @@ func Unmatch(arr []int) int { ### Usage -Here is a possible [program](TODO-LINK) to test your function : +Here is a possible program to test your function : ```go package main diff --git a/subjects/unmatch.fr.md b/subjects/unmatch.fr.md index 5f959cfd1..41c370a1c 100644 --- a/subjects/unmatch.fr.md +++ b/subjects/unmatch.fr.md @@ -14,7 +14,7 @@ func Unmatch(arr []int) int { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main diff --git a/subjects/ztail.en.md b/subjects/ztail.en.md index 936707877..ade99f112 100644 --- a/subjects/ztail.en.md +++ b/subjects/ztail.en.md @@ -4,15 +4,15 @@ Write a program called `ztail` that has the same behaviour as the system command `tail`, but which takes at least one file as argument. -- The only option to be handled is `-c`. This option will be used in all tests. +- The only option to be handled is `-c`. This option will be used in all tests. -- For this program the "os" package can be used. +- For this program the "os" package can be used. -- For the program to pass the tests the convention for the return code of program in Unix systems should be followed (see os.Exit). +- For the program to pass the tests the convention for the return code of program in Unix systems should be followed (see os.Exit). -- Handle the errors and output the same error messages as `tail`. +- Handle the errors and output the same error messages as `tail`. -- For more information consult the man page for `tail`. +- For more information consult the man page for `tail`. ### Note: From 1487ee29e9d24cc3ffca0cfa3188764b138afa3c Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 26 Feb 2020 09:46:18 +0000 Subject: [PATCH 028/146] correction of spaces and tabs --- subjects/alphacount.fr.md | 10 ++-- subjects/any.fr.md | 16 +++---- subjects/appendrange.fr.md | 8 ++-- subjects/atoi.fr.md | 56 +++++++++++----------- subjects/atoibase.fr.md | 14 +++--- subjects/atoibaseprog.fr.md | 12 ++--- subjects/basicatoi.fr.md | 22 ++++----- subjects/basicatoi2.fr.md | 32 ++++++------- subjects/btreeapplypostorder.en.md | 14 +++--- subjects/doop.fr.md | 6 +-- subjects/enigma.fr.md | 74 +++++++++++++++--------------- subjects/findnextprime.fr.md | 12 ++--- subjects/who-are-you.en.md | 4 +- subjects/who-are-you.fr.md | 4 +- 14 files changed, 142 insertions(+), 142 deletions(-) diff --git a/subjects/alphacount.fr.md b/subjects/alphacount.fr.md index 32fca1f1b..da478b4f3 100644 --- a/subjects/alphacount.fr.md +++ b/subjects/alphacount.fr.md @@ -23,14 +23,14 @@ Here is a possible program to test your function : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - str := "Hello 78 World! 4455 /" - nb := piscine.AlphaCount(str) - fmt.Println(nb) + str := "Hello 78 World! 4455 /" + nb := piscine.AlphaCount(str) + fmt.Println(nb) } ``` diff --git a/subjects/any.fr.md b/subjects/any.fr.md index 88820eea3..9e2dc88ec 100644 --- a/subjects/any.fr.md +++ b/subjects/any.fr.md @@ -22,19 +22,19 @@ Voici un éventuel programme pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - tab1 := []string{"Hello", "how", "are", "you"} - tab2 := []string{"This", "is", "4", "you"} + tab1 := []string{"Hello", "how", "are", "you"} + tab2 := []string{"This", "is", "4", "you"} - result1 := piscine.Any(piscine.IsNumeric, tab1) - result2 := piscine.Any(piscine.IsNumeric, tab2) + result1 := piscine.Any(piscine.IsNumeric, tab1) + result2 := piscine.Any(piscine.IsNumeric, tab2) - fmt.Println(result1) - fmt.Println(result2) + fmt.Println(result1) + fmt.Println(result2) } ``` diff --git a/subjects/appendrange.fr.md b/subjects/appendrange.fr.md index c1dc93db1..66f0b91d5 100644 --- a/subjects/appendrange.fr.md +++ b/subjects/appendrange.fr.md @@ -26,13 +26,13 @@ Voici un éventuel programme pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - fmt.Println(piscine.AppendRange(5, 10)) - fmt.Println(piscine.AppendRange(10, 5)) + fmt.Println(piscine.AppendRange(5, 10)) + fmt.Println(piscine.AppendRange(10, 5)) } ``` diff --git a/subjects/atoi.fr.md b/subjects/atoi.fr.md index 964d84dd5..44aca8e0e 100644 --- a/subjects/atoi.fr.md +++ b/subjects/atoi.fr.md @@ -26,37 +26,37 @@ Voici un éventuel programme pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - s := "12345" - s2 := "0000000012345" - s3 := "012 345" - s4 := "Hello World!" - s5 := "+1234" - s6 := "-1234" - s7 := "++1234" - s8 := "--1234" - - n := piscine.Atoi(s) - n2 := piscine.Atoi(s2) - n3 := piscine.Atoi(s3) - n4 := piscine.Atoi(s4) - n5 := piscine.Atoi(s5) - n6 := piscine.Atoi(s6) - n7 := piscine.Atoi(s7) - n8 := piscine.Atoi(s8) - - fmt.Println(n) - fmt.Println(n2) - fmt.Println(n3) - fmt.Println(n4) - fmt.Println(n5) - fmt.Println(n6) - fmt.Println(n7) - fmt.Println(n8) + s := "12345" + s2 := "0000000012345" + s3 := "012 345" + s4 := "Hello World!" + s5 := "+1234" + s6 := "-1234" + s7 := "++1234" + s8 := "--1234" + + n := piscine.Atoi(s) + n2 := piscine.Atoi(s2) + n3 := piscine.Atoi(s3) + n4 := piscine.Atoi(s4) + n5 := piscine.Atoi(s5) + n6 := piscine.Atoi(s6) + n7 := piscine.Atoi(s7) + n8 := piscine.Atoi(s8) + + fmt.Println(n) + fmt.Println(n2) + fmt.Println(n3) + fmt.Println(n4) + fmt.Println(n5) + fmt.Println(n6) + fmt.Println(n7) + fmt.Println(n8) } ``` diff --git a/subjects/atoibase.fr.md b/subjects/atoibase.fr.md index fbd06a484..096bca6a8 100644 --- a/subjects/atoibase.fr.md +++ b/subjects/atoibase.fr.md @@ -32,16 +32,16 @@ Voici un éventuel programme pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - fmt.Println(piscine.AtoiBase("125", "0123456789")) - fmt.Println(piscine.AtoiBase("1111101", "01")) - fmt.Println(piscine.AtoiBase("7D", "0123456789ABCDEF")) - fmt.Println(piscine.AtoiBase("uoi", "choumi")) - fmt.Println(piscine.AtoiBase("bbbbbab", "-ab")) + fmt.Println(piscine.AtoiBase("125", "0123456789")) + fmt.Println(piscine.AtoiBase("1111101", "01")) + fmt.Println(piscine.AtoiBase("7D", "0123456789ABCDEF")) + fmt.Println(piscine.AtoiBase("uoi", "choumi")) + fmt.Println(piscine.AtoiBase("bbbbbab", "-ab")) } ``` diff --git a/subjects/atoibaseprog.fr.md b/subjects/atoibaseprog.fr.md index 1e6410d73..b90290768 100644 --- a/subjects/atoibaseprog.fr.md +++ b/subjects/atoibaseprog.fr.md @@ -43,15 +43,15 @@ Voici un éventuel programme pour tester votre fonction : package main import ( - "fmt" + "fmt" ) func main() { - fmt.Println(AtoiBase("125", "0123456789")) - fmt.Println(AtoiBase("1111101", "01")) - fmt.Println(AtoiBase("7D", "0123456789ABCDEF")) - fmt.Println(AtoiBase("uoi", "choumi")) - fmt.Println(AtoiBase("bbbbbab", "-ab")) + fmt.Println(AtoiBase("125", "0123456789")) + fmt.Println(AtoiBase("1111101", "01")) + fmt.Println(AtoiBase("7D", "0123456789ABCDEF")) + fmt.Println(AtoiBase("uoi", "choumi")) + fmt.Println(AtoiBase("bbbbbab", "-ab")) } ``` diff --git a/subjects/basicatoi.fr.md b/subjects/basicatoi.fr.md index 66f731780..9a68092c8 100644 --- a/subjects/basicatoi.fr.md +++ b/subjects/basicatoi.fr.md @@ -26,22 +26,22 @@ Voici un éventuel programme pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - s := "12345" - s2 := "0000000012345" - s3 := "000000" + s := "12345" + s2 := "0000000012345" + s3 := "000000" - n := piscine.BasicAtoi(s) - n2 := piscine.BasicAtoi(s2) - n3 := piscine.BasicAtoi(s3) + n := piscine.BasicAtoi(s) + n2 := piscine.BasicAtoi(s2) + n3 := piscine.BasicAtoi(s3) - fmt.Println(n) - fmt.Println(n2) - fmt.Println(n3) + fmt.Println(n) + fmt.Println(n2) + fmt.Println(n3) } ``` diff --git a/subjects/basicatoi2.fr.md b/subjects/basicatoi2.fr.md index d3e546f07..67e6a3b5d 100644 --- a/subjects/basicatoi2.fr.md +++ b/subjects/basicatoi2.fr.md @@ -26,25 +26,25 @@ Voici un éventuel programme pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - s := "12345" - s2 := "0000000012345" - s3 := "012 345" - s4 := "Hello World!" - - n := piscine.BasicAtoi2(s) - n2 := piscine.BasicAtoi2(s2) - n3 := piscine.BasicAtoi2(s3) - n4 := piscine.BasicAtoi2(s4) - - fmt.Println(n) - fmt.Println(n2) - fmt.Println(n3) - fmt.Println(n4) + s := "12345" + s2 := "0000000012345" + s3 := "012 345" + s4 := "Hello World!" + + n := piscine.BasicAtoi2(s) + n2 := piscine.BasicAtoi2(s2) + n3 := piscine.BasicAtoi2(s3) + n4 := piscine.BasicAtoi2(s4) + + fmt.Println(n) + fmt.Println(n2) + fmt.Println(n3) + fmt.Println(n4) } ``` diff --git a/subjects/btreeapplypostorder.en.md b/subjects/btreeapplypostorder.en.md index b2b6c8adf..ab5a245fc 100644 --- a/subjects/btreeapplypostorder.en.md +++ b/subjects/btreeapplypostorder.en.md @@ -20,16 +20,16 @@ Here is a possible program to test your function : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - root := &piscine.TreeNode{Data: "4"} - piscine.BTreeInsertData(root, "1") - piscine.BTreeInsertData(root, "7") - piscine.BTreeInsertData(root, "5") - piscine.BTreeApplyPostorder(root, fmt.Println) + root := &piscine.TreeNode{Data: "4"} + piscine.BTreeInsertData(root, "1") + piscine.BTreeInsertData(root, "7") + piscine.BTreeInsertData(root, "5") + piscine.BTreeApplyPostorder(root, fmt.Println) } ``` diff --git a/subjects/doop.fr.md b/subjects/doop.fr.md index 8a12b3a91..5fe81bdd9 100644 --- a/subjects/doop.fr.md +++ b/subjects/doop.fr.md @@ -6,9 +6,9 @@ Le programme doit être utilisé avec trois arguments: -- Une valeur -- Un opérateur -- Une autre valeur +- Une valeur +- Un opérateur +- Une autre valeur En cas d'opérateur invalide le programme affiche `0`. diff --git a/subjects/enigma.fr.md b/subjects/enigma.fr.md index 8b268587a..57cbf1d85 100644 --- a/subjects/enigma.fr.md +++ b/subjects/enigma.fr.md @@ -26,46 +26,46 @@ Voici un éventuel programme pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - x := 5 - y := &x - z := &y - a := &z - - w := 2 - b := &w - - u := 7 - e := &u - f := &e - g := &f - h := &g - i := &h - j := &i - c := &j - - k := 6 - l := &k - m := &l - n := &m - d := &n - - fmt.Println(***a) - fmt.Println(*b) - fmt.Println(*******c) - fmt.Println(****d) - - student.Enigma(a, b, c, d) - - fmt.Println("After using Enigma") - fmt.Println(***a) - fmt.Println(*b) - fmt.Println(*******c) - fmt.Println(****d) + x := 5 + y := &x + z := &y + a := &z + + w := 2 + b := &w + + u := 7 + e := &u + f := &e + g := &f + h := &g + i := &h + j := &i + c := &j + + k := 6 + l := &k + m := &l + n := &m + d := &n + + fmt.Println(***a) + fmt.Println(*b) + fmt.Println(*******c) + fmt.Println(****d) + + student.Enigma(a, b, c, d) + + fmt.Println("After using Enigma") + fmt.Println(***a) + fmt.Println(*b) + fmt.Println(*******c) + fmt.Println(****d) } ``` diff --git a/subjects/findnextprime.fr.md b/subjects/findnextprime.fr.md index 2cfc23235..1fe3a1006 100644 --- a/subjects/findnextprime.fr.md +++ b/subjects/findnextprime.fr.md @@ -22,15 +22,15 @@ Voici un éventuel programme pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - arg1 := 5 - arg2 := 4 - fmt.Println(piscine.FindNextPrime(arg1)) - fmt.Println(piscine.FindNextPrime(arg2)) + arg1 := 5 + arg2 := 4 + fmt.Println(piscine.FindNextPrime(arg1)) + fmt.Println(piscine.FindNextPrime(arg2)) } ``` diff --git a/subjects/who-are-you.en.md b/subjects/who-are-you.en.md index eb2ac4b89..ca02813db 100644 --- a/subjects/who-are-you.en.md +++ b/subjects/who-are-you.en.md @@ -8,6 +8,6 @@ The only though that comes to your mind is a tag that says: `subject Id: 70`" Create the file `who-are-you.sh` which will remind you who you are by showing your name only. -- Where to look : https://[[DOMAIN]]/assets/superhero/all.json +- Where to look : https://[[DOMAIN]]/assets/superhero/all.json -- What to use : `curl` and `jq` +- What to use : `curl` and `jq` diff --git a/subjects/who-are-you.fr.md b/subjects/who-are-you.fr.md index fae5775bd..c94268f80 100644 --- a/subjects/who-are-you.fr.md +++ b/subjects/who-are-you.fr.md @@ -8,6 +8,6 @@ Tout ce qui vous vient à l'esprit est une étiquette sur laquelle est écrite: Créer le fichier `who-are-you.sh` qui vous rappellera qui vous êtes en affichant votre Nom seulement. -- Où chercher : https://[[DOMAIN]]/assets/superhero/all.json +- Où chercher : https://[[DOMAIN]]/assets/superhero/all.json -- Quoi utiliser : `curl` et `jq` +- Quoi utiliser : `curl` et `jq` From 68d89f10da41dd8df466a8e1b164fd57f6d4928e Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 26 Feb 2020 11:34:59 +0000 Subject: [PATCH 029/146] more corrections --- subjects/anagram.en.md | 1 + subjects/atoiprog.en.md | 2 +- subjects/btreeinsertdata.en.md | 4 ++-- subjects/btreeinsertdata.fr.md | 4 ++-- subjects/btreeprintroot.fr.md | 4 ++-- subjects/collatzcountdown.fr.md | 2 +- subjects/divmod.en.md | 2 +- subjects/divmod.fr.md | 2 +- subjects/good-practices.en.md | 4 ++-- subjects/introduction.en.md | 4 ++-- subjects/lcm.en.md | 4 ++-- subjects/listpushparams.en.md | 2 -- subjects/listsizeprog.en.md | 2 +- subjects/nauuo.en.md | 12 ++++++------ subjects/point.en.md | 6 +++--- subjects/point.fr.md | 7 +++---- subjects/pointone.en.md | 12 ++++++------ subjects/pointone.fr.md | 12 ++++++------ subjects/printbits.en.md | 2 +- subjects/printbits.fr.md | 2 +- subjects/printdigitsprog.en.md | 2 +- subjects/printhex.en.md | 4 ++-- subjects/printstrprog.fr.md | 2 +- subjects/reverse.en.md | 30 +++++++++++++++--------------- subjects/reverserange.en.md | 6 +++--- subjects/reverserange.fr.md | 6 +++--- subjects/revwstr.en.md | 6 +++--- subjects/revwstr.fr.md | 8 ++++---- subjects/rot14.fr.md | 2 +- subjects/sametree.en.md | 6 +++--- subjects/sortintegertable.en.md | 2 +- subjects/sortll.en.md | 3 ++- subjects/splitprog.fr.md | 2 -- subjects/swap.fr.md | 2 +- subjects/ultimatedivmod.fr.md | 4 ++-- subjects/ultimatepointone.fr.md | 6 +++--- subjects/ztail.fr.md | 8 ++++---- 37 files changed, 93 insertions(+), 96 deletions(-) diff --git a/subjects/anagram.en.md b/subjects/anagram.en.md index 5b41bc904..e46cd6dd8 100644 --- a/subjects/anagram.en.md +++ b/subjects/anagram.en.md @@ -34,6 +34,7 @@ Here is a possible program to test your function: ```go package main + import ( piscine ".." "fmt" diff --git a/subjects/atoiprog.en.md b/subjects/atoiprog.en.md index 54517d730..3355f3f58 100644 --- a/subjects/atoiprog.en.md +++ b/subjects/atoiprog.en.md @@ -13,7 +13,7 @@ This means that: ### Instructions -- Write a [function](TODO-LINK) that simulates the behaviour of the `Atoi` function in Go. `Atoi` transforms a number represented as a `string` in a number represented as an `int`. +- Write a function that simulates the behaviour of the `Atoi` function in Go. `Atoi` transforms a number represented as a `string` in a number represented as an `int`. - `Atoi` returns `0` if the `string` is not considered as a valid number. For this exercise **non-valid `string` chains will be tested**. Some will contain non-digits characters. diff --git a/subjects/btreeinsertdata.en.md b/subjects/btreeinsertdata.en.md index 86738577c..1a35ba5ce 100644 --- a/subjects/btreeinsertdata.en.md +++ b/subjects/btreeinsertdata.en.md @@ -10,8 +10,8 @@ The nodes must be defined as follows : ```go type TreeNode struct { - Left, Right, Parent *TreeNode - Data string + Left, Right, Parent *TreeNode + Data string } func BTreeInsertData(root *TreeNode, data string) *TreeNode { diff --git a/subjects/btreeinsertdata.fr.md b/subjects/btreeinsertdata.fr.md index e24f7636d..56083792e 100644 --- a/subjects/btreeinsertdata.fr.md +++ b/subjects/btreeinsertdata.fr.md @@ -10,8 +10,8 @@ Les nodes doivent être définies comme ci-dessous : ```go type TreeNode struct { - Left, Right, Parent *TreeNode - Data string + Left, Right, Parent *TreeNode + Data string } func BTreeInsertData(root *TreeNode, data string) *TreeNode { diff --git a/subjects/btreeprintroot.fr.md b/subjects/btreeprintroot.fr.md index 1ab421203..734d667b4 100644 --- a/subjects/btreeprintroot.fr.md +++ b/subjects/btreeprintroot.fr.md @@ -9,8 +9,8 @@ Les nodes doivent être définies comme ci-dessous: ```go type TreeNode struct { - left, right *TreeNode - data string + left, right *TreeNode + data string } func PrintRoot(root *TreeNode){ diff --git a/subjects/collatzcountdown.fr.md b/subjects/collatzcountdown.fr.md index d6baaa0a2..005b4d0c4 100644 --- a/subjects/collatzcountdown.fr.md +++ b/subjects/collatzcountdown.fr.md @@ -4,7 +4,7 @@ Écrire une fonction, `CollatzCountdown`, qui retournes le nombre d'étapes nécéssaires pour atteindre 1 en utilisant le comptage de collatz. -- Elle doit renvoyer `-1` si `start` est égal à 0 ou négatif. +- Elle doit renvoyer `-1` si `start` est égal à 0 ou négatif. ### Fonction attendue diff --git a/subjects/divmod.en.md b/subjects/divmod.en.md index fbebb9305..41f92cb6e 100644 --- a/subjects/divmod.en.md +++ b/subjects/divmod.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a function that will be formatted as below. +- Write a function that will be formatted as below. ### Expected function diff --git a/subjects/divmod.fr.md b/subjects/divmod.fr.md index 125db71cc..cb2665823 100644 --- a/subjects/divmod.fr.md +++ b/subjects/divmod.fr.md @@ -2,7 +2,7 @@ ### Instructions -- Écrire une fonction qui aura le format ci-dessous. +- Écrire une fonction qui aura le format ci-dessous. ### Fonction attendue diff --git a/subjects/good-practices.en.md b/subjects/good-practices.en.md index 708e962e3..5cb0a4fb1 100644 --- a/subjects/good-practices.en.md +++ b/subjects/good-practices.en.md @@ -7,8 +7,8 @@ - Avoid Obvious Comments - Code Grouping - Consistent Naming Scheme - - camelCase - - under_scores + - 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) diff --git a/subjects/introduction.en.md b/subjects/introduction.en.md index a0bfd0472..ea0b0a5ed 100644 --- a/subjects/introduction.en.md +++ b/subjects/introduction.en.md @@ -29,11 +29,11 @@ ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N '' cat ~/.ssh/id_ed25519.pub ``` -- Copy the result and paste it in the content field of adding an ssh key in your settings (adapt the link with your username). +- Copy the result and paste it in the content field of adding an ssh key in your settings (adapt the link with your username). [https://git.[[DOMAIN]]/choumi/settings/keys](https://git.[[DOMAIN]]/choumi/settings/keys) -- Confirm by clicking on the add key button. +- Confirm by clicking on the add key button. Once this is done the git clone command should work now. diff --git a/subjects/lcm.en.md b/subjects/lcm.en.md index e58d34f6a..49b437873 100644 --- a/subjects/lcm.en.md +++ b/subjects/lcm.en.md @@ -33,8 +33,8 @@ Here is a possible program to test your function : package main func main() { - fmt.Println(Lcm(2, 7)) - fmt.Println(Lcm(0, 4)) + fmt.Println(Lcm(2, 7)) + fmt.Println(Lcm(0, 4)) } ``` diff --git a/subjects/listpushparams.en.md b/subjects/listpushparams.en.md index b1aa8b5ec..b3fa39bc2 100644 --- a/subjects/listpushparams.en.md +++ b/subjects/listpushparams.en.md @@ -6,8 +6,6 @@ Write a program that creates a new linked list and includes each command-line ar - The first argument should be at the end of the list -```` - And its output : ```console diff --git a/subjects/listsizeprog.en.md b/subjects/listsizeprog.en.md index 3e1a2b702..5684ee644 100644 --- a/subjects/listsizeprog.en.md +++ b/subjects/listsizeprog.en.md @@ -31,4 +31,4 @@ type List struct { func ListSize(l *List) int { } -``` \ No newline at end of file +``` diff --git a/subjects/nauuo.en.md b/subjects/nauuo.en.md index 2d9e35e03..49cf8da0d 100644 --- a/subjects/nauuo.en.md +++ b/subjects/nauuo.en.md @@ -37,15 +37,15 @@ Here is a possible program to test your function : package main import ( - "fmt" - piscine ".." + "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)) + 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)) } ``` diff --git a/subjects/point.en.md b/subjects/point.en.md index a9109b8bb..85bae913e 100644 --- a/subjects/point.en.md +++ b/subjects/point.en.md @@ -4,11 +4,11 @@ Create a `.go` file. -- The code below has to be copied in that file. +- The code below has to be copied in that file. -- The necessary changes have to be applied so that the program works. +- The necessary changes have to be applied so that the program works. -- The program must be submitted inside a folder with the name `point`. +- The program must be submitted inside a folder with the name `point`. ### Code to be copied diff --git a/subjects/point.fr.md b/subjects/point.fr.md index 4cf7fbd4d..957ca9291 100644 --- a/subjects/point.fr.md +++ b/subjects/point.fr.md @@ -4,12 +4,11 @@ Créer un fichier `.go`. -- Le code ci-dessous doit être copié dans ce fichier. +- Le code ci-dessous doit être copié dans ce fichier. -- Les changements nécéssaires doivent être appliquer et the code below into that file - and do the necessary changes so that the program works. +- Les changements nécéssaires doivent être appliquer et the code below into that file and do the necessary changes so that the program works. -- Le programme doit être rendu dans un dossier nommé `boolean`. +- Le programme doit être rendu dans un dossier nommé `boolean`. ### Code à copier diff --git a/subjects/pointone.en.md b/subjects/pointone.en.md index 24d0a2ca5..d7aab1e87 100644 --- a/subjects/pointone.en.md +++ b/subjects/pointone.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a function that takes a **pointer to an int** as argument and gives to this int the value of 1. +- Write a function that takes a **pointer to an int** as argument and gives to this int the value of 1. ### Expected function @@ -20,14 +20,14 @@ Here is a possible program to test your function : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - n := 0 - piscine.PointOne(&n) - fmt.Println(n) + n := 0 + piscine.PointOne(&n) + fmt.Println(n) } ``` diff --git a/subjects/pointone.fr.md b/subjects/pointone.fr.md index f7e135a3b..66f29a449 100644 --- a/subjects/pointone.fr.md +++ b/subjects/pointone.fr.md @@ -2,7 +2,7 @@ ### Instructions -- Écrire une fonction qui prend un **pointeur sur int** en argument et qui assignes à cet int la valeur 1. +- Écrire une fonction qui prend un **pointeur sur int** en argument et qui assignes à cet int la valeur 1. ### Fonction attendue @@ -20,14 +20,14 @@ Voici un éventuel programme pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { - n := 0 - piscine.PointOne(&n) - fmt.Println(n) + n := 0 + piscine.PointOne(&n) + fmt.Println(n) } ``` diff --git a/subjects/printbits.en.md b/subjects/printbits.en.md index e3d0b5328..259e21861 100644 --- a/subjects/printbits.en.md +++ b/subjects/printbits.en.md @@ -4,7 +4,7 @@ Write a program that takes a number as argument, and prints it in binary value **without a newline at the end**. -- If the the argument is not a number the program should print `00000000`. +- If the the argument is not a number the program should print `00000000`. ### Expected output : diff --git a/subjects/printbits.fr.md b/subjects/printbits.fr.md index fc699c085..724a1c24f 100644 --- a/subjects/printbits.fr.md +++ b/subjects/printbits.fr.md @@ -4,7 +4,7 @@ Écrire un programme qui prend un nombre en argument, et qui l'affiche en valeur binaire **sans newline à la fin**. -- Si l'argument n'est pas un nombre le programme doit afficher `00000000`. +- Si l'argument n'est pas un nombre le programme doit afficher `00000000`. ### Expected output : diff --git a/subjects/printdigitsprog.en.md b/subjects/printdigitsprog.en.md index ce5f387f0..ef2b48dc3 100644 --- a/subjects/printdigitsprog.en.md +++ b/subjects/printdigitsprog.en.md @@ -13,4 +13,4 @@ student@ubuntu:~/printdigitsprog$ go build student@ubuntu:~/printdigitsprog$ ./main 0123456789 student@ubuntu:~/printdigitsprog$ -``` \ No newline at end of file +``` diff --git a/subjects/printhex.en.md b/subjects/printhex.en.md index 122aea0bd..31ca6614c 100644 --- a/subjects/printhex.en.md +++ b/subjects/printhex.en.md @@ -5,7 +5,7 @@ Write a program that takes a positive (or zero) number expressed in base 10, and displays it in base 16 (with lowercase letters) followed by a newline (`'\n'`). - If the number of parameters is different from 1, the program displays a newline. -- Error cases have to be handled as shown in the example below. +- Error cases have to be handled as shown in the example below. ### Usage @@ -21,5 +21,5 @@ student@ubuntu:~/[[ROOT]]/test$ ./test student@ubuntu:~/[[ROOT]]/test$ ./test "123 132 1" | cat -e 0$ -student@ubuntu:~/[[ROOT]]/test$ +student@ubuntu:~/[[ROOT]]/test$ ``` diff --git a/subjects/printstrprog.fr.md b/subjects/printstrprog.fr.md index e65da8410..043940b04 100644 --- a/subjects/printstrprog.fr.md +++ b/subjects/printstrprog.fr.md @@ -2,7 +2,7 @@ ### Instructions -- Écrire un programme qui affiche un à un les caractères d'une `string` passée en argument du programme. +- Écrire un programme qui affiche un à un les caractères d'une `string` passée en argument du programme. ### Utilisation : diff --git a/subjects/reverse.en.md b/subjects/reverse.en.md index 00af63427..33ba6617b 100644 --- a/subjects/reverse.en.md +++ b/subjects/reverse.en.md @@ -39,7 +39,7 @@ Here is a possible program to test your function : package main import ( - "fmt" + "fmt" ) func pushBack(n *NodeAddL, num int) *NodeAddL{ @@ -47,20 +47,20 @@ 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() + 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() } ``` diff --git a/subjects/reverserange.en.md b/subjects/reverserange.en.md index 78199ae40..ac060a15d 100644 --- a/subjects/reverserange.en.md +++ b/subjects/reverserange.en.md @@ -4,11 +4,11 @@ Write a program which must: -- **Allocate (with `make`)** an array of integers. +- **Allocate (with `make`)** an array of integers. -- Fill it with consecutive values that begins at the second argument and end at the first argument (Including the values of thoses arguments !). +- Fill it with consecutive values that begins at the second argument and end at the first argument (Including the values of thoses arguments !). -- That prints the array. +- That prints the array. Errors should be handled. diff --git a/subjects/reverserange.fr.md b/subjects/reverserange.fr.md index 0c153d36d..fc145494e 100644 --- a/subjects/reverserange.fr.md +++ b/subjects/reverserange.fr.md @@ -4,11 +4,11 @@ Écrire un programme qui doit: -- Allouer (avec `make`) une slice d'entiers. +- Allouer (avec `make`) une slice d'entiers. -- Le remplir avec des valeurs consécutives qui commencent au deuxième argument et qui finissent au premier (en incluant les valeurs des deux arguments !) +- Le remplir avec des valeurs consécutives qui commencent au deuxième argument et qui finissent au premier (en incluant les valeurs des deux arguments !) -- Et qui affiche cette slice. +- Et qui affiche cette slice. Les erreurs doivent être gérées. diff --git a/subjects/revwstr.en.md b/subjects/revwstr.en.md index b7f789657..dffa54b4e 100644 --- a/subjects/revwstr.en.md +++ b/subjects/revwstr.en.md @@ -4,11 +4,11 @@ Write a program that takes a `string` as a parameter, and prints its words in reverse. -- A word is a sequence of **alphanumerical** characters. +- A word is a sequence of **alphanumerical** characters. -- If the number of parameters is different from 1, the program will display newline (`'\n'`). +- If the number of parameters is different from 1, the program will display newline (`'\n'`). -- In the parameters that are going to be tested, there will not be any extra spaces. (meaning that there will not be additionnal spaces at the beginning or at the end of the `string`and that words will always be separated by exactly one space). +- In the parameters that are going to be tested, there will not be any extra spaces. (meaning that there will not be additionnal spaces at the beginning or at the end of the `string`and that words will always be separated by exactly one space). ### Usage diff --git a/subjects/revwstr.fr.md b/subjects/revwstr.fr.md index 4d2344d7d..2eb541fda 100644 --- a/subjects/revwstr.fr.md +++ b/subjects/revwstr.fr.md @@ -4,11 +4,11 @@ Écrire un programme qui prend une `string` comme paramètre, et affiche ses mots en sens inverse. -- Un mot est une suite de caractères **alphanumériques.** +- Un mot est une suite de caractères **alphanumériques.** -- Si le nombre de paramètres est différent de 1, le programme affiche un retour à la ligne (`'\n'`). +- Si le nombre de paramètres est différent de 1, le programme affiche un retour à la ligne (`'\n'`). -- Dans les paramètres qui seront testés, il n'y aura pas d'espaces extra. (ce qui signifie qu'il n'y aura pas d'espaces additionnels, ni au début, ni à la fin de la `string` et que les mots seront toujours séparés par un seul espace). +- Dans les paramètres qui seront testés, il n'y aura pas d'espaces extra. (ce qui signifie qu'il n'y aura pas d'espaces additionnels, ni au début, ni à la fin de la `string` et que les mots seront toujours séparés par un seul espace). ### Utilisation @@ -22,5 +22,5 @@ student@ubuntu:~/[[ROOT]]/test$ ./test "he stared at the mountain" mountain the at stared he student@ubuntu:~/[[ROOT]]/test$ ./test "" | cat-e $ -student@ubuntu:~/[[ROOT]]/test$ +student@ubuntu:~/[[ROOT]]/test$ ``` diff --git a/subjects/rot14.fr.md b/subjects/rot14.fr.md index 62777343e..678c02dc0 100644 --- a/subjects/rot14.fr.md +++ b/subjects/rot14.fr.md @@ -4,7 +4,7 @@ Écrire une fonction `rot14` qui retourne la `string` en paramètre transformée en `string rot14`. -- Il faut savoir ce que `rot13` signifie. +- Il faut savoir ce que `rot13` signifie. ### Fonction attendue diff --git a/subjects/sametree.en.md b/subjects/sametree.en.md index 7750c133c..ebe13d864 100644 --- a/subjects/sametree.en.md +++ b/subjects/sametree.en.md @@ -94,10 +94,10 @@ Here is a possible program to test your function : package main func main() { - t1 := NewRandTree() - t2 := NewRandTree() + t1 := NewRandTree() + t2 := NewRandTree() - fmt.Println(IsSameTree(t1, t2)) + fmt.Println(IsSameTree(t1, t2)) } ``` diff --git a/subjects/sortintegertable.en.md b/subjects/sortintegertable.en.md index 2167cb3ca..e0ba79e00 100644 --- a/subjects/sortintegertable.en.md +++ b/subjects/sortintegertable.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a function that reorder an array of `int` in ascending order. +- Write a function that reorder an array of `int` in ascending order. ### Expected function diff --git a/subjects/sortll.en.md b/subjects/sortll.en.md index 2ce278c49..84830e9b1 100644 --- a/subjects/sortll.en.md +++ b/subjects/sortll.en.md @@ -32,13 +32,14 @@ func Sortll(node *NodeAddL) *NodeAddL { ``` ### Usage + Here is a possible program to test your function: ```go package main import ( - "fmt" + "fmt" ) // I implemented pushBack for this diff --git a/subjects/splitprog.fr.md b/subjects/splitprog.fr.md index 1b03afb3e..312502bc3 100644 --- a/subjects/splitprog.fr.md +++ b/subjects/splitprog.fr.md @@ -11,7 +11,6 @@ Cela signifie que: - La fonction main déclarée doit **aussi passer** le `Restrictions Checker`(le testeur de fonctions illégales). Il est conseillé à l'étudiant de rendre une fonction main vide après ses tests finis. - Toutes les autres régles sont les mêmes que pour un `programme`. - ### Instructions Écrire une fonction qui sépare les mots d'une `string`, qui les met dans un tableau de `string`. @@ -44,7 +43,6 @@ func main() { } ``` - Et son résultat : ```console diff --git a/subjects/swap.fr.md b/subjects/swap.fr.md index a4f439a7d..95864263a 100644 --- a/subjects/swap.fr.md +++ b/subjects/swap.fr.md @@ -2,7 +2,7 @@ ### Instructions -- Écrire une fonction qui échange les contenus de deux **pointeurs sur entier** (`*int`). +- Écrire une fonction qui échange les contenus de deux **pointeurs sur entier** (`*int`). ### Fonction attendue diff --git a/subjects/ultimatedivmod.fr.md b/subjects/ultimatedivmod.fr.md index a09cebfe3..9d863d015 100644 --- a/subjects/ultimatedivmod.fr.md +++ b/subjects/ultimatedivmod.fr.md @@ -24,8 +24,8 @@ Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { diff --git a/subjects/ultimatepointone.fr.md b/subjects/ultimatepointone.fr.md index 338721c6a..edc7b8c07 100644 --- a/subjects/ultimatepointone.fr.md +++ b/subjects/ultimatepointone.fr.md @@ -2,7 +2,7 @@ ### Instructions -- Écrire une fonction qui prend un **pointeur sur pointeur sur pointeur sur int** en argument et qui assignes à cet int la valeur 1. +- Écrire une fonction qui prend un **pointeur sur pointeur sur pointeur sur int** en argument et qui assignes à cet int la valeur 1. ### Fonction attendue @@ -20,8 +20,8 @@ Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : package main import ( - "fmt" - piscine ".." + "fmt" + piscine ".." ) func main() { diff --git a/subjects/ztail.fr.md b/subjects/ztail.fr.md index f8885d571..8166d2875 100644 --- a/subjects/ztail.fr.md +++ b/subjects/ztail.fr.md @@ -4,10 +4,10 @@ Écrire un programme `ztail` qui a le même comportement que la ligne de commande `tail`, mais qui prend au moins 1 fichier comme argument. -- La seule option qui doit être géré est `-c`. Cette option sera utilisé dans tous les tests. +- La seule option qui doit être géré est `-c`. Cette option sera utilisé dans tous les tests. -- Pour ce programme le package "os" peut être utilisé. +- Pour ce programme le package "os" peut être utilisé. -- Pour que le programme passe les tests la convention pour le retour code de programme en systémes Unix devra être suivi(voir os.Exit). +- Pour que le programme passe les tests la convention pour le retour code de programme en systémes Unix devra être suivi(voir os.Exit). -- Pour plus d'informtations consulter la page du man de `tail`. +- Pour plus d'informtations consulter la page du man de `tail`. From c43125822c362e12cb01cb3d36401fec0c4f6c12 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 27 Feb 2020 09:36:09 +0000 Subject: [PATCH 030/146] removing one last todo-link --- subjects/reverse.en.md | 4 ++-- subjects/ultimatepointone.fr.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subjects/reverse.en.md b/subjects/reverse.en.md index 33ba6617b..2db9daa6d 100644 --- a/subjects/reverse.en.md +++ b/subjects/reverse.en.md @@ -22,8 +22,8 @@ Write a function that reverses the list and returns pointer/reference to new lin package main type NodeAddL struct { - Next *NodeAddL - Num int + Next *NodeAddL + Num int } func Reverse(node *NodeAddL) *NodeAddL { diff --git a/subjects/ultimatepointone.fr.md b/subjects/ultimatepointone.fr.md index edc7b8c07..e12859e04 100644 --- a/subjects/ultimatepointone.fr.md +++ b/subjects/ultimatepointone.fr.md @@ -14,7 +14,7 @@ func UltimatePointOne(n ***int) { ### Utilisation -Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : +Voici un éventuel programme pour tester votre fonction : ```go package main From bf0828ce99ea809962047e6752e0cb935ded7045 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Mon, 2 Mar 2020 13:59:03 +0000 Subject: [PATCH 031/146] forum READMEs --- subjects/forum/forum.audit.en.md | 16 ++++++ subjects/forum/forum.en.md | 89 ++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 subjects/forum/forum.audit.en.md create mode 100644 subjects/forum/forum.en.md diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md new file mode 100644 index 000000000..86a648aba --- /dev/null +++ b/subjects/forum/forum.audit.en.md @@ -0,0 +1,16 @@ +#### Functional + +###### Has the requirement for the allowed packages been respected? + +###### Does the code contain at least one CREATE query? + +###### Does the code contain at least one INSERT query? + +###### Does the code contain at least one SELECT query? + +###### Are there HTTP requests between the database and the server? + +#### General + +###### + + \ No newline at end of file diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md new file mode 100644 index 000000000..3b3245bdd --- /dev/null +++ b/subjects/forum/forum.en.md @@ -0,0 +1,89 @@ +## forum + +### Objectives + +This project consists in creating a web forum that allows communication between users through the creation of posts and comments. It also allows non-registered users to only see posts and comments. + +- Your forum should work based on services. Using services to create a project means that instead of having all of your project in one location, you actually divide it in smaller "projects". +- For example if you want to create a gym application you can split it in: login/register, workouts, stats (weight, muscle mass, etc.), and so on. + +You can learn more about services [here](https://medium.com/myntra-engineering/my-journey-with-golang-web-services-4d922a8c9897). + +#### Authentication + +In this segment you will have to create a page that allows you to `register` new users for the forum, by inputting their credentials. You also have to create a `login session` to access te forum and be able to add posts or comments. + +Instructions for user register: + +- Must ask for email +- Must ask for password +- When the user is taken return an error response. +- The password must be encrypted + +After the registrations the new users must be able to login into the forum. For that they will fill their credentials in the login page. + +This page must be able to check if the email provided is present in our database and if all credentials are correct. It will check if the password is the same with the one provided and if the password is not the same return an error response. + +If there is an error in the login it must be handled properly: + +- If there is an error when casting, return an error response. +- If the email is not present or incorrect return an error response. +- If the password is not present or incorrect return an error response. + +#### SQLite + +In order to store the data in your forum (like users, posts, comments, etc.) you will use the database library SQLite. + +SQLite is a popular choice as embedded database software for local/client storage in application software such as web browsers. It enables you to create a database as well as controlling it by using queries. + +- To interact with the database you should use http requests between the server and the database. +- You must use at least one SELECT, one CREATE and one INSERT query. + +To know more about SQLite you can check the [SQLite page](https://www.sqlite.org/index.html). + + +##### SQLite Usage + +- You can run queries in your database with the `sqlite3` command. +- You cannot use the command as part of your project. `sqlite3` command will be used as a way to check and test your database. +- Below we have an example on how to use the `sqlite3` command, as well as some query examples: + +```console +student$ sqlite3 database.db +SQLite version 3.29.0 2019-07-10 17:32:03 +Enter ".help" for usage hints. +sqlite> CREATE TABLE people (id INTEGER PRIMARY KEY, first_name TEXT, age INTEGER, gender TEXT); +sqlite> INSERT INTO people (first_name, age, gender) VALUES ("John", 23, "m"); +sqlite> INSERT INTO people (first_name, age, gender) VALUES ("Jade", 36, "f"); +sqlite> INSERT INTO people (first_name, age, gender) VALUES ("Kim", 49, "f"); +sqlite> SELECT * FROM people; +1|John|23|m +2|Jade|36|f +3|Kim|49|f +sqlite> DELETE FROM people WHERE gender="m"; +sqlite> SELECT * FROM people; +2|Jade|36|f +3|Kim|49|f +sqlite> ^C^C^Cstudent$ + +``` + +This project will help you learn about: + +- SQLite language. +- Manipulation of databases. +- HTTP requests. +- How to manage dependencies in Go. +- How to protect routes. + +### Instructions + +- You must use **SQLite** queries. +- You must use HTML files. +- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). +- It is recommend that the code should present a **test file**. + +### Allowed packages + +- All [standard go](https://golang.org/pkg/) packages are allowed. +- github.com/mattn/go-sqlite3 From 8a66776d16656d99a091db7dac491be094246ba5 Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 2 Mar 2020 14:40:06 +0000 Subject: [PATCH 032/146] adding docker --- subjects/forum/forum.en.md | 51 ++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index 3b3245bdd..4f6b79134 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -9,6 +9,30 @@ This project consists in creating a web forum that allows communication between You can learn more about services [here](https://medium.com/myntra-engineering/my-journey-with-golang-web-services-4d922a8c9897). +#### Docker + +For the Forum project you must use Docker, you can see all about docker basics on the [ascii-art-web-dockerize](https://public.01-edu.org/subjects/ascii-art-web/ascii-art-web-dockerize.en) subject. + +You must build a network using containers, in docker you can create your own network of containers through network drivers. Docker provides two network drivers, being `bridge` and `overlay`. + +Your objective is to use the [`bridge` network](https://docs.docker.com/engine/tutorials/networkingcontainers/) to create your own network for the services created for the forum project. Docker connected to this network by default, so docker creates a subnet and a gateway for the `bridge` network, the command `docker run` automatically adds containers to it. To inspect the network for more details you can just run `docker network inspect `. + +- You can see the default network : + +```console +student$ docker network ls +NETWORK ID NAME DRIVER SCOPE +b64130fc5aae bridge bridge local +033f3a191908 host host local +159cdc8d8083 none null local +``` + +- Each service will have to run in a container that will be associated to a docker host, a docker host must contain at least two containers/services, the containers must be connected to a bridge. + +- You must be carful, bridges are a private network, so it is restricted to a single Docker host, for instance containers can communicate within networks but not across networks. + - You may have to use [Port Mapping](https://docker-k8s-lab.readthedocs.io/en/latest/docker/port-mapping.html). + - Or attaching containers to multiple networks, that way connecting with all of the containers on all networks creating a "hub". + #### Authentication In this segment you will have to create a page that allows you to `register` new users for the forum, by inputting their credentials. You also have to create a `login session` to access te forum and be able to add posts or comments. @@ -34,17 +58,16 @@ If there is an error in the login it must be handled properly: In order to store the data in your forum (like users, posts, comments, etc.) you will use the database library SQLite. -SQLite is a popular choice as embedded database software for local/client storage in application software such as web browsers. It enables you to create a database as well as controlling it by using queries. +SQLite is a popular choice as embedded database software for local/client storage in application software such as web browsers. It enables you to create a database as well as controlling it by using queries. - To interact with the database you should use http requests between the server and the database. - You must use at least one SELECT, one CREATE and one INSERT query. To know more about SQLite you can check the [SQLite page](https://www.sqlite.org/index.html). - ##### SQLite Usage -- You can run queries in your database with the `sqlite3` command. +- You can run queries in your database with the `sqlite3` command. - You cannot use the command as part of your project. `sqlite3` command will be used as a way to check and test your database. - Below we have an example on how to use the `sqlite3` command, as well as some query examples: @@ -70,20 +93,34 @@ sqlite> ^C^C^Cstudent$ This project will help you learn about: +- Client utilities. +- The basics of web : + - Server + - HTML + - HTTP + - Services +- Learning what is [docker](https://docs.docker.com). +- Docker network bridge +- Using and [setting up Docker](https://docs.docker.com/get-started/) : + - Services and dependencies. + - Containerizing an application. + - Compatibility/Dependency. + - Creating images. + - Docker network. - SQLite language. -- Manipulation of databases. -- HTTP requests. + - Manipulation of databases. - How to manage dependencies in Go. -- How to protect routes. ### Instructions +- You must use **SQLite**. - You must use **SQLite** queries. - You must use HTML files. +- You must handle website errors, HTTP status. - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). - It is recommend that the code should present a **test file**. -### Allowed packages +### Allowed packages - All [standard go](https://golang.org/pkg/) packages are allowed. - github.com/mattn/go-sqlite3 From 0e22e62b6a2ec32bf054bdaaafcb8f4523ca17b6 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Mon, 2 Mar 2020 17:37:03 +0000 Subject: [PATCH 033/146] forum README done --- subjects/forum/forum.en.md | 108 +++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 52 deletions(-) diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index 4f6b79134..c0ad040a8 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -2,57 +2,17 @@ ### Objectives -This project consists in creating a web forum that allows communication between users through the creation of posts and comments. It also allows non-registered users to only see posts and comments. +This project consists in creating a web forum that allows : -- Your forum should work based on services. Using services to create a project means that instead of having all of your project in one location, you actually divide it in smaller "projects". -- For example if you want to create a gym application you can split it in: login/register, workouts, stats (weight, muscle mass, etc.), and so on. +- communication between users and the community through the creation of posts/comments. +- non-registered users to only see posts/comments. +- registered users to like or dislike posts/comments. +- associate posts to categories. -You can learn more about services [here](https://medium.com/myntra-engineering/my-journey-with-golang-web-services-4d922a8c9897). +Your forum should work based on services. Using services to create a project means that instead of having a monolith architecture, you actually have the various components distributed across a cluster of instances. In other words, dividing the project in smaller "projects", this way it becomes easier to understand and your project will become more scalable. +- For example for a taxi like application you can divide it in : passenger management, billing, notifications, payments, trip management and driver management. -#### Docker - -For the Forum project you must use Docker, you can see all about docker basics on the [ascii-art-web-dockerize](https://public.01-edu.org/subjects/ascii-art-web/ascii-art-web-dockerize.en) subject. - -You must build a network using containers, in docker you can create your own network of containers through network drivers. Docker provides two network drivers, being `bridge` and `overlay`. - -Your objective is to use the [`bridge` network](https://docs.docker.com/engine/tutorials/networkingcontainers/) to create your own network for the services created for the forum project. Docker connected to this network by default, so docker creates a subnet and a gateway for the `bridge` network, the command `docker run` automatically adds containers to it. To inspect the network for more details you can just run `docker network inspect `. - -- You can see the default network : - -```console -student$ docker network ls -NETWORK ID NAME DRIVER SCOPE -b64130fc5aae bridge bridge local -033f3a191908 host host local -159cdc8d8083 none null local -``` - -- Each service will have to run in a container that will be associated to a docker host, a docker host must contain at least two containers/services, the containers must be connected to a bridge. - -- You must be carful, bridges are a private network, so it is restricted to a single Docker host, for instance containers can communicate within networks but not across networks. - - You may have to use [Port Mapping](https://docker-k8s-lab.readthedocs.io/en/latest/docker/port-mapping.html). - - Or attaching containers to multiple networks, that way connecting with all of the containers on all networks creating a "hub". - -#### Authentication - -In this segment you will have to create a page that allows you to `register` new users for the forum, by inputting their credentials. You also have to create a `login session` to access te forum and be able to add posts or comments. - -Instructions for user register: - -- Must ask for email -- Must ask for password -- When the user is taken return an error response. -- The password must be encrypted - -After the registrations the new users must be able to login into the forum. For that they will fill their credentials in the login page. - -This page must be able to check if the email provided is present in our database and if all credentials are correct. It will check if the password is the same with the one provided and if the password is not the same return an error response. - -If there is an error in the login it must be handled properly: - -- If there is an error when casting, return an error response. -- If the email is not present or incorrect return an error response. -- If the password is not present or incorrect return an error response. +You can learn more about this [here](https://www.nginx.com/blog/introduction-to-microservices/). #### SQLite @@ -60,8 +20,9 @@ In order to store the data in your forum (like users, posts, comments, etc.) you SQLite is a popular choice as embedded database software for local/client storage in application software such as web browsers. It enables you to create a database as well as controlling it by using queries. -- To interact with the database you should use http requests between the server and the database. -- You must use at least one SELECT, one CREATE and one INSERT query. +To structure your database and to achieve better performance we highly advise you to take a look at the [entity relationship diagram](https://www.smartdraw.com/entity-relationship-diagram/) and build one based on your own database. + +- You must use at least one SELECT, one CREATE, one INSERT and one DELETE query. To know more about SQLite you can check the [SQLite page](https://www.sqlite.org/index.html). @@ -91,6 +52,46 @@ sqlite> ^C^C^Cstudent$ ``` +#### Authentication + +In this segment the client must be able to `register` as a new user for the forum, by inputting their credentials. You also have to create a `login session` to access the forum and be able to add posts and/or comments. + +You should use cookies to allow each user to have only one open session. Each of this sessions must contain an expiration date. It's up to you to decide what time the cookie stays "alive". + +Instructions for user registration: + +- Must ask for email +- When the email is taken return an error response. +- Must ask for username +- Must ask for password +- The password must be encrypted + +The forum must be able to check if the email provided is present in the database and if all credentials are correct. It will check if the password is the same with the one provided and if the password is not the same return an error response. + +#### Docker + +For the forum project you must use Docker. You can see all about docker basics on the [ascii-art-web-dockerize](https://public.01-edu.org/subjects/ascii-art-web/ascii-art-web-dockerize.en) subject. + +You must build a network using containers. In docker you can create your own network of containers through network drivers. Docker provides two network drivers : `bridge` and `overlay`. + +- You can see the default network : + +```console +student$ docker network ls +NETWORK ID NAME DRIVER SCOPE +b64130fc5aae bridge bridge local +033f3a191908 host host local +159cdc8d8083 none null local +``` + +Your objective is to use the [`bridge` network](https://docs.docker.com/engine/tutorials/networkingcontainers/) to create your own network for the services. Docker connects to this network by default, creating a subnet and a gateway for the `bridge` network. The command `docker run` automatically adds containers to it. To inspect the network for more details you can just run `docker network inspect `. + +- Each service will have to run in a container that will be associated to a docker host, which must contain at least two containers/services and these must be connected to a bridge. + +- You must be careful, bridges are a private network, so it is restricted to a single Docker host, for instance containers can communicate within networks but not across networks. + - You may have to use [Port Mapping](https://docker-k8s-lab.readthedocs.io/en/latest/docker/port-mapping.html). + - Or attaching containers to multiple networks connecting with all containers on all networks creating a ["hub"](https://docs.docker.com/engine/tutorials/bridge3.png). + This project will help you learn about: - Client utilities. @@ -99,17 +100,17 @@ This project will help you learn about: - HTML - HTTP - Services -- Learning what is [docker](https://docs.docker.com). + - Sessions and cookies - Docker network bridge - Using and [setting up Docker](https://docs.docker.com/get-started/) : - Services and dependencies. - Containerizing an application. - Compatibility/Dependency. - Creating images. - - Docker network. - SQLite language. - Manipulation of databases. - How to manage dependencies in Go. +- The basics of encryption. ### Instructions @@ -117,6 +118,7 @@ This project will help you learn about: - You must use **SQLite** queries. - You must use HTML files. - You must handle website errors, HTTP status. +- You must handle all sort of technical errors. - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). - It is recommend that the code should present a **test file**. @@ -124,3 +126,5 @@ This project will help you learn about: - All [standard go](https://golang.org/pkg/) packages are allowed. - github.com/mattn/go-sqlite3 +- golang.org/x/crypto/bcrypt +- github.com/satori/go.uuid \ No newline at end of file From 062f9cce029ba8e30e67d0175a0a6e63d0aa8877 Mon Sep 17 00:00:00 2001 From: lee Date: Tue, 3 Mar 2020 11:50:14 +0000 Subject: [PATCH 034/146] corrections --- subjects/forum/forum.en.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index c0ad040a8..001d6c4d5 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -9,7 +9,8 @@ This project consists in creating a web forum that allows : - registered users to like or dislike posts/comments. - associate posts to categories. -Your forum should work based on services. Using services to create a project means that instead of having a monolith architecture, you actually have the various components distributed across a cluster of instances. In other words, dividing the project in smaller "projects", this way it becomes easier to understand and your project will become more scalable. +Your forum should work based on services. Using services to create a project means that instead of having a monolith architecture, you actually have various components distributed across a cluster of instances. In other words, dividing the project in smaller "projects", this way it becomes easier to understand and your project will become more scalable. + - For example for a taxi like application you can divide it in : passenger management, billing, notifications, payments, trip management and driver management. You can learn more about this [here](https://www.nginx.com/blog/introduction-to-microservices/). @@ -20,7 +21,7 @@ In order to store the data in your forum (like users, posts, comments, etc.) you SQLite is a popular choice as embedded database software for local/client storage in application software such as web browsers. It enables you to create a database as well as controlling it by using queries. -To structure your database and to achieve better performance we highly advise you to take a look at the [entity relationship diagram](https://www.smartdraw.com/entity-relationship-diagram/) and build one based on your own database. +To structure your database and to achieve better performance we highly advise you to take a look at the [entity relationship diagram](https://www.smartdraw.com/entity-relationship-diagram/) and build one based on your own database. - You must use at least one SELECT, one CREATE, one INSERT and one DELETE query. @@ -127,4 +128,4 @@ This project will help you learn about: - All [standard go](https://golang.org/pkg/) packages are allowed. - github.com/mattn/go-sqlite3 - golang.org/x/crypto/bcrypt -- github.com/satori/go.uuid \ No newline at end of file +- github.com/satori/go.uuid From 5a5694f4336788fef2ebc3d05a57062e468432c3 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Tue, 3 Mar 2020 11:56:12 +0000 Subject: [PATCH 035/146] audit forum and sqlite --- subjects/forum/forum.audit.en.md | 66 ++++++++++++++++++++++++++++++-- subjects/forum/forum.en.md | 29 +++++++------- 2 files changed, 75 insertions(+), 20 deletions(-) diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md index 86a648aba..4f4875c4d 100644 --- a/subjects/forum/forum.audit.en.md +++ b/subjects/forum/forum.audit.en.md @@ -1,6 +1,24 @@ #### Functional -###### Has the requirement for the allowed packages been respected? +##### Enter the website as a non-registered user. + +###### Are you able to see posts/comments? + +##### Enter the website as a non-registered user. + +###### Are you prohibited to create a post/comment? + +##### Enter the website as a registered user. + +###### Are you able to create a post/comment? + +##### Try creating a post as a registered user. + +###### Are you able to choose a category for that post? + +###### Is the forum composed of services? + +#### SQLite ###### Does the code contain at least one CREATE query? @@ -8,9 +26,49 @@ ###### Does the code contain at least one SELECT query? -###### Are there HTTP requests between the database and the server? +###### Does the code contain at least one DELETE query? + +###### Is the use of the sqlite3 command missing from the code? + +##### Try registering in the forum, open the database with `sqlite3 ` and perform a query to select all the users (Example: SELECT * FROM users;). + +###### Does it present the user you created? + +##### Try creating a post in the forum, open the database with `sqlite3 ` and perform a query to select all the users (Example: SELECT * FROM post;). + +###### Does it present the post you created? + + +###### Did the server behaved as expected?(did not crashed) + +###### Does the server use the right [HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)? + +###### Has the website runned without crashing at anytime? + +###### Are all the pages working? (Absence of 404 page?) + +###### Does the project avoid [HTTP status 400](https://kinsta.com/knowledgebase/400-bad-request/#causes)? + +###### Does the project avoid [HTTP status 500](https://www.restapitutorial.com/httpstatuscodes.html)? + +###### Are the libraries used allowed? #### General -###### + - \ No newline at end of file +###### +Is the database a service? + +#### Basic + +###### +Does the project runs quickly and effectively? (Favoring recursive, no unnecessary data requests, etc) + +###### +Does the code obey the [good practices](https://public.01-edu.org/subjects/good-practices.en)? + +###### +Is there a test file for this code? + +#### 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? \ No newline at end of file diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index 001d6c4d5..d184b22e3 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -5,13 +5,12 @@ This project consists in creating a web forum that allows : - communication between users and the community through the creation of posts/comments. -- non-registered users to only see posts/comments. -- registered users to like or dislike posts/comments. - associate posts to categories. +- non-registered users to only see posts/comments. Your forum should work based on services. Using services to create a project means that instead of having a monolith architecture, you actually have various components distributed across a cluster of instances. In other words, dividing the project in smaller "projects", this way it becomes easier to understand and your project will become more scalable. -- For example for a taxi like application you can divide it in : passenger management, billing, notifications, payments, trip management and driver management. +- For example for a taxi like application you can divide it in the following services : passenger management, billing, notifications, payments, trip management and driver management. You can learn more about this [here](https://www.nginx.com/blog/introduction-to-microservices/). @@ -37,18 +36,17 @@ To know more about SQLite you can check the [SQLite page](https://www.sqlite.org student$ sqlite3 database.db SQLite version 3.29.0 2019-07-10 17:32:03 Enter ".help" for usage hints. -sqlite> CREATE TABLE people (id INTEGER PRIMARY KEY, first_name TEXT, age INTEGER, gender TEXT); -sqlite> INSERT INTO people (first_name, age, gender) VALUES ("John", 23, "m"); -sqlite> INSERT INTO people (first_name, age, gender) VALUES ("Jade", 36, "f"); -sqlite> INSERT INTO people (first_name, age, gender) VALUES ("Kim", 49, "f"); -sqlite> SELECT * FROM people; -1|John|23|m -2|Jade|36|f -3|Kim|49|f -sqlite> DELETE FROM people WHERE gender="m"; -sqlite> SELECT * FROM people; -2|Jade|36|f -3|Kim|49|f +sqlite> CREATE TABLE car (id INTEGER PRIMARY KEY, brand TEXT, year INTEGER); +sqlite> INSERT INTO car (brand, year) VALUES ("Mercedes", 2010); +sqlite> INSERT INTO car (brand, year) VALUES ("Volvo", 2018); +sqlite> INSERT INTO car (brand, year) VALUES ("Nissan", 1999); +sqlite> SELECT * FROM car; +1|Mercedes|2010 +2|Volvo|2018 +3|Nissan|1999 +sqlite> DELETE FROM car WHERE year>2000; +sqlite> SELECT * FROM car; +3|Nissan|1999 sqlite> ^C^C^Cstudent$ ``` @@ -116,7 +114,6 @@ This project will help you learn about: ### Instructions - You must use **SQLite**. -- You must use **SQLite** queries. - You must use HTML files. - You must handle website errors, HTTP status. - You must handle all sort of technical errors. From 32e42b39873b988d97f67b159ed567146d43747b Mon Sep 17 00:00:00 2001 From: lee Date: Tue, 3 Mar 2020 15:09:02 +0000 Subject: [PATCH 036/146] adding docker questions --- subjects/forum/forum.audit.en.md | 43 +++++++++++++++++++++++++++++++- subjects/forum/forum.en.md | 4 +-- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md index 4f4875c4d..acbd6224c 100644 --- a/subjects/forum/forum.audit.en.md +++ b/subjects/forum/forum.audit.en.md @@ -18,6 +18,8 @@ ###### Is the forum composed of services? +###### The communication between the services well stablish? Does the communication use [smart EndPoints](https://medium.com/@nathankpeck/microservice-principles-smart-endpoints-and-dumb-pipes-5691d410700f)(ex: Request-Response, Observer)? + #### SQLite ###### Does the code contain at least one CREATE query? @@ -38,6 +40,43 @@ ###### Does it present the post you created? +#### Authentication + +#### Docker + +###### Does the project have Dockerfiles? + +##### Try to run the command `"docker image build [OPTINS] PATH | URL | -"` to build the image using using the project Dockerfiles? +``` +student$ docker images +REPOSITORY TAG IMAGE ID CREATED SIZE + latest 85a65d66ca39 7 seconds ago 795MB +``` +###### Run the command `"docker images"` to see images. Does all images build as above? + +##### Try running the command `"docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]"` to start the containers using the images just created. +``` +student$ docker ps -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +cc8f5dcf760f ascii-art-web-docker "./server" 6 seconds ago Up 6 seconds 0.0.0.0:8080->8080/tcp ascii-art-web +``` +###### Run the command `"docker ps -a"` to see containers. Is the docker containers running as above? + +##### Try running the comment `"docker network ls"` +``` +NETWORK ID NAME DRIVER SCOPE +24560f95a216 bridge local +24560f95a216 bridge bridge local +3f12239adb4f host host local +159cdc8d8083 none null local +``` +###### Is the network a bridge driver and does it appear in the list of networks as above? + +##### Try openning a shell to the running container, using the [command](https://docs.docker.com/engine/reference/commandline/exec/) `"docker exec [OPTIONS] CONTAINER COMMAND [ARG...]"` (ex: `"docker exec -it /bin/bash"`) and ping the other container that are connected to the same network, for [example](https://docs.docker.com/engine/tutorials/networkingcontainers/). + +###### Did it ping with success? Are the multiple services/containers communicating between each other? + +###### Does the project present no [unused object](https://docs.docker.com/config/pruning/)? ###### Did the server behaved as expected?(did not crashed) @@ -57,6 +96,8 @@ ###### +Is the database a service? +###### +Does the project present a script to build the images and containers? (using a script to simplify the build) + #### Basic ###### +Does the project runs quickly and effectively? (Favoring recursive, no unnecessary data requests, etc) @@ -71,4 +112,4 @@ ###### +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? \ No newline at end of file +###### +Would you recommend/nominate this program as an example for the rest of the school? diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index d184b22e3..7ab857c5e 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -12,7 +12,7 @@ Your forum should work based on services. Using services to create a project mea - For example for a taxi like application you can divide it in the following services : passenger management, billing, notifications, payments, trip management and driver management. -You can learn more about this [here](https://www.nginx.com/blog/introduction-to-microservices/). +- Services can [communicate](https://medium.com/@nathankpeck/microservice-principles-smart-endpoints-and-dumb-pipes-5691d410700f) using : **Request-Response**, this being that one service invokes another service by making an request, usually to store or retrieve data. Or **Observer**, this is a event base communication, so one or more services are listening for an event and wen triggered they respond to the event. #### SQLite @@ -85,7 +85,7 @@ b64130fc5aae bridge bridge local Your objective is to use the [`bridge` network](https://docs.docker.com/engine/tutorials/networkingcontainers/) to create your own network for the services. Docker connects to this network by default, creating a subnet and a gateway for the `bridge` network. The command `docker run` automatically adds containers to it. To inspect the network for more details you can just run `docker network inspect `. -- Each service will have to run in a container that will be associated to a docker host, which must contain at least two containers/services and these must be connected to a bridge. +- Each service will have to run in a container that will be associated to a docker host, which must contain at least two containers/services and these must be connected to a bridge, creating a network for [example](https://docs.docker.com/engine/tutorials/bridge3.png). - You must be careful, bridges are a private network, so it is restricted to a single Docker host, for instance containers can communicate within networks but not across networks. - You may have to use [Port Mapping](https://docker-k8s-lab.readthedocs.io/en/latest/docker/port-mapping.html). From 850a9118eab95b21387bb0af96dda408f1dfd408 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Tue, 3 Mar 2020 16:25:11 +0000 Subject: [PATCH 037/146] autentication questions --- subjects/forum/forum.audit.en.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md index acbd6224c..34c8d1631 100644 --- a/subjects/forum/forum.audit.en.md +++ b/subjects/forum/forum.audit.en.md @@ -42,6 +42,30 @@ #### Authentication +##### Try to register as a new user in the forum. + +###### Is it possible to register? + +##### Try to login with the user you created. + +###### Can you login and have all the rights of a registered user? + +##### Try to login without any credentials. + +###### Does it show a warning message? + +##### Try opening two different browsers and login into one of them. Then create a new post or just add a comment. Refresh the other browser. + +###### Does it present the changes made in the logged in browser? + +###### Can you confirm that it is not possible to do it? + +###### Is it asked in the register for an email and a password? + +###### Does the project detects if the email or password are wrong? + +###### Does the project detects if the email or user name is already taken in the register? + #### Docker ###### Does the project have Dockerfiles? From 7470e2bf1d313c76350c55fd899365d093af8825 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Tue, 3 Mar 2020 16:37:59 +0000 Subject: [PATCH 038/146] add autentication questions --- subjects/forum/forum.audit.en.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md index 34c8d1631..f5c32d1d3 100644 --- a/subjects/forum/forum.audit.en.md +++ b/subjects/forum/forum.audit.en.md @@ -46,10 +46,16 @@ ###### Is it possible to register? +##### Try opening two different browsers and login into one of them. Then create a new post or just add a comment. Refresh the other browser. + +###### Can you confirm that the browser non logged remains unregistered? + ##### Try to login with the user you created. ###### Can you login and have all the rights of a registered user? +##### Are sessions present in the project? + ##### Try to login without any credentials. ###### Does it show a warning message? From 879fe6b57af4bb8332e5f7e9bf232c7cc85c3b13 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Tue, 3 Mar 2020 16:41:08 +0000 Subject: [PATCH 039/146] rm autentication questions --- subjects/forum/forum.audit.en.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md index f5c32d1d3..04c93968a 100644 --- a/subjects/forum/forum.audit.en.md +++ b/subjects/forum/forum.audit.en.md @@ -64,8 +64,6 @@ ###### Does it present the changes made in the logged in browser? -###### Can you confirm that it is not possible to do it? - ###### Is it asked in the register for an email and a password? ###### Does the project detects if the email or password are wrong? From fef99ec3926ee2889495aff30174bdc6631c22be Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 4 Mar 2020 18:02:08 +0000 Subject: [PATCH 040/146] forum security --- subjects/forum/forum-security.audit.en.md | 38 ++++++++++++++++++++ subjects/forum/forum-security.en.md | 42 +++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 subjects/forum/forum-security.audit.en.md create mode 100644 subjects/forum/forum-security.en.md diff --git a/subjects/forum/forum-security.audit.en.md b/subjects/forum/forum-security.audit.en.md new file mode 100644 index 000000000..0f58d6c95 --- /dev/null +++ b/subjects/forum/forum-security.audit.en.md @@ -0,0 +1,38 @@ +#### Functional + +##### Try opening the forum. +###### Does the URL contain HTTPS? + +###### Is the Go TLS structure well configured? + +###### Is the database encrypt? + +##### Try creating a user. Go to the database using the command `"sqlite3 "` and run `"SELECT * FROM ;"` to select all users. +###### Are the passwords encrypted? + +##### Try to login into the forum and open the inspector(CTRL+SHIFT+i) and go to the storage to see the cookies(this can be different depending on the [browser](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools)). +###### Does the session cookie present a unique identifier? + +#### General + +###### +Does the project implement their own certificates for the HTTPS protocol? + +###### +Does the project implement UUI(Universal Unique Identifier) for the user session? + +###### +Does the project implement [environment variables](https://en.wikipedia.org/wiki/Environment_variable) (.env file), for the TLS certificates? + +#### Basic + +###### +Does the project runs quickly and effectively? (no unnecessary data requests, etc) + +###### +Does the code obey the [good practices](https://public.01-edu.org/subjects/good-practices.en)? + +###### +Is there a test file for this code? + +#### 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? diff --git a/subjects/forum/forum-security.en.md b/subjects/forum/forum-security.en.md new file mode 100644 index 000000000..ebcb1cd31 --- /dev/null +++ b/subjects/forum/forum-security.en.md @@ -0,0 +1,42 @@ +## forum-security + +### Objectives + +You must follow the same [principles](https://public.01-edu.org/subjects/forum/forum.en) as the first subject. + +For this project you must take into account the security of your forum. + +- You should implement a Hypertext Transfer Protocol Secure ([HTTPS](https://www.globalsign.com/en/blog/the-difference-between-http-and-https)) protocol : + - Encrypted connection : for this you will have to generate an SSL certificate, you can think of this like a identity card for your website. You can create your certificates or use "Certificate Authorities"(CA's) + +- You should encrypt : + - Clients passwords + - Database + - Clients session cookies should be unique. For instance, the session state is stored on the server and the session should present an unique identifier. This way the client has no direct access to it. Therefore, there is no way for attackers to read or tamper with session state. + +This project will help you learn about : + +- HTTPS +- Encryption + - Database + - password + - session/cookies + - Universal Unique Identifier (UUI) + +### Hints + +- You can take a look at the `openssl` manual. +- For the session cookies you can take a look at the [Universal Unique Identifier (UUI)](https://en.wikipedia.org/wiki/Universally_unique_identifier) + +### Instructions + +- You must handle website errors, HTTPS status. +- You must handle all sort of technical errors. +- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). +- It is recommend that the code should present a **test file**. + +### Allowed packages + +- All [standard go](https://golang.org/pkg/) packages are allowed. +- golang.org/x/crypto/bcrypt +- github.com/satori/go.uuid From f4fedd58fca613a3dbcf068619d88fe3d16e3184 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Wed, 4 Mar 2020 18:28:08 +0000 Subject: [PATCH 041/146] Fix subject --- subjects/addlinkednumbers.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/addlinkednumbers.en.md b/subjects/addlinkednumbers.en.md index 393f7864e..70481c4e9 100644 --- a/subjects/addlinkednumbers.en.md +++ b/subjects/addlinkednumbers.en.md @@ -27,7 +27,7 @@ type NodeAddL struct { Num int } -func AddLinkedNumbers(num1, num1 *NodeAddL) *NodeAddL { +func AddLinkedNumbers(num1, num2 *NodeAddL) *NodeAddL { } ``` From 725c9be3a93f122a518a8efca5e43c19200f4ec0 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Wed, 4 Mar 2020 18:28:29 +0000 Subject: [PATCH 042/146] Update golang version --- scripts/go.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/go.sh b/scripts/go.sh index aef473f49..41311ed4e 100755 --- a/scripts/go.sh +++ b/scripts/go.sh @@ -6,9 +6,9 @@ script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" cd $script_dir . set.sh -wget https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz -tar -C /usr/local -xzf go1.13.7.linux-amd64.tar.gz -rm go1.13.7.linux-amd64.tar.gz +wget https://dl.google.com/go/go1.14.linux-amd64.tar.gz +tar -C /usr/local -xzf go1.14.linux-amd64.tar.gz +rm go1.14.linux-amd64.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile # Set-up all users From 1b6cb736b5f55c4141d05399c079fcc8430e0816 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 5 Mar 2020 11:00:51 +0000 Subject: [PATCH 043/146] handle instead of avoid --- subjects/ascii-art-web/ascii-art-web.audit.en.md | 4 ++-- subjects/forum/forum.audit.en.md | 4 ++-- subjects/groupie-tracker/groupie-tracker.audit.en.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/subjects/ascii-art-web/ascii-art-web.audit.en.md b/subjects/ascii-art-web/ascii-art-web.audit.en.md index afe350068..6584d8e06 100644 --- a/subjects/ascii-art-web/ascii-art-web.audit.en.md +++ b/subjects/ascii-art-web/ascii-art-web.audit.en.md @@ -71,8 +71,8 @@ o-o-o o--o o-o o o o o-o | | o o ##### Try to navigate between all the available pages in the website. ###### Are all the pages working? Does the project implement [404 status](https://www.restapitutorial.com/httpstatuscodes.html)? -###### Does the project implement HTTP status [400 bad request](https://kinsta.com/knowledgebase/400-bad-request/#causes)? -###### Does the project implement HTTP status [500 internal server error](https://www.restapitutorial.com/httpstatuscodes.html)? +###### Does the project handle [HTTP status 400 - Bad Request](https://kinsta.com/knowledgebase/400-bad-request/#causes)? +###### Does the project handle [HTTP status 500 - Internal Server Errors](https://www.restapitutorial.com/httpstatuscodes.html)? ##### Try making a request to the server (clicking a button to generate the ascii-art representation on the website) ###### Is the communication between [server and client](https://www.geeksforgeeks.org/client-server-model/) well established? diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md index 04c93968a..0179260cd 100644 --- a/subjects/forum/forum.audit.en.md +++ b/subjects/forum/forum.audit.en.md @@ -114,9 +114,9 @@ NETWORK ID NAME DRIVER SCOPE ###### Are all the pages working? (Absence of 404 page?) -###### Does the project avoid [HTTP status 400](https://kinsta.com/knowledgebase/400-bad-request/#causes)? +###### Does the project handle [HTTP status 400 - Bad Requests](https://kinsta.com/knowledgebase/400-bad-request/#causes)? -###### Does the project avoid [HTTP status 500](https://www.restapitutorial.com/httpstatuscodes.html)? +###### Does the project handle [HTTP status 500 - Internal Server Errors](https://www.restapitutorial.com/httpstatuscodes.html)? ###### Are the libraries used allowed? diff --git a/subjects/groupie-tracker/groupie-tracker.audit.en.md b/subjects/groupie-tracker/groupie-tracker.audit.en.md index 7ea387c21..0e1a2cc22 100644 --- a/subjects/groupie-tracker/groupie-tracker.audit.en.md +++ b/subjects/groupie-tracker/groupie-tracker.audit.en.md @@ -61,9 +61,9 @@ ###### Are all the pages working? (Absence of 404 page?) -###### Does the project avoid [HTTP status 400](https://kinsta.com/knowledgebase/400-bad-request/#causes)? +###### Does the project handle [HTTP status 400 - Bad Requests](https://kinsta.com/knowledgebase/400-bad-request/#causes)? -###### Does the project avoid [HTTP status 500](https://www.restapitutorial.com/httpstatuscodes.html)? +###### Does the project handle [HTTP status 500 - Internal Server Errors](https://www.restapitutorial.com/httpstatuscodes.html)? ###### Is the communication between server and client well established? From 86389edef62df34285ccfafb875b7e0341931814 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 5 Mar 2020 11:12:50 +0000 Subject: [PATCH 044/146] audits Functional fix --- subjects/ascii-art-web/ascii-art-web-stylize.audit.en.md | 2 +- subjects/ascii-art/ascii-art-fs.audit.en.md | 2 +- subjects/ascii-art/ascii-art-justify.audit.en.md | 2 +- subjects/ascii-art/ascii-art-reverse.audit.en.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/subjects/ascii-art-web/ascii-art-web-stylize.audit.en.md b/subjects/ascii-art-web/ascii-art-web-stylize.audit.en.md index c96a75cfc..8be2a6769 100644 --- a/subjects/ascii-art-web/ascii-art-web-stylize.audit.en.md +++ b/subjects/ascii-art-web/ascii-art-web-stylize.audit.en.md @@ -1,4 +1,4 @@ -#### Functional Project Questions +#### Functional ###### Does the colors used allow you to see the text properly (ex: you can't see yellow text in a white background that well)? ###### Is the design [consistent](https://digitalcommunications.wp.st-andrews.ac.uk/2016/04/07/why-is-consistency-important-in-web-design/)? (examples: every page follows the same palette of colors, is all centered or is it everything aligned to the right, etc.) diff --git a/subjects/ascii-art/ascii-art-fs.audit.en.md b/subjects/ascii-art/ascii-art-fs.audit.en.md index 8f38254e0..67f76886b 100644 --- a/subjects/ascii-art/ascii-art-fs.audit.en.md +++ b/subjects/ascii-art/ascii-art-fs.audit.en.md @@ -1,4 +1,4 @@ -#### Functional Project Questions +#### Functional ##### Try passing as arguments `"hello" standard` ``` diff --git a/subjects/ascii-art/ascii-art-justify.audit.en.md b/subjects/ascii-art/ascii-art-justify.audit.en.md index 904da7e4e..d68f87bbb 100644 --- a/subjects/ascii-art/ascii-art-justify.audit.en.md +++ b/subjects/ascii-art/ascii-art-justify.audit.en.md @@ -1,4 +1,4 @@ -#### Functional Project Questions +#### Functional ##### Try passing as arguments `"left standard --align=right"` diff --git a/subjects/ascii-art/ascii-art-reverse.audit.en.md b/subjects/ascii-art/ascii-art-reverse.audit.en.md index 2a717a566..f39cb9a3d 100644 --- a/subjects/ascii-art/ascii-art-reverse.audit.en.md +++ b/subjects/ascii-art/ascii-art-reverse.audit.en.md @@ -1,4 +1,4 @@ -#### Functional Project Questions +#### Functional ##### Try passing to the reverse flag `"--reverse=example00.txt"` the [example 00](https://public.01-edu.org/subjects/ascii-art/ascii-art-reverse-example). `Hello World` From 3fdb1a0d4c61bf9f0b00a426ed3806904db5b20a Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Fri, 28 Feb 2020 17:50:09 +0000 Subject: [PATCH 045/146] subject corrections --- subjects/alphamirror.en.md | 2 +- subjects/atoibaseprog.en.md | 2 +- subjects/compareprog.en.md | 2 +- subjects/itoaprog.en.md | 2 +- subjects/options.en.md | 2 +- subjects/revwstr.en.md | 2 +- subjects/rot13.en.md | 2 +- subjects/union.en.md | 6 +++--- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/subjects/alphamirror.en.md b/subjects/alphamirror.en.md index bb84af50c..10b8f3430 100644 --- a/subjects/alphamirror.en.md +++ b/subjects/alphamirror.en.md @@ -13,7 +13,7 @@ The final result will be followed by a newline (`'\n'`). If the number of arguments is different from 1, the program displays only a newline (`'\n'`). -### Usage +### Usage: ```console student@ubuntu:~/[[ROOT]]/alphamirror$ go build diff --git a/subjects/atoibaseprog.en.md b/subjects/atoibaseprog.en.md index 10746a06e..1740f542e 100644 --- a/subjects/atoibaseprog.en.md +++ b/subjects/atoibaseprog.en.md @@ -15,7 +15,7 @@ This means that: Write a function that takes a `string` number and its `string` base in parameters and returns its conversion as an `int`. -If the base or the `string` number is not valid it returns `0`: +If the base or the `string` number is not valid it returns `0` Validity rules for a base : diff --git a/subjects/compareprog.en.md b/subjects/compareprog.en.md index 00edb2f84..7c888463b 100644 --- a/subjects/compareprog.en.md +++ b/subjects/compareprog.en.md @@ -6,7 +6,7 @@ Write a program that behaves like the `Compare` function from the `Go` package ` This program prints a number after comparing two `string` lexicographically. -### Usage : +### Usage: ```console student@ubuntu:~/compareprog$ go build diff --git a/subjects/itoaprog.en.md b/subjects/itoaprog.en.md index 902025971..eac8e82c6 100644 --- a/subjects/itoaprog.en.md +++ b/subjects/itoaprog.en.md @@ -13,7 +13,7 @@ This means that: ### Instructions -- Write a function that simulates the behaviour of the `Itoa` function in Go. `Itoa` transforms a number represented as an`int` in a number represented as a `string`. +- Write a function that simulates the behaviour of the `Itoa` function in Go. `Itoa` transforms a number represented as an `int` in a number represented as a `string`. - For this exercise the handling of the signs + or - **does have** to be taken into account. diff --git a/subjects/options.en.md b/subjects/options.en.md index 6a04e8c29..490728dd3 100644 --- a/subjects/options.en.md +++ b/subjects/options.en.md @@ -18,7 +18,7 @@ Write a program that takes an undefined number of arguments which could be consi - A wrong `option` must print `Invalid Option` followed by a newline. -## Usage +### Usage ```console student@ubuntu:~/[[ROOT]]/test$ go build diff --git a/subjects/revwstr.en.md b/subjects/revwstr.en.md index dffa54b4e..a95f9db4f 100644 --- a/subjects/revwstr.en.md +++ b/subjects/revwstr.en.md @@ -8,7 +8,7 @@ Write a program that takes a `string` as a parameter, and prints its words in re - If the number of parameters is different from 1, the program will display newline (`'\n'`). -- In the parameters that are going to be tested, there will not be any extra spaces. (meaning that there will not be additionnal spaces at the beginning or at the end of the `string`and that words will always be separated by exactly one space). +- In the parameters that are going to be tested, there will not be any extra spaces. (meaning that there will not be additional spaces at the beginning or at the end of the `string` and that words will always be separated by exactly one space). ### Usage diff --git a/subjects/rot13.en.md b/subjects/rot13.en.md index f1da5b6ee..5f44a700b 100644 --- a/subjects/rot13.en.md +++ b/subjects/rot13.en.md @@ -5,7 +5,7 @@ Write a program that takes a `string` and displays it, replacing each of its letters by the letter 13 spaces ahead in alphabetical order. -- 'z' becomes 'm' and 'Z' becomes 'M'. Case remains unaffected. +- 'z' becomes 'm' and 'Z' becomes 'M'. The case of the letter stays the same. - The output will be followed by a newline (`'\n'`). diff --git a/subjects/union.en.md b/subjects/union.en.md index b7db67a35..3394c71a8 100644 --- a/subjects/union.en.md +++ b/subjects/union.en.md @@ -4,7 +4,7 @@ Write a program that takes two `string` and displays, without doubles, the characters that appear in either one of the `string`. -The display will be in the order characters appear in the command line, and will be followed by a newline (`'\n'`). +The display will be in the order that the characters will appear on the command line and will be followed by a newline (`'\n'`). If the number of arguments is different from 2, then the program displays newline (`'\n'`). @@ -12,9 +12,9 @@ If the number of arguments is different from 2, then the program displays newlin ```console student@ubuntu:~/[[ROOT]]/union$ go build -student@ubuntu:~/[[ROOT]]/union$ ./union zpadinton "paqefwtdjetyiytjneytjoeyjnejeyj" | cat -e +student@ubuntu:~/[[ROOT]]/union$ ./union "zpadinton" "paqefwtdjetyiytjneytjoeyjnejeyj" | cat -e zpadintoqefwjy$ -student@ubuntu:~/[[ROOT]]/union$ ./union ddf6vewg64f gtwthgdwthdwfteewhrtag6h4ffdhsd | cat -e +student@ubuntu:~/[[ROOT]]/union$ ./union "ddf6vewg64f" "gtwthgdwthdwfteewhrtag6h4ffdhsd" | cat -e df6vewg4thras$ student@ubuntu:~/[[ROOT]]/union$ ./union "rien" "cette phrase ne cache rien" | cat -e rienct phas$ From 6cec351d786bd94a0bdcb5c152bfc35812aababd Mon Sep 17 00:00:00 2001 From: MSilva95 <53977751+MSilva95@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:11:16 +0000 Subject: [PATCH 046/146] Update alphamirror.en.md --- subjects/alphamirror.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/alphamirror.en.md b/subjects/alphamirror.en.md index 10b8f3430..bb84af50c 100644 --- a/subjects/alphamirror.en.md +++ b/subjects/alphamirror.en.md @@ -13,7 +13,7 @@ The final result will be followed by a newline (`'\n'`). If the number of arguments is different from 1, the program displays only a newline (`'\n'`). -### Usage: +### Usage ```console student@ubuntu:~/[[ROOT]]/alphamirror$ go build From 2292408c58b80e08a3f3cc07cb7f56085ee9cb95 Mon Sep 17 00:00:00 2001 From: MSilva95 <53977751+MSilva95@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:11:56 +0000 Subject: [PATCH 047/146] Update compareprog.en.md --- subjects/compareprog.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/compareprog.en.md b/subjects/compareprog.en.md index 7c888463b..c57d1da93 100644 --- a/subjects/compareprog.en.md +++ b/subjects/compareprog.en.md @@ -6,7 +6,7 @@ Write a program that behaves like the `Compare` function from the `Go` package ` This program prints a number after comparing two `string` lexicographically. -### Usage: +### Usage ```console student@ubuntu:~/compareprog$ go build From d2668e96050238810d55762e5de1db7d47a4fe94 Mon Sep 17 00:00:00 2001 From: MSilva95 <53977751+MSilva95@users.noreply.github.com> Date: Thu, 5 Mar 2020 09:56:54 +0000 Subject: [PATCH 048/146] Update union.en.md --- subjects/union.en.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subjects/union.en.md b/subjects/union.en.md index 3394c71a8..a482da956 100644 --- a/subjects/union.en.md +++ b/subjects/union.en.md @@ -12,15 +12,15 @@ If the number of arguments is different from 2, then the program displays newlin ```console student@ubuntu:~/[[ROOT]]/union$ go build -student@ubuntu:~/[[ROOT]]/union$ ./union "zpadinton" "paqefwtdjetyiytjneytjoeyjnejeyj" | cat -e +student@ubuntu:~/[[ROOT]]/union$ ./union zpadinton paqefwtdjetyiytjneytjoeyjnejeyj | cat -e zpadintoqefwjy$ -student@ubuntu:~/[[ROOT]]/union$ ./union "ddf6vewg64f" "gtwthgdwthdwfteewhrtag6h4ffdhsd" | cat -e +student@ubuntu:~/[[ROOT]]/union$ ./union ddf6vewg64f gtwthgdwthdwfteewhrtag6h4ffdhsd | cat -e df6vewg4thras$ -student@ubuntu:~/[[ROOT]]/union$ ./union "rien" "cette phrase ne cache rien" | cat -e -rienct phas$ +student@ubuntu:~/[[ROOT]]/union$ ./union rien cettephrasenecacherien | cat -e +riencthas$ student@ubuntu:~/[[ROOT]]/union$ ./union | cat -e $ -student@ubuntu:~/[[ROOT]]/union$ ./union "rien" | cat -e +student@ubuntu:~/[[ROOT]]/union$ ./union rien | cat -e $ student@ubuntu:~/[[ROOT]]/union$ ``` From 9f7be2bc819598a9e480cc93c54167601024c421 Mon Sep 17 00:00:00 2001 From: MSilva95 <53977751+MSilva95@users.noreply.github.com> Date: Thu, 5 Mar 2020 10:29:56 +0000 Subject: [PATCH 049/146] Update union.en.md --- subjects/union.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/union.en.md b/subjects/union.en.md index a482da956..cef251e5d 100644 --- a/subjects/union.en.md +++ b/subjects/union.en.md @@ -16,7 +16,7 @@ student@ubuntu:~/[[ROOT]]/union$ ./union zpadinton paqefwtdjetyiytjneytjoeyjneje zpadintoqefwjy$ student@ubuntu:~/[[ROOT]]/union$ ./union ddf6vewg64f gtwthgdwthdwfteewhrtag6h4ffdhsd | cat -e df6vewg4thras$ -student@ubuntu:~/[[ROOT]]/union$ ./union rien cettephrasenecacherien | cat -e +student@ubuntu:~/[[ROOT]]/union$ ./union rien "cette phrase ne cache rien" | cat -e riencthas$ student@ubuntu:~/[[ROOT]]/union$ ./union | cat -e $ From 1be27f5aad4373e963b48ab4217ca12e4c0b9a35 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 5 Mar 2020 13:46:27 +0000 Subject: [PATCH 050/146] PrintNbr newline --- subjects/printnbr.en.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subjects/printnbr.en.md b/subjects/printnbr.en.md index 7f5233b43..09c2b918a 100644 --- a/subjects/printnbr.en.md +++ b/subjects/printnbr.en.md @@ -21,12 +21,15 @@ Here is a possible program to test your function : ```go package main -import piscine ".." - +import ( + piscine ".." + "github.com/01-edu/z01" +) func main() { piscine.PrintNbr(-123) piscine.PrintNbr(0) piscine.PrintNbr(123) + z01.PrintRune('\n') } ``` From 9d7c9696a4b1b362d670e8e5c24032994b48cfa8 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 5 Mar 2020 15:08:36 +0000 Subject: [PATCH 051/146] some corrections --- subjects/forum/forum-security.audit.en.md | 11 +++++++---- subjects/forum/forum-security.en.md | 8 +++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/subjects/forum/forum-security.audit.en.md b/subjects/forum/forum-security.audit.en.md index 0f58d6c95..c4f7922c1 100644 --- a/subjects/forum/forum-security.audit.en.md +++ b/subjects/forum/forum-security.audit.en.md @@ -5,7 +5,8 @@ ###### Is the Go TLS structure well configured? -###### Is the database encrypt? +##### Try to access the database. +###### Does the database present a password for protection? ##### Try creating a user. Go to the database using the command `"sqlite3 "` and run `"SELECT * FROM ;"` to select all users. ###### Are the passwords encrypted? @@ -13,13 +14,15 @@ ##### Try to login into the forum and open the inspector(CTRL+SHIFT+i) and go to the storage to see the cookies(this can be different depending on the [browser](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools)). ###### Does the session cookie present a unique identifier? +###### Can you configure the certificates information, either via env or config file? + +###### Are the allowed packages being respected? + #### General ###### +Does the project implement their own certificates for the HTTPS protocol? -###### +Does the project implement UUI(Universal Unique Identifier) for the user session? - -###### +Does the project implement [environment variables](https://en.wikipedia.org/wiki/Environment_variable) (.env file), for the TLS certificates? +###### +Does the project implement UUID(Universal Unique Identifier) for the user session? #### Basic diff --git a/subjects/forum/forum-security.en.md b/subjects/forum/forum-security.en.md index ebcb1cd31..a03a346b3 100644 --- a/subjects/forum/forum-security.en.md +++ b/subjects/forum/forum-security.en.md @@ -11,7 +11,7 @@ For this project you must take into account the security of your forum. - You should encrypt : - Clients passwords - - Database + - Database, for this will have to create a password for your database and encrypt the communication channel. - Clients session cookies should be unique. For instance, the session state is stored on the server and the session should present an unique identifier. This way the client has no direct access to it. Therefore, there is no way for attackers to read or tamper with session state. This project will help you learn about : @@ -21,12 +21,12 @@ This project will help you learn about : - Database - password - session/cookies - - Universal Unique Identifier (UUI) + - Universal Unique Identifier (UUID) ### Hints - You can take a look at the `openssl` manual. -- For the session cookies you can take a look at the [Universal Unique Identifier (UUI)](https://en.wikipedia.org/wiki/Universally_unique_identifier) +- For the session cookies you can take a look at the [Universal Unique Identifier (UUID)](https://en.wikipedia.org/wiki/Universally_unique_identifier) ### Instructions @@ -40,3 +40,5 @@ This project will help you learn about : - All [standard go](https://golang.org/pkg/) packages are allowed. - golang.org/x/crypto/bcrypt - github.com/satori/go.uuid +- github.com/mattn/go-sqlite3 +- golang.org/x/crypto/acme/autocert From 90a9a194f3900258276360009463564bd9fea323 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 5 Mar 2020 16:11:37 +0000 Subject: [PATCH 052/146] removing micro-services and docker networking --- subjects/forum/forum.audit.en.md | 41 ++++++++++++++++---------------- subjects/forum/forum.en.md | 33 +++---------------------- 2 files changed, 23 insertions(+), 51 deletions(-) diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md index 0179260cd..a7a85c814 100644 --- a/subjects/forum/forum.audit.en.md +++ b/subjects/forum/forum.audit.en.md @@ -16,9 +16,26 @@ ###### Are you able to choose a category for that post? -###### Is the forum composed of services? +###### Can you like or dislike a post? -###### The communication between the services well stablish? Does the communication use [smart EndPoints](https://medium.com/@nathankpeck/microservice-principles-smart-endpoints-and-dumb-pipes-5691d410700f)(ex: Request-Response, Observer)? +###### Can you like or dislike a comment? + +##### Try liking a post, then refresh the page. +###### Does the number of likes increase? + +##### Try desliking a post, then refresh the page. +###### Does the number of dislikes increase? + +##### Try to like and then dislike the same post. +###### Can you confirm that it is not possible to like and dislike the same post at the same time? + +##### Try seeing all posts from one category using the search engine. + +###### Are all posts displayed from that category? + +##### Try searching for a specific post. + +###### Does it present the expected post? #### SQLite @@ -90,40 +107,22 @@ cc8f5dcf760f ascii-art-web-docker "./server" 6 seconds ag ``` ###### Run the command `"docker ps -a"` to see containers. Is the docker containers running as above? -##### Try running the comment `"docker network ls"` -``` -NETWORK ID NAME DRIVER SCOPE -24560f95a216 bridge local -24560f95a216 bridge bridge local -3f12239adb4f host host local -159cdc8d8083 none null local -``` -###### Is the network a bridge driver and does it appear in the list of networks as above? - -##### Try openning a shell to the running container, using the [command](https://docs.docker.com/engine/reference/commandline/exec/) `"docker exec [OPTIONS] CONTAINER COMMAND [ARG...]"` (ex: `"docker exec -it /bin/bash"`) and ping the other container that are connected to the same network, for [example](https://docs.docker.com/engine/tutorials/networkingcontainers/). - -###### Did it ping with success? Are the multiple services/containers communicating between each other? - ###### Does the project present no [unused object](https://docs.docker.com/config/pruning/)? ###### Did the server behaved as expected?(did not crashed) ###### Does the server use the right [HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)? -###### Has the website runned without crashing at anytime? - ###### Are all the pages working? (Absence of 404 page?) ###### Does the project handle [HTTP status 400 - Bad Requests](https://kinsta.com/knowledgebase/400-bad-request/#causes)? ###### Does the project handle [HTTP status 500 - Internal Server Errors](https://www.restapitutorial.com/httpstatuscodes.html)? -###### Are the libraries used allowed? +###### Are the allowed packages being respected? #### General -###### +Is the database a service? - ###### +Does the project present a script to build the images and containers? (using a script to simplify the build) #### Basic diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index 7ab857c5e..b81174df5 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -7,12 +7,9 @@ This project consists in creating a web forum that allows : - communication between users and the community through the creation of posts/comments. - associate posts to categories. - non-registered users to only see posts/comments. - -Your forum should work based on services. Using services to create a project means that instead of having a monolith architecture, you actually have various components distributed across a cluster of instances. In other words, dividing the project in smaller "projects", this way it becomes easier to understand and your project will become more scalable. - -- For example for a taxi like application you can divide it in the following services : passenger management, billing, notifications, payments, trip management and driver management. - -- Services can [communicate](https://medium.com/@nathankpeck/microservice-principles-smart-endpoints-and-dumb-pipes-5691d410700f) using : **Request-Response**, this being that one service invokes another service by making an request, usually to store or retrieve data. Or **Observer**, this is a event base communication, so one or more services are listening for an event and wen triggered they respond to the event. +- likes and dislikes in posts and comments, you must take in consideration that the number of likes and dislikes must be accounted. +- searching, inside your forum, for a specific category or post + - The search bar must have typing suggestions as you write. #### SQLite @@ -71,36 +68,13 @@ The forum must be able to check if the email provided is present in the database For the forum project you must use Docker. You can see all about docker basics on the [ascii-art-web-dockerize](https://public.01-edu.org/subjects/ascii-art-web/ascii-art-web-dockerize.en) subject. -You must build a network using containers. In docker you can create your own network of containers through network drivers. Docker provides two network drivers : `bridge` and `overlay`. - -- You can see the default network : - -```console -student$ docker network ls -NETWORK ID NAME DRIVER SCOPE -b64130fc5aae bridge bridge local -033f3a191908 host host local -159cdc8d8083 none null local -``` - -Your objective is to use the [`bridge` network](https://docs.docker.com/engine/tutorials/networkingcontainers/) to create your own network for the services. Docker connects to this network by default, creating a subnet and a gateway for the `bridge` network. The command `docker run` automatically adds containers to it. To inspect the network for more details you can just run `docker network inspect `. - -- Each service will have to run in a container that will be associated to a docker host, which must contain at least two containers/services and these must be connected to a bridge, creating a network for [example](https://docs.docker.com/engine/tutorials/bridge3.png). - -- You must be careful, bridges are a private network, so it is restricted to a single Docker host, for instance containers can communicate within networks but not across networks. - - You may have to use [Port Mapping](https://docker-k8s-lab.readthedocs.io/en/latest/docker/port-mapping.html). - - Or attaching containers to multiple networks connecting with all containers on all networks creating a ["hub"](https://docs.docker.com/engine/tutorials/bridge3.png). - This project will help you learn about: - Client utilities. - The basics of web : - - Server - HTML - HTTP - - Services - Sessions and cookies -- Docker network bridge - Using and [setting up Docker](https://docs.docker.com/get-started/) : - Services and dependencies. - Containerizing an application. @@ -108,7 +82,6 @@ This project will help you learn about: - Creating images. - SQLite language. - Manipulation of databases. -- How to manage dependencies in Go. - The basics of encryption. ### Instructions From 8c1eb1e15ddfaf6e36ba70c094674a7e0042e607 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 5 Mar 2020 22:38:20 +0000 Subject: [PATCH 053/146] corrections and adding cipher suites questions --- subjects/forum/forum-security.audit.en.md | 10 +++++++++- subjects/forum/forum-security.en.md | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/subjects/forum/forum-security.audit.en.md b/subjects/forum/forum-security.audit.en.md index c4f7922c1..bd1639c49 100644 --- a/subjects/forum/forum-security.audit.en.md +++ b/subjects/forum/forum-security.audit.en.md @@ -1,20 +1,28 @@ #### Functional ##### Try opening the forum. + ###### Does the URL contain HTTPS? +###### Is the project implementing [cipher suites](https://www.iana.org/assignments/tls-parameters/tls-parameters.xml)? + ###### Is the Go TLS structure well configured? +###### Is the [server](https://golang.org/pkg/net/http/#Server) timeout reduced (Read, write and IdleTimeout)? (enabling attackers to take their time) + ##### Try to access the database. + ###### Does the database present a password for protection? ##### Try creating a user. Go to the database using the command `"sqlite3 "` and run `"SELECT * FROM ;"` to select all users. + ###### Are the passwords encrypted? ##### Try to login into the forum and open the inspector(CTRL+SHIFT+i) and go to the storage to see the cookies(this can be different depending on the [browser](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools)). + ###### Does the session cookie present a unique identifier? -###### Can you configure the certificates information, either via env or config file? +###### Does the project present a way to configure the certificates information, either via .env or config files or other method? ###### Are the allowed packages being respected? diff --git a/subjects/forum/forum-security.en.md b/subjects/forum/forum-security.en.md index a03a346b3..b6fc84870 100644 --- a/subjects/forum/forum-security.en.md +++ b/subjects/forum/forum-security.en.md @@ -17,8 +17,8 @@ For this project you must take into account the security of your forum. This project will help you learn about : - HTTPS +- [Cipher suites](https://www.iana.org/assignments/tls-parameters/tls-parameters.xml) - Encryption - - Database - password - session/cookies - Universal Unique Identifier (UUID) From cdcbdaba80fdeb4766680b7807194585510103e0 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 6 Mar 2020 10:06:29 +0000 Subject: [PATCH 054/146] union correction --- subjects/union.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/union.en.md b/subjects/union.en.md index cef251e5d..737698f40 100644 --- a/subjects/union.en.md +++ b/subjects/union.en.md @@ -17,7 +17,7 @@ zpadintoqefwjy$ student@ubuntu:~/[[ROOT]]/union$ ./union ddf6vewg64f gtwthgdwthdwfteewhrtag6h4ffdhsd | cat -e df6vewg4thras$ student@ubuntu:~/[[ROOT]]/union$ ./union rien "cette phrase ne cache rien" | cat -e -riencthas$ +rienct phas$ student@ubuntu:~/[[ROOT]]/union$ ./union | cat -e $ student@ubuntu:~/[[ROOT]]/union$ ./union rien | cat -e From 5cb03c40ea56bd20ac7df3e4d7dde4fd19365f8d Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 6 Mar 2020 11:42:56 +0000 Subject: [PATCH 055/146] adding rate limiting --- subjects/forum/forum-security.audit.en.md | 2 ++ subjects/forum/forum-security.en.md | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/subjects/forum/forum-security.audit.en.md b/subjects/forum/forum-security.audit.en.md index bd1639c49..e29e5a07f 100644 --- a/subjects/forum/forum-security.audit.en.md +++ b/subjects/forum/forum-security.audit.en.md @@ -10,6 +10,8 @@ ###### Is the [server](https://golang.org/pkg/net/http/#Server) timeout reduced (Read, write and IdleTimeout)? (enabling attackers to take their time) +###### Does the project implement [Rate limiting](https://en.wikipedia.org/wiki/Rate_limiting) (avoiding [DoS attacks](https://en.wikipedia.org/wiki/Denial-of-service_attack))? + ##### Try to access the database. ###### Does the database present a password for protection? diff --git a/subjects/forum/forum-security.en.md b/subjects/forum/forum-security.en.md index b6fc84870..2e54d6fbc 100644 --- a/subjects/forum/forum-security.en.md +++ b/subjects/forum/forum-security.en.md @@ -14,10 +14,15 @@ For this project you must take into account the security of your forum. - Database, for this will have to create a password for your database and encrypt the communication channel. - Clients session cookies should be unique. For instance, the session state is stored on the server and the session should present an unique identifier. This way the client has no direct access to it. Therefore, there is no way for attackers to read or tamper with session state. +- The implementation of [Rate Limiting](https://en.wikipedia.org/wiki/Rate_limiting) must be present on this project + This project will help you learn about : - HTTPS - [Cipher suites](https://www.iana.org/assignments/tls-parameters/tls-parameters.xml) +- Goroutines +- Channels +- Rate Limiting - Encryption - password - session/cookies From f983f6506e8a4e63d32ba629b43dae8d59433cbd Mon Sep 17 00:00:00 2001 From: OGordoo Date: Fri, 6 Mar 2020 15:49:01 +0000 Subject: [PATCH 056/146] forum clarification --- subjects/forum/forum.audit.en.md | 134 +++++++++++++++++-------------- subjects/forum/forum.en.md | 73 +++++++++-------- 2 files changed, 110 insertions(+), 97 deletions(-) diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md index a7a85c814..6f11d8c37 100644 --- a/subjects/forum/forum.audit.en.md +++ b/subjects/forum/forum.audit.en.md @@ -1,41 +1,32 @@ -#### Functional - -##### Enter the website as a non-registered user. - -###### Are you able to see posts/comments? - -##### Enter the website as a non-registered user. +#### Authentication -###### Are you prohibited to create a post/comment? +###### Is it asked in the register for an email and a password? -##### Enter the website as a registered user. +###### Does the project detects if the email or password are wrong? -###### Are you able to create a post/comment? +###### Does the project detects if the email or user name is already taken in the register? -##### Try creating a post as a registered user. +##### Try to register as a new user in the forum. -###### Are you able to choose a category for that post? +###### Is it possible to register? -###### Can you like or dislike a post? +##### Try to login with the user you created. -###### Can you like or dislike a comment? +###### Can you login and have all the rights of a registered user? -##### Try liking a post, then refresh the page. -###### Does the number of likes increase? +##### Try to login without any credentials. -##### Try desliking a post, then refresh the page. -###### Does the number of dislikes increase? +###### Does it show a warning message? -##### Try to like and then dislike the same post. -###### Can you confirm that it is not possible to like and dislike the same post at the same time? +###### Are sessions present in the project? -##### Try seeing all posts from one category using the search engine. +##### Try opening two different browsers and login into one of them. Refresh the other browser. -###### Are all posts displayed from that category? +###### Can you confirm that the browser non logged remains unregistered? -##### Try searching for a specific post. +##### Try opening two different browsers and login into one of them. Then create a new post or just add a comment. Refresh the other browser. -###### Does it present the expected post? +###### Does it present the changes made in the logged browser? #### SQLite @@ -45,10 +36,6 @@ ###### Does the code contain at least one SELECT query? -###### Does the code contain at least one DELETE query? - -###### Is the use of the sqlite3 command missing from the code? - ##### Try registering in the forum, open the database with `sqlite3 ` and perform a query to select all the users (Example: SELECT * FROM users;). ###### Does it present the user you created? @@ -57,57 +44,84 @@ ###### Does it present the post you created? -#### Authentication +##### Try creating a comment in the forum, open the database with `sqlite3 ` and perform a query to select all the users (Example: SELECT * FROM comment;). -##### Try to register as a new user in the forum. +###### Does it present the comment you created? -###### Is it possible to register? +#### Docker -##### Try opening two different browsers and login into one of them. Then create a new post or just add a comment. Refresh the other browser. +###### Does the project have Dockerfiles? -###### Can you confirm that the browser non logged remains unregistered? +##### Try to run the command `"docker image build [OPTINS] PATH | URL | -"` to build the image using using the project Dockerfiles and run the command `"docker images"` to see images. +``` +student$ docker images +REPOSITORY TAG IMAGE ID CREATED SIZE + latest 85a65d66ca39 7 seconds ago 795MB +``` +###### Does all images build as above? -##### Try to login with the user you created. +##### Try running the command `"docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]"` to start the containers using the images just created and run the command `"docker ps -a"` to see containers. +``` +student$ docker ps -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +cc8f5dcf760f "./server" 6 seconds ago Up 6 seconds 0.0.0.0:8080->8080/tcp ascii-art-web +``` +###### Is the docker containers running as above? -###### Can you login and have all the rights of a registered user? +###### Does the project present no [unused object](https://docs.docker.com/config/pruning/)? -##### Are sessions present in the project? +#### Functional -##### Try to login without any credentials. +##### Enter the forum as a non-registered user. +###### Are you prohibited to create a post? -###### Does it show a warning message? +##### Enter the forum as a non-registered user. +###### Are you prohibited to create a comment? -##### Try opening two different browsers and login into one of them. Then create a new post or just add a comment. Refresh the other browser. +##### Enter the forum as a non-registered user and try to like a comment. +###### Are you prohibited to like a post? -###### Does it present the changes made in the logged in browser? +##### Enter the forum as a non-registered user and try to dislike a comment. +###### Are you prohibited to dislike a comment? -###### Is it asked in the register for an email and a password? +##### Enter the forum as a registered user, go to a post and try to create a comment for it. +###### Were you able to create the comment? -###### Does the project detects if the email or password are wrong? +##### Enter the forum as a registered user, go to a post and try to create an empty comment for it. +###### Were you prohibited to create the comment? -###### Does the project detects if the email or user name is already taken in the register? +##### Enter the forum as a registered user and try to create a post. +###### Were you able to create a post? -#### Docker +##### Enter the forum as a registered user and try to create an empty post. +###### Were you prohibited to create the post? -###### Does the project have Dockerfiles? +##### Try creating a post as a registered user and try to choose a category for that post. +###### Were you able to choose a category for that post? -##### Try to run the command `"docker image build [OPTINS] PATH | URL | -"` to build the image using using the project Dockerfiles? -``` -student$ docker images -REPOSITORY TAG IMAGE ID CREATED SIZE - latest 85a65d66ca39 7 seconds ago 795MB -``` -###### Run the command `"docker images"` to see images. Does all images build as above? +##### Enter the forum as a registered user and try to like or dislike a post. +###### Can you like or dislike the post? -##### Try running the command `"docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]"` to start the containers using the images just created. -``` -student$ docker ps -a -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -cc8f5dcf760f ascii-art-web-docker "./server" 6 seconds ago Up 6 seconds 0.0.0.0:8080->8080/tcp ascii-art-web -``` -###### Run the command `"docker ps -a"` to see containers. Is the docker containers running as above? +##### Enter the forum as a registered user and try to like or dislike a comment. +###### Can you like or dislike the comment? -###### Does the project present no [unused object](https://docs.docker.com/config/pruning/)? +##### Enter the forum as a registered user, try liking and disliking a post and then refresh the page. +###### Does the number of likes/dislikes change? + +##### Enter the forum as a registered user and try to like and then dislike the same post. +###### Can you confirm that it is not possible that the post is liked and disliked at the same time? + +##### Enter the forum as a registered user and try seeing all of your created posts. +###### Does it present the expected posts? + +##### Enter the forum as a registered user and try seeing all of your liked posts. +###### Does it present the expected posts? + +##### Navigate to a post of your choice and see its comments. +###### Are all users (registered or not) able to see the number of likes and dislikes that comment has? + +##### Try seeing all posts from one category using the filter. +###### Are all posts displayed from that category? ###### Did the server behaved as expected?(did not crashed) diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index b81174df5..ac2cd99be 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -4,12 +4,10 @@ This project consists in creating a web forum that allows : -- communication between users and the community through the creation of posts/comments. -- associate posts to categories. -- non-registered users to only see posts/comments. -- likes and dislikes in posts and comments, you must take in consideration that the number of likes and dislikes must be accounted. -- searching, inside your forum, for a specific category or post - - The search bar must have typing suggestions as you write. +- communication between users. +- associate categories to posts. +- liking and disliking posts and comments. +- filtering posts. #### SQLite @@ -19,51 +17,54 @@ SQLite is a popular choice as embedded database software for local/client storag To structure your database and to achieve better performance we highly advise you to take a look at the [entity relationship diagram](https://www.smartdraw.com/entity-relationship-diagram/) and build one based on your own database. -- You must use at least one SELECT, one CREATE, one INSERT and one DELETE query. +- You must use at least one SELECT, one CREATE and one INSERT. To know more about SQLite you can check the [SQLite page](https://www.sqlite.org/index.html). -##### SQLite Usage - -- You can run queries in your database with the `sqlite3` command. -- You cannot use the command as part of your project. `sqlite3` command will be used as a way to check and test your database. -- Below we have an example on how to use the `sqlite3` command, as well as some query examples: - -```console -student$ sqlite3 database.db -SQLite version 3.29.0 2019-07-10 17:32:03 -Enter ".help" for usage hints. -sqlite> CREATE TABLE car (id INTEGER PRIMARY KEY, brand TEXT, year INTEGER); -sqlite> INSERT INTO car (brand, year) VALUES ("Mercedes", 2010); -sqlite> INSERT INTO car (brand, year) VALUES ("Volvo", 2018); -sqlite> INSERT INTO car (brand, year) VALUES ("Nissan", 1999); -sqlite> SELECT * FROM car; -1|Mercedes|2010 -2|Volvo|2018 -3|Nissan|1999 -sqlite> DELETE FROM car WHERE year>2000; -sqlite> SELECT * FROM car; -3|Nissan|1999 -sqlite> ^C^C^Cstudent$ - -``` - #### Authentication -In this segment the client must be able to `register` as a new user for the forum, by inputting their credentials. You also have to create a `login session` to access the forum and be able to add posts and/or comments. +In this segment the client must be able to `register` as a new user on the forum, by inputting their credentials. You also have to create a `login session` to access the forum and be able to add posts and comments. You should use cookies to allow each user to have only one open session. Each of this sessions must contain an expiration date. It's up to you to decide what time the cookie stays "alive". Instructions for user registration: - Must ask for email -- When the email is taken return an error response. + - When the email is already taken return an error response. - Must ask for username - Must ask for password -- The password must be encrypted + - The password must be encrypted The forum must be able to check if the email provided is present in the database and if all credentials are correct. It will check if the password is the same with the one provided and if the password is not the same return an error response. +#### Communication + +In order for users to communicate between each other, they will have to be able to create posts and comments. + +- Only registered users will be able to create posts and comments. +- When registered users are creating a post they can associate one or more categories to it. + - The implementation and choice of the categories is up to you. +- The posts and comments should be visible to all users (registered or not). +- Non-registered users will only be able to see posts and comments. + +#### Likes and Dislikes + +Only registered users will be able to like or dislike posts and comments. + +The number of likes and dislikes should be visible by all users (registered or not). + +#### Filter + +You need to implement a filter mechanism, that will allow users to filter the displayed posts by : + +- categories +- created posts +- liked posts + +You can look at filtering by categories as subforums. A subforum is a section of an online forum dedicated to a specific topic. + +Note that the last two are only available for registered users and must refer to the logged in user. + #### Docker For the forum project you must use Docker. You can see all about docker basics on the [ascii-art-web-dockerize](https://public.01-edu.org/subjects/ascii-art-web/ascii-art-web-dockerize.en) subject. @@ -76,7 +77,6 @@ This project will help you learn about: - HTTP - Sessions and cookies - Using and [setting up Docker](https://docs.docker.com/get-started/) : - - Services and dependencies. - Containerizing an application. - Compatibility/Dependency. - Creating images. @@ -87,7 +87,6 @@ This project will help you learn about: ### Instructions - You must use **SQLite**. -- You must use HTML files. - You must handle website errors, HTTP status. - You must handle all sort of technical errors. - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). From 582c4615d5e1102df910cf9884f5588151970ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Sat, 7 Mar 2020 14:34:06 +0000 Subject: [PATCH 057/146] SQLite is not a language --- subjects/forum/forum.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index ac2cd99be..ce8e29c9a 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -80,7 +80,7 @@ This project will help you learn about: - Containerizing an application. - Compatibility/Dependency. - Creating images. -- SQLite language. +- SQL language. - Manipulation of databases. - The basics of encryption. From 889df09ce15aa87867c131e9c8c3c5788d50d49f Mon Sep 17 00:00:00 2001 From: lee Date: Sun, 8 Mar 2020 11:37:26 +0000 Subject: [PATCH 058/146] adding cases to be more clear --- subjects/addprimesum.en.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subjects/addprimesum.en.md b/subjects/addprimesum.en.md index 418dae559..4143acaf5 100644 --- a/subjects/addprimesum.en.md +++ b/subjects/addprimesum.en.md @@ -14,9 +14,13 @@ student@ubuntu:~/[[ROOT]]/test$ ./test 5 10 student@ubuntu:~/[[ROOT]]/test$ ./test 7 17 -student@ubuntu:~/[[ROOT]]/test$ ./test 5 7 +student@ubuntu:~/[[ROOT]]/test$ ./test -2 +0 +student@ubuntu:~/[[ROOT]]/test$ ./test 0 0 student@ubuntu:~/[[ROOT]]/test$ ./test 0 +student@ubuntu:~/[[ROOT]]/test$ ./test 5 7 +0 student@ubuntu:~/[[ROOT]]/test$ ``` From 9c0f23cd2ec8722a42105dc11f6c276e3a93715b Mon Sep 17 00:00:00 2001 From: OGordoo Date: Mon, 9 Mar 2020 09:45:25 +0000 Subject: [PATCH 059/146] sqlite language removed --- subjects/forum/forum.en.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index ac2cd99be..ce5bc818e 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -76,13 +76,14 @@ This project will help you learn about: - HTML - HTTP - Sessions and cookies -- Using and [setting up Docker](https://docs.docker.com/get-started/) : - - Containerizing an application. - - Compatibility/Dependency. - - Creating images. -- SQLite language. - - Manipulation of databases. -- The basics of encryption. +- Using and [setting up Docker](https://docs.docker.com/get-started/) + - Containerizing an application + - Compatibility/Dependency + - Creating images +- SQLite + - Manipulation of databases + - SQL +- The basics of encryption ### Instructions From 1cec85d68c3b1d0ac0222893152d9df62685d3fc Mon Sep 17 00:00:00 2001 From: OGordoo Date: Mon, 9 Mar 2020 09:50:36 +0000 Subject: [PATCH 060/146] my bad, sql language --- subjects/forum/forum.en.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index ce5bc818e..5b2e40257 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -80,9 +80,8 @@ This project will help you learn about: - Containerizing an application - Compatibility/Dependency - Creating images -- SQLite +- SQL language - Manipulation of databases - - SQL - The basics of encryption ### Instructions From d4b8c0020af456b4a8a445f92a27887ca319eb43 Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 9 Mar 2020 11:09:40 +0000 Subject: [PATCH 061/146] removing standard allowed packages my-ls --- subjects/my-ls-1/my-ls-1.audit.en.md | 2 +- subjects/my-ls-1/my-ls-1.en.md | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) 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 7733b49f6..bfd6dafc4 100644 --- a/subjects/my-ls-1/my-ls-1.audit.en.md +++ b/subjects/my-ls-1/my-ls-1.audit.en.md @@ -1,6 +1,6 @@ #### Functional -###### Has the requirement for the allowed packages been respected? (Reminder for this project: (only [standard packages](https://golang.org/pkg/) +###### Has the requirement for the allowed packages been respected? ##### Run both my-ls-1 and the system command `ls` with no arguments. diff --git a/subjects/my-ls-1/my-ls-1.en.md b/subjects/my-ls-1/my-ls-1.en.md index 044c4d57c..9963191d0 100644 --- a/subjects/my-ls-1/my-ls-1.en.md +++ b/subjects/my-ls-1/my-ls-1.en.md @@ -51,10 +51,6 @@ This project will help you learn about : - We suggest that you consult the `ls` command manual. -### Allowed packages - -- Only the [standard go](https://golang.org/pkg/) packages are allowed - ### Usage You can see how the `ls` command works, by using it on your terminal. From 5c6a619b2f39747f2396645e343cfee481945eaf Mon Sep 17 00:00:00 2001 From: OGordoo Date: Mon, 9 Mar 2020 13:20:34 +0000 Subject: [PATCH 062/146] ListAt fix --- subjects/listat.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/listat.en.md b/subjects/listat.en.md index 05a1a675d..cbd6a281d 100644 --- a/subjects/listat.en.md +++ b/subjects/listat.en.md @@ -51,8 +51,8 @@ And its output : ```console student@ubuntu:~/[[ROOT]]/test$ go build student@ubuntu:~/[[ROOT]]/test$ ./test -you -hello +1 +how are student@ubuntu:~/[[ROOT]]/test$ ``` From ed7b3656bacdee7fe526628d10af8a049626b846 Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 9 Mar 2020 18:06:51 +0000 Subject: [PATCH 063/146] reverstrcap fix --- subjects/reversestrcap.en.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/subjects/reversestrcap.en.md b/subjects/reversestrcap.en.md index b9b37c2c9..a028f3b1d 100644 --- a/subjects/reversestrcap.en.md +++ b/subjects/reversestrcap.en.md @@ -7,8 +7,6 @@ Write a program that takes one or more `string` as arguments and that, **for eac in lowercase -then it displays the result followed by a newline (`'\n'`). -A word is a sequence of alphanumerical characters. - If there are no parameter, the program displays a newline. ### Usage From 79d9a065aeb753c26fd5b4d64d60e7240413e7be Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 12 Mar 2020 15:36:22 +0000 Subject: [PATCH 065/146] new exercises exam 2020 afonso --- subjects/findprevprime.en.md | 53 +++++++++++++++++++++++++++++++ subjects/grouping.en.md | 40 ++++++++++++++++++++++++ subjects/piglatin.en.md | 32 +++++++++++++++++++ subjects/slice.en.md | 60 ++++++++++++++++++++++++++++++++++++ 4 files changed, 185 insertions(+) create mode 100644 subjects/findprevprime.en.md create mode 100644 subjects/grouping.en.md create mode 100644 subjects/piglatin.en.md create mode 100644 subjects/slice.en.md diff --git a/subjects/findprevprime.en.md b/subjects/findprevprime.en.md new file mode 100644 index 000000000..1d134f769 --- /dev/null +++ b/subjects/findprevprime.en.md @@ -0,0 +1,53 @@ +## findprevprime + +## **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 the first prime number that is equal or inferior to the `int` passed as parameter. + +If there are no primes inferior to the `int` passed as parameter the function should return 0. + +### Expected function + +```go +func FindPrevPrime(nb int) int { + +} +``` + +### Usage + +Here is a possible [program](TODO-LINK) to test your function : + +```go +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(FindPrevPrime(5)) + fmt.Println(FindPrevPrime(4)) +} +``` + +And its output : + +```console +student@ubuntu:~/piscine-go/test$ go build +student@ubuntu:~/piscine-go/test$ ./test +5 +3 +student@ubuntu:~/piscine-go/test$ +``` diff --git a/subjects/grouping.en.md b/subjects/grouping.en.md new file mode 100644 index 000000000..6751df417 --- /dev/null +++ b/subjects/grouping.en.md @@ -0,0 +1,40 @@ +## grouping + +### Instructions + +Write a program that receives two strings and replicates the use of brackets in regular expressions. Brackets in regular expressions returns the words that contain the expression inside of it. + +The program should handle the "`|`" operator, that searches for both strings on each side of the operator. + +The output of the program should be the results of the regular expression by order of appearence in the string, being themselves identified by a number. + +In case the regular expression is not valid, the last argument is empty or there are no matches the program returns a newline ("`\n`"). + +If there are more than 2 or no arguments the program should print a newline ("`\n`"). + +### Usage + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(a)" "I'm heavy, jumpsuit is on steady, Lighter when I'm lower, higher when I'm heavy" +1: heavy +2: steady +3: heavy +student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(e|n)"f "I currently have 4 windows open up… and I don’t know why." +1: currently +2: currently +3: have +4: windows +5: open +6: open +7: and +8: don’t +9: know +student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(hi)" "He swore he just saw his sushi move." +1: his +2: sushi +student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(s)" "" + +student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "i" "Something in the air" + +student@ubuntu:~/[[ROOT]]/test$ diff --git a/subjects/piglatin.en.md b/subjects/piglatin.en.md new file mode 100644 index 000000000..6c4fcffa6 --- /dev/null +++ b/subjects/piglatin.en.md @@ -0,0 +1,32 @@ +## piglatin + +### Instructions + +Write a **program** that transforms a string passed as argument in its `Pig Latin` version. + +The rules used by Pig Latin are as follows: + +- If a word begins with a vowel, just add "ay" to the end. +- If it begins with a consonant, then we take all consonants before the first vowel and we put them on the end of the word and add "ay" at the end. + +If the word has no vowels the program should print "No vowels". + +If the number of arguments is different from one, the program prints a new line. + +### Usage + +```console +student@ubuntu:~/student/test$ go build +student@ubuntu:~/student/test$ ./piglatin + +student@ubuntu:~/student/test$ ./piglatin pig | cat -e +igpay$ +student@ubuntu:~/student/test$ ./piglatin Is | cat -e +Isay$ +student@ubuntu:~/student/test$ ./piglatin crunch | cat -e +unchcray$ +student@ubuntu:~/student/test$ ./piglatin crnch | cat -e +No vowels$ +student@ubuntu:~/student/test$ ./piglatin something else | cat -e +$ +``` diff --git a/subjects/slice.en.md b/subjects/slice.en.md new file mode 100644 index 000000000..48becf582 --- /dev/null +++ b/subjects/slice.en.md @@ -0,0 +1,60 @@ +## slice + +## **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 **program** that replicates the javascript functions `slice`. + +The program receives an array of strings and one or more integers, and returns an array of strings. The returned array is part of the received one but cut from the position indicated in the first int, until the position indicated by the second int. + +In case there only exists one int, the resulting array begins in the position indicated by the int and ends at the end of the received array. + +The ints can be lower than 0. + +### Expected function + +```go +func Slice(arr []string, nbrs... int) []string{ + +} +``` + + +### Usage + +Here is a possible program to test your function : + +```go +package main + +import "fmt" + +func main(){ + arr := []string{"coding", "algorithm", "ascii", "package", "golang"} + fmt.Println(arr, 1) + fmt.Println(arr, 2, 4) + fmt.Println(arr, -3) + fmt.Println(arr, -2, -1) + fmt.Println(arr, 2, 0) +} +``` + +```console +student@ubuntu:~/student/test$ go build +student@ubuntu:~/student/test$ ./test +[algorithm ascii package golang] +[ascii package] +[algorithm ascii package golang] +[package] +[] +``` \ No newline at end of file From 38f756f5649514bbbbc85ae923511569d05cd63d Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 12 Mar 2020 15:43:05 +0000 Subject: [PATCH 066/146] new exercises for exam --- subjects/chunk.en.md | 55 ++++++++++++++++++++++++++++++++ subjects/reduceint.en.md | 62 +++++++++++++++++++++++++++++++++++++ subjects/romannumbers.en.md | 27 ++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 subjects/chunk.en.md create mode 100644 subjects/reduceint.en.md create mode 100644 subjects/romannumbers.en.md diff --git a/subjects/chunk.en.md b/subjects/chunk.en.md new file mode 100644 index 000000000..eed3e2b1c --- /dev/null +++ b/subjects/chunk.en.md @@ -0,0 +1,55 @@ +## chunk + +## **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 called `Chunk` that receives as parameters a slice, `slice []int`, and an number `size int`. The goal of this function is to chunk a slice into many sub slices where each sub slice has the length of `size`. + +- If the `size` is `0` it should print `\n` + +### Expected function + +```go +func Chunk(slice []int, size int) { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +func main() { + Chunk([]int{}, 10) + Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 0) + Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 3) + Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 5) + Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 4) +} +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +[] + +[[0 1 2] [3 4 5] [6 7]] +[[0 1 2 3 4] [5 6 7]] +[[0 1 2 3] [4 5 6 7]] +student@ubuntu:~/[[ROOT]]/test$ +``` diff --git a/subjects/reduceint.en.md b/subjects/reduceint.en.md new file mode 100644 index 000000000..97e32837c --- /dev/null +++ b/subjects/reduceint.en.md @@ -0,0 +1,62 @@ +## reduceint + +## **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 called `reduceint` that simulates the behaviour of reduce from JavaScript. + +The function should have as parameters a function, `f func(int, int) int` and a slice of integers, `slice []int`. You should apply for each element of the slice the arithmetic function, saving it and printing. + +### Expected function + +```go +func ReduceInt(f func(int, int) int, slice []int) { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +func main() { + mul := func(acc int, cur int) int { + return acc * cur + } + sum := func(acc int, cur int) int { + return acc + cur + } + div := func(acc int, cur int) int { + return acc / cur + } + as := []int{500, 2} + ReduceInt(mul, as) + ReduceInt(sum, as) + ReduceInt(div, as) +} + +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +1000 +502 +250 +student@ubuntu:~/[[ROOT]]/test$ +``` diff --git a/subjects/romannumbers.en.md b/subjects/romannumbers.en.md new file mode 100644 index 000000000..59184505d --- /dev/null +++ b/subjects/romannumbers.en.md @@ -0,0 +1,27 @@ +## romannumbers + +### Instructions + +Write a program called `rn`. The objective is to converte a number, given has argument, into a roman number and print it with roman number calculation. + +The program should have a limit of `4000`. In case of an invalid number, for example `"hello"` or `0` the program should print `ERROR: can not convert to roman digit`. + +## Usage + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./rn hello +ERROR: can not convert to roman digit +student@ubuntu:~/[[ROOT]]/test$ ./rn 123 +C+X+X+I+I+I +CXXIII +student@ubuntu:~/[[ROOT]]/test$ ./rn 999 +(M-C)+(C-X)+(X-I) +CMXCIX +student@ubuntu:~/[[ROOT]]/test$ ./rn 3999 +M+M+M+(M-C)+(C-X)+(X-I) +MMMCMXCIX +student@ubuntu:~/[[ROOT]]/test$ ./rn 4000 +ERROR: can not convert to roman digit +student@ubuntu:~/[[ROOT]]/test$ +``` From 2044a47e2d1cc569f1b65eabee9743b78fbc0b95 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 12 Mar 2020 17:14:06 +0000 Subject: [PATCH 067/146] revivethreenums alem exercise --- subjects/revivethreenums.en.md | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 subjects/revivethreenums.en.md diff --git a/subjects/revivethreenums.en.md b/subjects/revivethreenums.en.md new file mode 100644 index 000000000..7a407aac4 --- /dev/null +++ b/subjects/revivethreenums.en.md @@ -0,0 +1,47 @@ +## revive_three_nums + +### Instructions + +It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). +Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. + +The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. + +There are basically three integers: **a**, **b**, **c**. You are given 4 integers: **b+c**, **a+b**, **c+a**, **a+b+c** (not necessarily in this order). Return maximum of a, b, c. + +### Expected function + +```go +func Revive_three_nums(a, b, c, d int) int { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(Revive_three_nums(3, 6, 5, 4)) + fmt.Println(Revive_three_nums(40, 40, 40, 60)) + fmt.Println(Revive_three_nums(201, 101, 101, 200)) +} +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +3 +20 +100 +student@ubuntu:~/[[ROOT]]/test$ +``` From 8b322974ecb5af69be28009093b52770cddbeec0 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Thu, 12 Mar 2020 17:30:13 +0000 Subject: [PATCH 068/146] foldint subject --- subjects/foldint.en.md | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 subjects/foldint.en.md diff --git a/subjects/foldint.en.md b/subjects/foldint.en.md new file mode 100644 index 000000000..582668752 --- /dev/null +++ b/subjects/foldint.en.md @@ -0,0 +1,64 @@ +## foldint + +## **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 called `FoldInt` that simulates the behavior of reduce from JavaScript. + +The function should have as parameters a function, `f func(int, int) int` a slice of integers, `slice []int` and an int `acc int`. You should apply for each element of the slice the arithmetic function, saving and printing it. The function will be tested with our own functions `Add, Sub, and Mul`. + +### Expected function + +```go +func FoldInt(f func(int, int) int, slice []int, acc int) { + +} +``` + +### Usage + +Here is a possible program to test your function: + +```go +package main + +func main() { + table := []int{1, 2, 3} + ac := 93 + FoldInt(Add, table, ac) + FoldInt(Mul, table, ac) + FoldInt(Sub, table, ac) + fmt.Println() + + table = []int{0} + FoldInt(Add, table, ac) + FoldInt(Mul, table, ac) + FoldInt(Sub, table, ac) +} + +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +99 +558 +87 + +93 +0 +93 +student@ubuntu:~/[[ROOT]]/test$ +``` From ccb2c5ff992eab096f5ddc4852feb4b29489d3b6 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 12 Mar 2020 18:49:36 +0000 Subject: [PATCH 069/146] sweetproblem exam exercise alem --- subjects/sweetproblem.en.md | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 subjects/sweetproblem.en.md diff --git a/subjects/sweetproblem.en.md b/subjects/sweetproblem.en.md new file mode 100644 index 000000000..f5f931514 --- /dev/null +++ b/subjects/sweetproblem.en.md @@ -0,0 +1,47 @@ +## sweet_problem + +### Instructions + +It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). +Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. + +The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. + +Madina loves sweets, but she only has 3 types of sweets: red, green, blue. Her diet has some restrictions, she must not eat more than 2 sweets per day, and they must be of different color. Help her eat as many sweets as possible, return the maximum number of days she can keep eating 2 different sweets. + +### Expected function + +```go +func Sweet_problem(red, green, blue int) int { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(Sweetproblem(1, 1, 1)) + fmt.Println(Sweetproblem(7, 4, 10)) + fmt.Println(Sweetproblem(8, 2, 8)) +} +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +1 +10 +9 +student@ubuntu:~/[[ROOT]]/test$ +``` From 7a9ee461a9510c6dfec3304c09298422734a0ca9 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 12 Mar 2020 19:11:32 +0000 Subject: [PATCH 070/146] Update romannumbers.en.md --- subjects/romannumbers.en.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/subjects/romannumbers.en.md b/subjects/romannumbers.en.md index 59184505d..dbf8eb720 100644 --- a/subjects/romannumbers.en.md +++ b/subjects/romannumbers.en.md @@ -2,9 +2,33 @@ ### Instructions -Write a program called `rn`. The objective is to converte a number, given has argument, into a roman number and print it with roman number calculation. +Write a program called `rn`. The objective is to convert a number, given as an argument, into a roman number and print it with its roman number calculation. -The program should have a limit of `4000`. In case of an invalid number, for example `"hello"` or `0` the program should print `ERROR: can not convert to roman digit`. +The program should have a limit of `4000`. In case of an invalid number, for example `"hello"` or `0` the program should print `ERROR: can not convert to roman number`. + +Roman Numerals reminder: +I -> 1 +V -> 5 +X -> 10 +L -> 50 +C -> 100 +D -> 500 +M -> 1000 + +For example, the number 1732 would be denoted MDCCXXXII in Roman numerals. However, Roman numerals are not a purely additive number system. In particular, instead of using four symbols to represent a 4, 40, 9, 90, etc. (i.e., IIII, XXXX, VIIII, LXXXX, etc.), such numbers are instead denoted by preceding the symbol for 5, 50, 10, 100, etc., with a symbol indicating subtraction. For example, 4 is denoted IV, 9 as IX, 40 as XL, etc. + +The following table gives the Roman numerals for the first few positive integers. + +1 I 11 XI 21 XXI +2 II 12 XII 22 XXII +3 III 13 XIII 23 XXIII +4 IV 14 XIV 24 XXIV +5 V 15 XV 25 XXV +6 VI 16 XVI 26 XXVI +7 VII 17 XVII 27 XXVII +8 VIII 18 XVIII 28 XXVIII +9 IX 19 XIX 29 XXIX +10 X 20 XX 30 XXX ## Usage @@ -22,6 +46,6 @@ student@ubuntu:~/[[ROOT]]/test$ ./rn 3999 M+M+M+(M-C)+(C-X)+(X-I) MMMCMXCIX student@ubuntu:~/[[ROOT]]/test$ ./rn 4000 -ERROR: can not convert to roman digit +ERROR: can not convert to roman number student@ubuntu:~/[[ROOT]]/test$ ``` From 055016d1811dd1ff58c9b6107e55e4c2f4e0620c Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 12 Mar 2020 19:15:49 +0000 Subject: [PATCH 071/146] Update romannumbers.en.md --- subjects/romannumbers.en.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subjects/romannumbers.en.md b/subjects/romannumbers.en.md index dbf8eb720..19fd5a530 100644 --- a/subjects/romannumbers.en.md +++ b/subjects/romannumbers.en.md @@ -7,6 +7,17 @@ Write a program called `rn`. The objective is to convert a number, given as an a The program should have a limit of `4000`. In case of an invalid number, for example `"hello"` or `0` the program should print `ERROR: can not convert to roman number`. Roman Numerals reminder: + +| I | 1 | +|:-:|:----:| +| V | 5 | +| X | 10 | +| L | 50 | +| C | 100 | +| D | 500 | +| M | 1000 | + + I -> 1 V -> 5 X -> 10 From 2575987edea0dc821c2a648085099cc85660fdf3 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 12 Mar 2020 19:24:25 +0000 Subject: [PATCH 072/146] Update romannumbers.en.md --- subjects/romannumbers.en.md | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/subjects/romannumbers.en.md b/subjects/romannumbers.en.md index 19fd5a530..c1015d768 100644 --- a/subjects/romannumbers.en.md +++ b/subjects/romannumbers.en.md @@ -9,7 +9,6 @@ The program should have a limit of `4000`. In case of an invalid number, for exa Roman Numerals reminder: | I | 1 | -|:-:|:----:| | V | 5 | | X | 10 | | L | 50 | @@ -17,29 +16,20 @@ Roman Numerals reminder: | D | 500 | | M | 1000 | - -I -> 1 -V -> 5 -X -> 10 -L -> 50 -C -> 100 -D -> 500 -M -> 1000 - For example, the number 1732 would be denoted MDCCXXXII in Roman numerals. However, Roman numerals are not a purely additive number system. In particular, instead of using four symbols to represent a 4, 40, 9, 90, etc. (i.e., IIII, XXXX, VIIII, LXXXX, etc.), such numbers are instead denoted by preceding the symbol for 5, 50, 10, 100, etc., with a symbol indicating subtraction. For example, 4 is denoted IV, 9 as IX, 40 as XL, etc. The following table gives the Roman numerals for the first few positive integers. -1 I 11 XI 21 XXI -2 II 12 XII 22 XXII -3 III 13 XIII 23 XXIII -4 IV 14 XIV 24 XXIV -5 V 15 XV 25 XXV -6 VI 16 XVI 26 XXVI -7 VII 17 XVII 27 XXVII -8 VIII 18 XVIII 28 XXVIII -9 IX 19 XIX 29 XXIX -10 X 20 XX 30 XXX +| 1 | I | 11 | XI | 21 | XXI | +| 2 | II | 12 | XII | 22 | XXII | +| 3 | III | 13 | XIII | 23 | XXIII | +| 4 | IV | 14 | XIV | 24 | XXIV | +| 5 | V | 15 | XV | 25 | XXV | +| 6 | VI | 16 | XVI | 26 | XXVI | +| 7 | VII | 17 | XVII | 27 | XXVII | +| 8 | VIII | 18 | XVIII | 28 | XXVIII | +| 9 | XIX | 19 | XIX | 29 | XXIX | +| 10 | X | 20 | XX | 30 | XXX | ## Usage From 54e34c47df82815981f27b1a04c5935af7ef90b0 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 12 Mar 2020 19:25:59 +0000 Subject: [PATCH 073/146] Update romannumbers.en.md --- subjects/romannumbers.en.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subjects/romannumbers.en.md b/subjects/romannumbers.en.md index c1015d768..1096f0063 100644 --- a/subjects/romannumbers.en.md +++ b/subjects/romannumbers.en.md @@ -9,6 +9,7 @@ The program should have a limit of `4000`. In case of an invalid number, for exa Roman Numerals reminder: | I | 1 | +|:-:|:----:| | V | 5 | | X | 10 | | L | 50 | @@ -21,6 +22,7 @@ For example, the number 1732 would be denoted MDCCXXXII in Roman numerals. Howev The following table gives the Roman numerals for the first few positive integers. | 1 | I | 11 | XI | 21 | XXI | +|:--:|:----:|:--:|:-----:|:--:|:------:| | 2 | II | 12 | XII | 22 | XXII | | 3 | III | 13 | XIII | 23 | XXIII | | 4 | IV | 14 | XIV | 24 | XXIV | From a46f5c5bc11fb7d07152e676e6b0b30639cf253a Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 12 Mar 2020 19:54:55 +0000 Subject: [PATCH 074/146] Update grouping.en.md --- subjects/grouping.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/grouping.en.md b/subjects/grouping.en.md index 6751df417..0cb783c06 100644 --- a/subjects/grouping.en.md +++ b/subjects/grouping.en.md @@ -10,7 +10,7 @@ The output of the program should be the results of the regular expression by ord In case the regular expression is not valid, the last argument is empty or there are no matches the program returns a newline ("`\n`"). -If there are more than 2 or no arguments the program should print a newline ("`\n`"). +If the number of arguments is different from 2 the program should print a newline ("`\n`"). ### Usage @@ -20,7 +20,7 @@ student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(a)" "I'm heavy, jumpsuit is on s 1: heavy 2: steady 3: heavy -student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(e|n)"f "I currently have 4 windows open up… and I don’t know why." +student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(e|n)" "I currently have 4 windows open up… and I don’t know why." 1: currently 2: currently 3: have From 52d675626d0c48eb5aab4e65502a300e6c8c97f0 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 12 Mar 2020 19:58:06 +0000 Subject: [PATCH 075/146] Update piglatin.en.md --- subjects/piglatin.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/piglatin.en.md b/subjects/piglatin.en.md index 6c4fcffa6..890e6ba05 100644 --- a/subjects/piglatin.en.md +++ b/subjects/piglatin.en.md @@ -11,7 +11,7 @@ The rules used by Pig Latin are as follows: If the word has no vowels the program should print "No vowels". -If the number of arguments is different from one, the program prints a new line. +If the number of arguments is different from one, the program prints a newline ("`\n`"). ### Usage From 5bd1c842379be66c22f78cb06b2370c8c37ec1b1 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 12 Mar 2020 20:01:40 +0000 Subject: [PATCH 076/146] Update slice.en.md --- subjects/slice.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/slice.en.md b/subjects/slice.en.md index 48becf582..45f0f1d2f 100644 --- a/subjects/slice.en.md +++ b/subjects/slice.en.md @@ -13,7 +13,7 @@ This means that: ### Instructions -Write a **program** that replicates the javascript functions `slice`. +Write a **program** that replicates the javascript function `slice`. The program receives an array of strings and one or more integers, and returns an array of strings. The returned array is part of the received one but cut from the position indicated in the first int, until the position indicated by the second int. @@ -57,4 +57,4 @@ student@ubuntu:~/student/test$ ./test [algorithm ascii package golang] [package] [] -``` \ No newline at end of file +``` From a0c8d86f6241171194ca14207c159504d5833a1d Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 12 Mar 2020 20:02:16 +0000 Subject: [PATCH 077/146] costumeprofit exercise for exam --- subjects/costumeprofit.en.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 subjects/costumeprofit.en.md diff --git a/subjects/costumeprofit.en.md b/subjects/costumeprofit.en.md new file mode 100644 index 000000000..778db6af2 --- /dev/null +++ b/subjects/costumeprofit.en.md @@ -0,0 +1,22 @@ +## costumeprofit + +### Instructions + +Shop is selling **a** ties, **b** scarfs, **c** waistcoats, **d** jackets. + +- You want to make a costume. There are 2 types of costumes : + - 1 - costume composed of tie and jacket. + - 2 - costume composed of scarf, waistcoat, and jacket. + +Costumes of first type cost **e** dollars, of second type cost **f** dollars. + +What is the maximum amount of dollars that shop can earn by selling costumes? + +Input will be given as 6 arguments, your output should be displayed as standard output. + +Input: `./main **a** **b** **c** **d** **e** **f**` + +```console +$> ./main 12 11 13 20 4 6 +102 +``` From 82e0598992f13f40616d0a5ae13bf8440c8c380d Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 12 Mar 2020 20:10:24 +0000 Subject: [PATCH 078/146] fix slice example --- subjects/slice.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/slice.en.md b/subjects/slice.en.md index 45f0f1d2f..54f75289f 100644 --- a/subjects/slice.en.md +++ b/subjects/slice.en.md @@ -54,7 +54,7 @@ student@ubuntu:~/student/test$ go build student@ubuntu:~/student/test$ ./test [algorithm ascii package golang] [ascii package] -[algorithm ascii package golang] +[ascii package golang] [package] [] ``` From 4e130c195f8df9c7b46e5bc426091a9845863c7c Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 12 Mar 2020 21:12:45 +0000 Subject: [PATCH 079/146] doppelganger exercise for the exam --- subjects/doppelganger.en.md | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 subjects/doppelganger.en.md diff --git a/subjects/doppelganger.en.md b/subjects/doppelganger.en.md new file mode 100644 index 000000000..fe03ff3c6 --- /dev/null +++ b/subjects/doppelganger.en.md @@ -0,0 +1,47 @@ +## doppelganger + +## **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 2 strings. Find out if first string contains second string. If it does, return index of the first string where second string occurs last time. If it does not contain, return "-1" + +### Expected function + +```go +package main + +func DoppelGanger(big, little string) int { + +} +``` + +```go +package main + +import ( + "fmt" +) + +func main() { + var result int + + result = DoppelGanger("aaaaaaa", "a") + fmt.Println(result) // 6 + + result = DoppelGanger("qwerty", "t") + fmt.Println(result) // 4 + + result = DoppelGanger("a", "b") + fmt.Println(result) // -1 +} +``` From 3ff29fb0f6d3b11ee50ffc80cfa7f6167c24cc4a Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Thu, 12 Mar 2020 22:27:40 +0000 Subject: [PATCH 080/146] subject for volumechanger exercise --- subjects/volumechanger.en.md | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 subjects/volumechanger.en.md diff --git a/subjects/volumechanger.en.md b/subjects/volumechanger.en.md new file mode 100644 index 000000000..507a3b98a --- /dev/null +++ b/subjects/volumechanger.en.md @@ -0,0 +1,49 @@ +## volume_changer + +### Instructions + +It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). +Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. + +Dagar loves watching TV. He always makes the volume to be **b**. Today he is angry, because he found out that someone changed the volume, and now, the volume is **a**. +His remote controller can change the volume by: -5, -2, -1, +1, +2, +5. +Please help Dagar, to minimize number of button presses, and calculate how many times he should press buttons of remote controller so that it changes from **a** to **b**. +There are **t** requests in total. +Input and output should be displayed in standard input and output respectively. + +### Expected function + +```go +func Revive_three_nums(a, b int) int { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(Volume_changer(4, 0)) + fmt.Println(Volume_changer(5, 14)) + fmt.Println(Volume_changer(3, 9)) +} +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +2 +3 +2 +student@ubuntu:~/[[ROOT]]/test$ +``` From 3f9344b2a857bcb8dadd1bf60e4dbf16bb28f551 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 12 Mar 2020 22:27:46 +0000 Subject: [PATCH 081/146] halfcontest --- subjects/halfcontest.en.md | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 subjects/halfcontest.en.md diff --git a/subjects/halfcontest.en.md b/subjects/halfcontest.en.md new file mode 100644 index 000000000..f7a77f9af --- /dev/null +++ b/subjects/halfcontest.en.md @@ -0,0 +1,48 @@ +## halfcontest + +### Instructions + +It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). +Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. + +The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. + +You are given 4 non-negative integers 'h1', 'm1', 'h2', and 'm2'. The contest starts at h1:m1 minutes and finishes at h2:m2 minutes. Your task is to find out when half of the contest will be over and return it in the format decribed in the example. +Contest cannot finish before it was started. + +### Expected function + +```go +func Halfcontest(h1, m1, h2, m2 int) int { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(Halfcontest(1, 15, 3, 33)) + fmt.Println(Halfcontest(10, 3, 11, 55)) + fmt.Println(Halfcontest(9, 2, 11, 3)) +} +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +224 +1059 +1002 +student@ubuntu:~/[[ROOT]]/test$ +``` From f863aa3063eaa10e604006be28c8da712d588814 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 12 Mar 2020 22:33:18 +0000 Subject: [PATCH 082/146] fib subject --- subjects/fib.en.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 subjects/fib.en.md diff --git a/subjects/fib.en.md b/subjects/fib.en.md new file mode 100644 index 000000000..04b0d6970 --- /dev/null +++ b/subjects/fib.en.md @@ -0,0 +1,49 @@ +## fib + +### Instructions + +It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). +Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. + +The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. + +You are given a non-negative integer n, please find nth element of fibonacci sequence. +Fib(0) = 0, +Fib(1) = 1, otherwise, nth element is the sum of the 2 previous elements of the series. + +### Expected function + +```go +func Fib(n int) int { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(Fib(0)) + fmt.Println(Fib(1)) + fmt.Println(Fib(2)) +} +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +0 +1 +1 +student@ubuntu:~/[[ROOT]]/test$ +``` \ No newline at end of file From 7c8d84a989d357bafbae7762b4306f7ca58cfe4d Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Thu, 12 Mar 2020 22:52:41 +0000 Subject: [PATCH 083/146] subject for exercise game23 --- subjects/game23.en.md | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 subjects/game23.en.md diff --git a/subjects/game23.en.md b/subjects/game23.en.md new file mode 100644 index 000000000..79f6019b5 --- /dev/null +++ b/subjects/game23.en.md @@ -0,0 +1,47 @@ +## game23 + +### Instructions + +It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). +Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. + +The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. + +You are given 2 positive integers 'a' and 'b'. Your task is to perform some operations in 'a' so that it becomes 'b'. You can only multiply 'a' by 2, and multiply 'a' by 3. If you can get to 'b', return minimal number of operations required to get from 'a' to 'b'. If you cannot get to 'b' return -1. + +### Expected function + +```go +func Game23(a, b int) int { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(Game23(1, 3)) + fmt.Println(Game23(2, 3)) + fmt.Println(Game23(10, 60)) +} +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +1 +-1 +2 +student@ubuntu:~/[[ROOT]]/test$ +``` From 8872b4b6bcf59526072c458cbc6f535dd7e23867 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 12 Mar 2020 22:59:32 +0000 Subject: [PATCH 084/146] reachable_number subject --- subjects/reachable_number.en.md | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 subjects/reachable_number.en.md diff --git a/subjects/reachable_number.en.md b/subjects/reachable_number.en.md new file mode 100644 index 000000000..e9d2dd196 --- /dev/null +++ b/subjects/reachable_number.en.md @@ -0,0 +1,42 @@ +## reachable_number + +### Instructions + +Let us define a function f(x) by the following: first we add 1 to x, and then while the last digit of the number equals 0, we shall be deleting 0. Let us call 'y' reachable if we can apply **f** to **x** (zero or more times), and get **y**. 102 is reachable from 10098: f(f(f(10098))) = f(f(10099)) = f(101) = f(102). Any number is reachable from itself. You are given a positive number **n**, count how many integers are reachable from **n**. + +### Expected function + +```go +func Reachable_number(n int) int { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(Reachable_number(1)) + fmt.Println(Reachable_number(10)) + fmt.Println(Reachable_number(1001)) +} +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +9 +19 +36 +student@ubuntu:~/[[ROOT]]/test$ +``` \ No newline at end of file From 04d374b60d46397f4dcab6af162291f5152f58fb Mon Sep 17 00:00:00 2001 From: LEEDASILVA <39002521+LEEDASILVA@users.noreply.github.com> Date: Thu, 12 Mar 2020 23:11:09 +0000 Subject: [PATCH 085/146] Update reachable_number.en.md --- subjects/reachable_number.en.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subjects/reachable_number.en.md b/subjects/reachable_number.en.md index e9d2dd196..5de6f30c4 100644 --- a/subjects/reachable_number.en.md +++ b/subjects/reachable_number.en.md @@ -7,7 +7,7 @@ Let us define a function f(x) by the following: first we add 1 to x, and then wh ### Expected function ```go -func Reachable_number(n int) int { +func Reachablenumber(n int) int { } ``` @@ -24,9 +24,9 @@ import ( ) func main() { - fmt.Println(Reachable_number(1)) - fmt.Println(Reachable_number(10)) - fmt.Println(Reachable_number(1001)) + fmt.Println(Reachablenumber(1)) + fmt.Println(Reachablenumber(10)) + fmt.Println(Reachablenumber(1001)) } ``` @@ -39,4 +39,4 @@ student@ubuntu:~/[[ROOT]]/test$ ./test 19 36 student@ubuntu:~/[[ROOT]]/test$ -``` \ No newline at end of file +``` From 1f11c4e7eb206afd02fc87861d6d6ac2a9659dd8 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 12 Mar 2020 23:23:06 +0000 Subject: [PATCH 086/146] nenokku --- subjects/nenokku.en.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 subjects/nenokku.en.md diff --git a/subjects/nenokku.en.md b/subjects/nenokku.en.md new file mode 100644 index 000000000..f67080e05 --- /dev/null +++ b/subjects/nenokku.en.md @@ -0,0 +1,20 @@ +## nenokku + +### Instructions + +You are given unknown amount of operations. There are 3 types of operations, you should handle each appropriately: +1. "A word" - add the "word" into your "dictionary" of words. +2. "? word" - check if the "word" is in your "dictionary". +3. "x word" - end of operations. + +Intersection of words is counted as if it is in your dictionary (see example). +Write a program that takes as arguments operations. + +```console +$> ./main "? love" "? is" "A loveis" "? love" "? Who" "A Whoareyou" "? is" +NO +NO +YES +NO +YES +``` \ No newline at end of file From 801a93b0a24c7bcefb9f08938cff5d6ab330ae23 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 12 Mar 2020 23:36:08 +0000 Subject: [PATCH 087/146] adding prog to findprevprime --- subjects/{findprevprime.en.md => findprevprimeprog.en.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename subjects/{findprevprime.en.md => findprevprimeprog.en.md} (100%) diff --git a/subjects/findprevprime.en.md b/subjects/findprevprimeprog.en.md similarity index 100% rename from subjects/findprevprime.en.md rename to subjects/findprevprimeprog.en.md From 6b2a0c2030e9464ea6e23cdc1b187e67fbd5523e Mon Sep 17 00:00:00 2001 From: LEEDASILVA <39002521+LEEDASILVA@users.noreply.github.com> Date: Thu, 12 Mar 2020 23:38:00 +0000 Subject: [PATCH 088/146] Update volumechanger.en.md --- subjects/volumechanger.en.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subjects/volumechanger.en.md b/subjects/volumechanger.en.md index 507a3b98a..00cd5bba8 100644 --- a/subjects/volumechanger.en.md +++ b/subjects/volumechanger.en.md @@ -1,4 +1,4 @@ -## volume_changer +## volumechanger ### Instructions @@ -14,7 +14,7 @@ Input and output should be displayed in standard input and output respectively. ### Expected function ```go -func Revive_three_nums(a, b int) int { +func Volumechanger(a, b int) int { } ``` @@ -31,9 +31,9 @@ import ( ) func main() { - fmt.Println(Volume_changer(4, 0)) - fmt.Println(Volume_changer(5, 14)) - fmt.Println(Volume_changer(3, 9)) + fmt.Println(Volumechanger(4, 0)) + fmt.Println(Volumechanger(5, 14)) + fmt.Println(Volumechanger(3, 9)) } ``` From bbb27e4be5713b93c9d9d817837bd83f4367695c Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 13 Mar 2020 00:30:33 +0000 Subject: [PATCH 089/146] correction to foldint --- subjects/foldint.en.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/subjects/foldint.en.md b/subjects/foldint.en.md index 582668752..ee0557917 100644 --- a/subjects/foldint.en.md +++ b/subjects/foldint.en.md @@ -20,7 +20,7 @@ The function should have as parameters a function, `f func(int, int) int` a slic ### Expected function ```go -func FoldInt(f func(int, int) int, slice []int, acc int) { +func FoldInt(f func(int, int) int, arr []int, n int) { } ``` @@ -33,14 +33,14 @@ Here is a possible program to test your function: package main func main() { - table := []int{1, 2, 3} - ac := 93 - FoldInt(Add, table, ac) - FoldInt(Mul, table, ac) - FoldInt(Sub, table, ac) - fmt.Println() - - table = []int{0} + table := []int{1, 2, 3} + ac := 93 + FoldInt(Add, table, ac) + FoldInt(Mul, table, ac) + FoldInt(Sub, table, ac) + fmt.Println() + + table = []int{0} FoldInt(Add, table, ac) FoldInt(Mul, table, ac) FoldInt(Sub, table, ac) From 88f67034d1b5175558bae6c49e852832a489d534 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 00:47:39 +0000 Subject: [PATCH 090/146] Update grouping.en.md --- subjects/grouping.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/grouping.en.md b/subjects/grouping.en.md index 0cb783c06..c10653a0c 100644 --- a/subjects/grouping.en.md +++ b/subjects/grouping.en.md @@ -6,7 +6,7 @@ Write a program that receives two strings and replicates the use of brackets in The program should handle the "`|`" operator, that searches for both strings on each side of the operator. -The output of the program should be the results of the regular expression by order of appearence in the string, being themselves identified by a number. +The output of the program should be the results of the regular expression by order of appearance in the string, being themselves identified by a number. In case the regular expression is not valid, the last argument is empty or there are no matches the program returns a newline ("`\n`"). From 020b98d1bcc90b8da3ed9684860603e4c89afa83 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 01:06:45 +0000 Subject: [PATCH 091/146] Update grouping.en.md --- subjects/grouping.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/grouping.en.md b/subjects/grouping.en.md index c10653a0c..4d83c442d 100644 --- a/subjects/grouping.en.md +++ b/subjects/grouping.en.md @@ -20,7 +20,7 @@ student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(a)" "I'm heavy, jumpsuit is on s 1: heavy 2: steady 3: heavy -student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(e|n)" "I currently have 4 windows open up… and I don’t know why." +student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(e|n)" "I currently have 4 windows opened up… and I don’t know why." 1: currently 2: currently 3: have From e03783527e1cd64a293e3233390bd04225760cc7 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 13 Mar 2020 01:13:26 +0000 Subject: [PATCH 092/146] slice to sliceprog --- subjects/{slice.en.md => sliceprog.en.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename subjects/{slice.en.md => sliceprog.en.md} (100%) diff --git a/subjects/slice.en.md b/subjects/sliceprog.en.md similarity index 100% rename from subjects/slice.en.md rename to subjects/sliceprog.en.md From 2b983a18fbe35091e14268ae4bf5c6b184790355 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 13 Mar 2020 01:41:00 +0000 Subject: [PATCH 093/146] adding of interestingnumbers --- subjects/interestingnumber.en.md | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 subjects/interestingnumber.en.md diff --git a/subjects/interestingnumber.en.md b/subjects/interestingnumber.en.md new file mode 100644 index 000000000..8895bb18a --- /dev/null +++ b/subjects/interestingnumber.en.md @@ -0,0 +1,47 @@ +## interesting_number + +### Instructions + +It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). +Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. + +The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. + +Saken thinks that number is interesting if sum of its digits is divisible by 7. You are given a positive integer 'n', return the next interesting number (could be itself). + +### Expected function + +```go +func Interesting_number(n int) int { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +import ( + "fmt" +) + +func main() { + fmt.Println(Interesting_number(1)) + fmt.Println(Interesting_number(2)) + fmt.Println(Interesting_number(8)) +} +``` + +And its output : + +```console +student@ubuntu:~/[[ROOT]]/test$ go build +student@ubuntu:~/[[ROOT]]/test$ ./test +7 +7 +16 +student@ubuntu:~/[[ROOT]]/test$ +``` From b403f3c3fb5b2d630fe56e528b65d032672deb86 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 02:34:30 +0000 Subject: [PATCH 094/146] Rename doppelganger.en.md to doppelgangerprog.en.md --- subjects/{doppelganger.en.md => doppelgangerprog.en.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename subjects/{doppelganger.en.md => doppelgangerprog.en.md} (100%) diff --git a/subjects/doppelganger.en.md b/subjects/doppelgangerprog.en.md similarity index 100% rename from subjects/doppelganger.en.md rename to subjects/doppelgangerprog.en.md From 6f0a39a0bd0b6b15a55643898b4f0f8981760bf1 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 02:34:53 +0000 Subject: [PATCH 095/146] Rename halfcontest.en.md to halfcontestprog.en.md --- subjects/{halfcontest.en.md => halfcontestprog.en.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename subjects/{halfcontest.en.md => halfcontestprog.en.md} (100%) diff --git a/subjects/halfcontest.en.md b/subjects/halfcontestprog.en.md similarity index 100% rename from subjects/halfcontest.en.md rename to subjects/halfcontestprog.en.md From 301e4e149d4d853d4ca955c580de4940bcb55359 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 02:36:07 +0000 Subject: [PATCH 096/146] Rename reachable_number.en.md to reachablenumberprog.en.md --- subjects/{reachable_number.en.md => reachablenumberprog.en.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename subjects/{reachable_number.en.md => reachablenumberprog.en.md} (100%) diff --git a/subjects/reachable_number.en.md b/subjects/reachablenumberprog.en.md similarity index 100% rename from subjects/reachable_number.en.md rename to subjects/reachablenumberprog.en.md From db008a2b4dcdbd078bce3b392c6d8419ee7c936b Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 03:31:09 +0000 Subject: [PATCH 097/146] Update sweetproblem.en.md --- subjects/sweetproblem.en.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subjects/sweetproblem.en.md b/subjects/sweetproblem.en.md index f5f931514..877a0b064 100644 --- a/subjects/sweetproblem.en.md +++ b/subjects/sweetproblem.en.md @@ -1,5 +1,16 @@ ## sweet_problem +## **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 It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). From 4c40c25ed174bf6f6451ca8627ec2a5b4e05610b Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 03:31:27 +0000 Subject: [PATCH 098/146] Update revivethreenums.en.md --- subjects/revivethreenums.en.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subjects/revivethreenums.en.md b/subjects/revivethreenums.en.md index 7a407aac4..ec4f9b674 100644 --- a/subjects/revivethreenums.en.md +++ b/subjects/revivethreenums.en.md @@ -1,5 +1,16 @@ ## revive_three_nums +## **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 It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). From 61fac5cf25d6809c95d04d7084399e30866009a0 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 03:38:41 +0000 Subject: [PATCH 099/146] Update halfcontestprog.en.md --- subjects/halfcontestprog.en.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subjects/halfcontestprog.en.md b/subjects/halfcontestprog.en.md index f7a77f9af..01e273cc0 100644 --- a/subjects/halfcontestprog.en.md +++ b/subjects/halfcontestprog.en.md @@ -1,5 +1,16 @@ ## halfcontest +## **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 It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). From bb6d427f06cac9ee1f108e65e074a6ee4755c7d6 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 03:40:25 +0000 Subject: [PATCH 100/146] Update interestingnumber.en.md --- subjects/interestingnumber.en.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subjects/interestingnumber.en.md b/subjects/interestingnumber.en.md index 8895bb18a..6869ebe81 100644 --- a/subjects/interestingnumber.en.md +++ b/subjects/interestingnumber.en.md @@ -1,5 +1,16 @@ ## interesting_number +## **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 It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). From 6e0d4cce8e7fd9d94206a861827d0c6d9a018081 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 03:42:48 +0000 Subject: [PATCH 101/146] Update reachablenumberprog.en.md --- subjects/reachablenumberprog.en.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subjects/reachablenumberprog.en.md b/subjects/reachablenumberprog.en.md index 5de6f30c4..8dd4ea9cc 100644 --- a/subjects/reachablenumberprog.en.md +++ b/subjects/reachablenumberprog.en.md @@ -1,5 +1,16 @@ ## reachable_number +## **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 Let us define a function f(x) by the following: first we add 1 to x, and then while the last digit of the number equals 0, we shall be deleting 0. Let us call 'y' reachable if we can apply **f** to **x** (zero or more times), and get **y**. 102 is reachable from 10098: f(f(f(10098))) = f(f(10099)) = f(101) = f(102). Any number is reachable from itself. You are given a positive number **n**, count how many integers are reachable from **n**. From 4a2d9b4c34343ec43db7cbfc4a85a542f5f7eb84 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 03:44:34 +0000 Subject: [PATCH 102/146] Update volumechanger.en.md --- subjects/volumechanger.en.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subjects/volumechanger.en.md b/subjects/volumechanger.en.md index 00cd5bba8..35c462c94 100644 --- a/subjects/volumechanger.en.md +++ b/subjects/volumechanger.en.md @@ -1,5 +1,16 @@ ## volumechanger +## **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 It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). From 9bc025f91e318ad2a51d558109868cb1abfa0915 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 03:45:36 +0000 Subject: [PATCH 103/146] Update game23.en.md --- subjects/game23.en.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subjects/game23.en.md b/subjects/game23.en.md index 79f6019b5..b9cfe008f 100644 --- a/subjects/game23.en.md +++ b/subjects/game23.en.md @@ -1,5 +1,16 @@ ## game23 +## **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 It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). From 5da3fca0db32ed7f864972ae260df3d05e06a88d Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 03:45:55 +0000 Subject: [PATCH 104/146] Update fib.en.md --- subjects/fib.en.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/subjects/fib.en.md b/subjects/fib.en.md index 04b0d6970..5bf6c2043 100644 --- a/subjects/fib.en.md +++ b/subjects/fib.en.md @@ -1,5 +1,16 @@ ## fib +## **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 It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). @@ -46,4 +57,4 @@ student@ubuntu:~/[[ROOT]]/test$ ./test 1 1 student@ubuntu:~/[[ROOT]]/test$ -``` \ No newline at end of file +``` From 91fdaaa4bb4dccde8ffc035fa6df9b49a74dc087 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 03:57:27 +0000 Subject: [PATCH 105/146] Update sliceprog.en.md --- subjects/sliceprog.en.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/subjects/sliceprog.en.md b/subjects/sliceprog.en.md index 54f75289f..8051399bc 100644 --- a/subjects/sliceprog.en.md +++ b/subjects/sliceprog.en.md @@ -13,9 +13,9 @@ This means that: ### Instructions -Write a **program** that replicates the javascript function `slice`. +Write a **function** that replicates the javascript function `slice`. -The program receives an array of strings and one or more integers, and returns an array of strings. The returned array is part of the received one but cut from the position indicated in the first int, until the position indicated by the second int. +The function receives an array of strings and one or more integers, and returns an array of strings. The returned array is part of the received one but cut from the position indicated in the first int, until the position indicated by the second int. In case there only exists one int, the resulting array begins in the position indicated by the int and ends at the end of the received array. @@ -41,11 +41,11 @@ import "fmt" func main(){ arr := []string{"coding", "algorithm", "ascii", "package", "golang"} - fmt.Println(arr, 1) - fmt.Println(arr, 2, 4) - fmt.Println(arr, -3) - fmt.Println(arr, -2, -1) - fmt.Println(arr, 2, 0) + fmt.Println(Slice(arr, 1)) + fmt.Println(Slice(arr, 2, 4)) + fmt.Println(Slice(arr, -3)) + fmt.Println(Slice(arr, -2, -1)) + fmt.Println(Slice(arr, 2, 0)) } ``` From 938b2f4840afc55521de391f124365e339191914 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 05:12:13 +0000 Subject: [PATCH 106/146] Update reduceint.en.md --- subjects/reduceint.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/reduceint.en.md b/subjects/reduceint.en.md index 97e32837c..ad649b9c2 100644 --- a/subjects/reduceint.en.md +++ b/subjects/reduceint.en.md @@ -15,12 +15,12 @@ This means that: Write a function called `reduceint` that simulates the behaviour of reduce from JavaScript. -The function should have as parameters a function, `f func(int, int) int` and a slice of integers, `slice []int`. You should apply for each element of the slice the arithmetic function, saving it and printing. +The function should have as parameters a function, `f func(int, int) int` and a slice of integers, `arr []int`. You should apply for each element of the slice the arithmetic function, saving it and printing. ### Expected function ```go -func ReduceInt(f func(int, int) int, slice []int) { +func ReduceInt(f func(int, int) int, arr []int) { } ``` From eb20d8b222c4490ecc124973553e2a7b19e5c598 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 05:32:32 +0000 Subject: [PATCH 107/146] Update interestingnumber.en.md --- subjects/interestingnumber.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/interestingnumber.en.md b/subjects/interestingnumber.en.md index 6869ebe81..27afba8ce 100644 --- a/subjects/interestingnumber.en.md +++ b/subjects/interestingnumber.en.md @@ -23,7 +23,7 @@ Saken thinks that number is interesting if sum of its digits is divisible by 7. ### Expected function ```go -func Interesting_number(n int) int { +func InterestingNumber(n int) int { } ``` From b8b3f96c6c86081e593fb4a7dc4458d86b7e3e7c Mon Sep 17 00:00:00 2001 From: Saken <35443199+sakenism@users.noreply.github.com> Date: Fri, 13 Mar 2020 10:34:53 +0600 Subject: [PATCH 108/146] typo --- subjects/sweetproblem.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/sweetproblem.en.md b/subjects/sweetproblem.en.md index 877a0b064..5f6ecb30e 100644 --- a/subjects/sweetproblem.en.md +++ b/subjects/sweetproblem.en.md @@ -23,7 +23,7 @@ Madina loves sweets, but she only has 3 types of sweets: red, green, blue. Her d ### Expected function ```go -func Sweet_problem(red, green, blue int) int { +func Sweetproblem(red, green, blue int) int { } ``` From 261e7f3426b637b957a04d4c21b9c950d0d19ef3 Mon Sep 17 00:00:00 2001 From: Saken <35443199+sakenism@users.noreply.github.com> Date: Fri, 13 Mar 2020 10:45:43 +0600 Subject: [PATCH 109/146] clarifying --- subjects/costumeprofit.en.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subjects/costumeprofit.en.md b/subjects/costumeprofit.en.md index 778db6af2..e2c6ada59 100644 --- a/subjects/costumeprofit.en.md +++ b/subjects/costumeprofit.en.md @@ -14,6 +14,8 @@ What is the maximum amount of dollars that shop can earn by selling costumes? Input will be given as 6 arguments, your output should be displayed as standard output. +In the output put '\n' at the end. + Input: `./main **a** **b** **c** **d** **e** **f**` ```console From c664186568e75491d6dbc453c9d1a1b3f7378be8 Mon Sep 17 00:00:00 2001 From: Saken <35443199+sakenism@users.noreply.github.com> Date: Fri, 13 Mar 2020 13:06:54 +0600 Subject: [PATCH 110/146] digit instead of number --- subjects/romannumbers.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/romannumbers.en.md b/subjects/romannumbers.en.md index 1096f0063..b9ab87e04 100644 --- a/subjects/romannumbers.en.md +++ b/subjects/romannumbers.en.md @@ -4,7 +4,7 @@ Write a program called `rn`. The objective is to convert a number, given as an argument, into a roman number and print it with its roman number calculation. -The program should have a limit of `4000`. In case of an invalid number, for example `"hello"` or `0` the program should print `ERROR: can not convert to roman number`. +The program should have a limit of `4000`. In case of an invalid number, for example `"hello"` or `0` the program should print `ERROR: can not convert to roman digit`. Roman Numerals reminder: @@ -49,6 +49,6 @@ student@ubuntu:~/[[ROOT]]/test$ ./rn 3999 M+M+M+(M-C)+(C-X)+(X-I) MMMCMXCIX student@ubuntu:~/[[ROOT]]/test$ ./rn 4000 -ERROR: can not convert to roman number +ERROR: can not convert to roman digit student@ubuntu:~/[[ROOT]]/test$ ``` From f861116e650c9bfb912396d19c424dff9ac9225d Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Fri, 13 Mar 2020 07:54:25 +0000 Subject: [PATCH 111/146] Update grouping.en.md --- subjects/grouping.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/grouping.en.md b/subjects/grouping.en.md index 4d83c442d..189e01e60 100644 --- a/subjects/grouping.en.md +++ b/subjects/grouping.en.md @@ -25,8 +25,8 @@ student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(e|n)" "I currently have 4 window 2: currently 3: have 4: windows -5: open -6: open +5: opened +6: opened 7: and 8: don’t 9: know From 450b3e267dd2dbb83ec6defd6b3cc686fda25cb2 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 13 Mar 2020 21:20:25 +0000 Subject: [PATCH 112/146] lem-in example 02 fix --- subjects/lem-in/lem-in-examples.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/lem-in/lem-in-examples.en.md b/subjects/lem-in/lem-in-examples.en.md index b2f6f9377..b228e9110 100644 --- a/subjects/lem-in/lem-in-examples.en.md +++ b/subjects/lem-in/lem-in-examples.en.md @@ -65,7 +65,7 @@ h-n 1 4 1 2 6 0 ##end -3 4 1 +3 5 3 0-1 0-3 1-2 From e6b66e5b77c548bbb19f0231b91d02510b6c1883 Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 16 Mar 2020 12:09:36 +0000 Subject: [PATCH 113/146] removing somethings --- subjects/forum/forum-security.audit.en.md | 4 ++-- subjects/forum/forum-security.en.md | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/subjects/forum/forum-security.audit.en.md b/subjects/forum/forum-security.audit.en.md index e29e5a07f..ed3cb5589 100644 --- a/subjects/forum/forum-security.audit.en.md +++ b/subjects/forum/forum-security.audit.en.md @@ -8,7 +8,7 @@ ###### Is the Go TLS structure well configured? -###### Is the [server](https://golang.org/pkg/net/http/#Server) timeout reduced (Read, write and IdleTimeout)? (enabling attackers to take their time) +###### Is the [server](https://golang.org/pkg/net/http/#Server) timeout reduced (Read, write and IdleTimeout)? ###### Does the project implement [Rate limiting](https://en.wikipedia.org/wiki/Rate_limiting) (avoiding [DoS attacks](https://en.wikipedia.org/wiki/Denial-of-service_attack))? @@ -22,7 +22,7 @@ ##### Try to login into the forum and open the inspector(CTRL+SHIFT+i) and go to the storage to see the cookies(this can be different depending on the [browser](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools)). -###### Does the session cookie present a unique identifier? +###### Does the session cookie present a UUID(Universal Unique Identifier)? ###### Does the project present a way to configure the certificates information, either via .env or config files or other method? diff --git a/subjects/forum/forum-security.en.md b/subjects/forum/forum-security.en.md index 2e54d6fbc..886d297c6 100644 --- a/subjects/forum/forum-security.en.md +++ b/subjects/forum/forum-security.en.md @@ -9,13 +9,14 @@ For this project you must take into account the security of your forum. - You should implement a Hypertext Transfer Protocol Secure ([HTTPS](https://www.globalsign.com/en/blog/the-difference-between-http-and-https)) protocol : - Encrypted connection : for this you will have to generate an SSL certificate, you can think of this like a identity card for your website. You can create your certificates or use "Certificate Authorities"(CA's) -- You should encrypt : - - Clients passwords - - Database, for this will have to create a password for your database and encrypt the communication channel. - - Clients session cookies should be unique. For instance, the session state is stored on the server and the session should present an unique identifier. This way the client has no direct access to it. Therefore, there is no way for attackers to read or tamper with session state. +- Clients session cookies should be unique. For instance, the session state is stored on the server and the session should present an unique identifier. This way the client has no direct access to it. Therefore, there is no way for attackers to read or tamper with session state. - The implementation of [Rate Limiting](https://en.wikipedia.org/wiki/Rate_limiting) must be present on this project +- You should encrypt : + - Clients passwords + - Database, for this you will have to create a password for your database. + This project will help you learn about : - HTTPS From a15b718e5eeaaf410c7d2d0d79def639953ce54c Mon Sep 17 00:00:00 2001 From: OGordoo Date: Tue, 17 Mar 2020 12:49:35 +0000 Subject: [PATCH 114/146] authentication correction --- subjects/forum/forum.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index 5b2e40257..ee89afc7d 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -33,7 +33,7 @@ Instructions for user registration: - When the email is already taken return an error response. - Must ask for username - Must ask for password - - The password must be encrypted + - The password must be encrypted when stored The forum must be able to check if the email provided is present in the database and if all credentials are correct. It will check if the password is the same with the one provided and if the password is not the same return an error response. From 793d8d9a0412cb97b42066b7e633317a865d96ac Mon Sep 17 00:00:00 2001 From: LEEDASILVA <39002521+LEEDASILVA@users.noreply.github.com> Date: Tue, 17 Mar 2020 13:13:46 +0000 Subject: [PATCH 115/146] Update forum.audit.en.md --- subjects/forum/forum.audit.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md index 6f11d8c37..09301b0c0 100644 --- a/subjects/forum/forum.audit.en.md +++ b/subjects/forum/forum.audit.en.md @@ -24,9 +24,9 @@ ###### Can you confirm that the browser non logged remains unregistered? -##### Try opening two different browsers and login into one of them. Then create a new post or just add a comment. Refresh the other browser. +##### Try opening two different browsers and login into one of them. Then create a new post or just add a comment. Refresh both browsers. -###### Does it present the changes made in the logged browser? +###### Does it present the comment/post on both browsers? #### SQLite From 3920c66f3b7cfd797b899566648259e58877639f Mon Sep 17 00:00:00 2001 From: kuzikov <52793174+kuzikov@users.noreply.github.com> Date: Wed, 18 Mar 2020 08:09:36 +0600 Subject: [PATCH 116/146] Typos fixed. --- subjects/push-swap/push-swap.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/push-swap/push-swap.en.md b/subjects/push-swap/push-swap.en.md index 19ccf4d9a..1c01a5721 100644 --- a/subjects/push-swap/push-swap.en.md +++ b/subjects/push-swap/push-swap.en.md @@ -21,7 +21,7 @@ These are the instructions that you can use to sort the stack : - `ra` rotate stack `a` (shift up all elements of stack `a` by 1, the first element becomes the last one) - `rb` rotate stack `b` - `rr`execute `ra` and `rb` -- `rra` reverse rotate `a` (shift down all elements of stack `a` by 1, the first element becomes the last one) +- `rra` reverse rotate `a` (shift down all elements of stack `a` by 1, the last element becomes the first one) - `rrb` reverse rotate `b` - `rrr` execute `rra` and `rrb` From 619fd03ddca1c20c7f226cf3d73beb69258c2e88 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 02:36:44 +0000 Subject: [PATCH 117/146] typos --- subjects/forum/forum.en.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index ee89afc7d..919f056e4 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -5,7 +5,7 @@ This project consists in creating a web forum that allows : - communication between users. -- associate categories to posts. +- associating categories to posts. - liking and disliking posts and comments. - filtering posts. @@ -25,7 +25,7 @@ To know more about SQLite you can check the [SQLite page](https://www.sqlite.org In this segment the client must be able to `register` as a new user on the forum, by inputting their credentials. You also have to create a `login session` to access the forum and be able to add posts and comments. -You should use cookies to allow each user to have only one open session. Each of this sessions must contain an expiration date. It's up to you to decide what time the cookie stays "alive". +You should use cookies to allow each user to have only one opened session. Each of this sessions must contain an expiration date. It is up to you to decide how long the cookie stays "alive". Instructions for user registration: @@ -35,7 +35,7 @@ Instructions for user registration: - Must ask for password - The password must be encrypted when stored -The forum must be able to check if the email provided is present in the database and if all credentials are correct. It will check if the password is the same with the one provided and if the password is not the same return an error response. +The forum must be able to check if the email provided is present in the database and if all credentials are correct. It will check if the password is the same with the one provided and, if the password is not the same, it will return an error response. #### Communication @@ -49,7 +49,7 @@ In order for users to communicate between each other, they will have to be able #### Likes and Dislikes -Only registered users will be able to like or dislike posts and comments. +Only registered users will be able to like or dislike posts and comments. The number of likes and dislikes should be visible by all users (registered or not). @@ -90,7 +90,7 @@ This project will help you learn about: - You must handle website errors, HTTP status. - You must handle all sort of technical errors. - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). -- It is recommend that the code should present a **test file**. +- It is recommended that the code should present a **test file**. ### Allowed packages From af31d80bd32ed4b8e31b3edb8a8e8f9e063fafe3 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 02:39:37 +0000 Subject: [PATCH 118/146] clarification --- subjects/forum/forum.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/forum/forum.en.md b/subjects/forum/forum.en.md index 919f056e4..7abdc829d 100644 --- a/subjects/forum/forum.en.md +++ b/subjects/forum/forum.en.md @@ -17,7 +17,7 @@ SQLite is a popular choice as embedded database software for local/client storag To structure your database and to achieve better performance we highly advise you to take a look at the [entity relationship diagram](https://www.smartdraw.com/entity-relationship-diagram/) and build one based on your own database. -- You must use at least one SELECT, one CREATE and one INSERT. +- You must use at least one SELECT, one CREATE and one INSERT queries. To know more about SQLite you can check the [SQLite page](https://www.sqlite.org/index.html). From 33bcfecc017908674e4ff4e033b7cb11dd1905d1 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 02:42:49 +0000 Subject: [PATCH 119/146] typos of audit fixed --- subjects/forum/forum.audit.en.md | 37 +++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/subjects/forum/forum.audit.en.md b/subjects/forum/forum.audit.en.md index 09301b0c0..fb88882dd 100644 --- a/subjects/forum/forum.audit.en.md +++ b/subjects/forum/forum.audit.en.md @@ -1,10 +1,10 @@ #### Authentication -###### Is it asked in the register for an email and a password? +###### Are an email and a password asked for in the resgistration? -###### Does the project detects if the email or password are wrong? +###### Does the project detect if the email or password are wrong? -###### Does the project detects if the email or user name is already taken in the register? +###### Does the project detect if the email or user name is already taken in the registration? ##### Try to register as a new user in the forum. @@ -36,15 +36,15 @@ ###### Does the code contain at least one SELECT query? -##### Try registering in the forum, open the database with `sqlite3 ` and perform a query to select all the users (Example: SELECT * FROM users;). +##### Try registering in the forum, open the database with `sqlite3 ` and perform a query to select all the users (Example: SELECT \* FROM users;). ###### Does it present the user you created? -##### Try creating a post in the forum, open the database with `sqlite3 ` and perform a query to select all the users (Example: SELECT * FROM post;). +##### Try creating a post in the forum, open the database with `sqlite3 ` and perform a query to select all the users (Example: SELECT \* FROM post;). ###### Does it present the post you created? -##### Try creating a comment in the forum, open the database with `sqlite3 ` and perform a query to select all the users (Example: SELECT * FROM comment;). +##### Try creating a comment in the forum, open the database with `sqlite3 ` and perform a query to select all the users (Example: SELECT \* FROM comment;). ###### Does it present the comment you created? @@ -52,20 +52,24 @@ ###### Does the project have Dockerfiles? -##### Try to run the command `"docker image build [OPTINS] PATH | URL | -"` to build the image using using the project Dockerfiles and run the command `"docker images"` to see images. +##### Try to run the command `"docker image build [OPTINS] PATH | URL | -"` to build the image using using the project Dockerfiles and run the command `"docker images"` to see images. + ``` student$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE latest 85a65d66ca39 7 seconds ago 795MB ``` + ###### Does all images build as above? ##### Try running the command `"docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]"` to start the containers using the images just created and run the command `"docker ps -a"` to see containers. + ``` student$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES cc8f5dcf760f "./server" 6 seconds ago Up 6 seconds 0.0.0.0:8080->8080/tcp ascii-art-web ``` + ###### Is the docker containers running as above? ###### Does the project present no [unused object](https://docs.docker.com/config/pruning/)? @@ -73,54 +77,71 @@ cc8f5dcf760f "./server" 6 seconds ag #### Functional ##### Enter the forum as a non-registered user. + ###### Are you prohibited to create a post? ##### Enter the forum as a non-registered user. + ###### Are you prohibited to create a comment? ##### Enter the forum as a non-registered user and try to like a comment. + ###### Are you prohibited to like a post? ##### Enter the forum as a non-registered user and try to dislike a comment. + ###### Are you prohibited to dislike a comment? ##### Enter the forum as a registered user, go to a post and try to create a comment for it. + ###### Were you able to create the comment? ##### Enter the forum as a registered user, go to a post and try to create an empty comment for it. + ###### Were you prohibited to create the comment? ##### Enter the forum as a registered user and try to create a post. + ###### Were you able to create a post? ##### Enter the forum as a registered user and try to create an empty post. + ###### Were you prohibited to create the post? ##### Try creating a post as a registered user and try to choose a category for that post. + ###### Were you able to choose a category for that post? ##### Enter the forum as a registered user and try to like or dislike a post. + ###### Can you like or dislike the post? ##### Enter the forum as a registered user and try to like or dislike a comment. + ###### Can you like or dislike the comment? ##### Enter the forum as a registered user, try liking and disliking a post and then refresh the page. + ###### Does the number of likes/dislikes change? ##### Enter the forum as a registered user and try to like and then dislike the same post. + ###### Can you confirm that it is not possible that the post is liked and disliked at the same time? ##### Enter the forum as a registered user and try seeing all of your created posts. + ###### Does it present the expected posts? ##### Enter the forum as a registered user and try seeing all of your liked posts. + ###### Does it present the expected posts? ##### Navigate to a post of your choice and see its comments. + ###### Are all users (registered or not) able to see the number of likes and dislikes that comment has? ##### Try seeing all posts from one category using the filter. + ###### Are all posts displayed from that category? ###### Did the server behaved as expected?(did not crashed) @@ -133,7 +154,7 @@ cc8f5dcf760f "./server" 6 seconds ag ###### Does the project handle [HTTP status 500 - Internal Server Errors](https://www.restapitutorial.com/httpstatuscodes.html)? -###### Are the allowed packages being respected? +###### Are only the allowed packages being used? #### General From 483fab61b64ad4972fccda95f8806a03f13e7a56 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Thu, 5 Mar 2020 09:46:34 +0000 Subject: [PATCH 120/146] autentication readme and audit --- subjects/forum/authentication.audit.en.md | 35 +++++++++++++++++++++++ subjects/forum/authentication.en.md | 25 ++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 subjects/forum/authentication.audit.en.md create mode 100644 subjects/forum/authentication.en.md diff --git a/subjects/forum/authentication.audit.en.md b/subjects/forum/authentication.audit.en.md new file mode 100644 index 000000000..40668d581 --- /dev/null +++ b/subjects/forum/authentication.audit.en.md @@ -0,0 +1,35 @@ +#### Functional + +##### Try to login with Github. +###### Is it possible to enter the forum? + +##### Try to login with Google. +###### Is it possible to enter the forum? + +##### Try to register as a new user in the forum. +###### Is it possible to register? + +##### Try to login with the user you created. +###### Can you login and have all the rights of a registered user? + +##### Try creating an account twice with the same credential. +###### Does it present an error? + +##### Try to enter your account with no email, password or with errors in any of them. +###### Does it present an error and an error message? + +###### Is it asked in the register for an email and a password? + +#### General + +###### +Does the project presents more than two different authentication methods? + +#### Basic + +###### +Does the project run quickly and effectively (favoring of 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)? + +#### 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/forum/authentication.en.md b/subjects/forum/authentication.en.md new file mode 100644 index 000000000..7f491e3bb --- /dev/null +++ b/subjects/forum/authentication.en.md @@ -0,0 +1,25 @@ +## authentication + +### Objectives + +The goal of this project is to implement, into your forum, new ways of authentication. Github and google are mandatory. + +Some examples are: + +- Facebook +- GitHub +- Google + +This project will help you learn about: + +- Sessions and cookies. +- Encryption. +- How to manage dependencies. +- How to create middleware +- How to protect routes. + +### Instructions + +- Your project must have implemented at least the two authentication examples given must be implemented. +- Your project must be written in **Go**. +- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). From 482338145ddf8e287b6c88decca11a7cede45c8e Mon Sep 17 00:00:00 2001 From: MSilva95 <53977751+MSilva95@users.noreply.github.com> Date: Thu, 12 Mar 2020 11:21:41 +0000 Subject: [PATCH 121/146] Update authentication.en.md --- subjects/forum/authentication.en.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/subjects/forum/authentication.en.md b/subjects/forum/authentication.en.md index 7f491e3bb..d4bd50de5 100644 --- a/subjects/forum/authentication.en.md +++ b/subjects/forum/authentication.en.md @@ -13,9 +13,6 @@ Some examples are: This project will help you learn about: - Sessions and cookies. -- Encryption. -- How to manage dependencies. -- How to create middleware - How to protect routes. ### Instructions From 42c1703ecd49471b47a490e946c6712b6a276629 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Mon, 16 Mar 2020 12:57:30 +0000 Subject: [PATCH 122/146] refactoring authentication --- subjects/forum/authentication.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subjects/forum/authentication.en.md b/subjects/forum/authentication.en.md index d4bd50de5..5f5b7d4d3 100644 --- a/subjects/forum/authentication.en.md +++ b/subjects/forum/authentication.en.md @@ -2,9 +2,9 @@ ### Objectives -The goal of this project is to implement, into your forum, new ways of authentication. Github and google are mandatory. +The goal of this project is to implement, into your forum, new ways of authentication. You have to be able to register and to login using at least Google and Github authentification tools. -Some examples are: +Some examples of authentication ways are: - Facebook - GitHub @@ -13,7 +13,7 @@ Some examples are: This project will help you learn about: - Sessions and cookies. -- How to protect routes. +- Protecting routes. ### Instructions From 97a8cd09be608fb5d053bae2e2fa8583275dedc9 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Mon, 16 Mar 2020 14:04:48 +0000 Subject: [PATCH 123/146] audit changes --- subjects/forum/authentication.audit.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/forum/authentication.audit.en.md b/subjects/forum/authentication.audit.en.md index 40668d581..0858444b2 100644 --- a/subjects/forum/authentication.audit.en.md +++ b/subjects/forum/authentication.audit.en.md @@ -6,8 +6,8 @@ ##### Try to login with Google. ###### Is it possible to enter the forum? -##### Try to register as a new user in the forum. -###### Is it possible to register? +##### Try login with Github or Google, creating a post with that user and logout. +###### Is the post created visible? ##### Try to login with the user you created. ###### Can you login and have all the rights of a registered user? From 637140b22fed70b86a405d5519b380375664f8b7 Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 16 Mar 2020 14:14:52 +0000 Subject: [PATCH 124/146] some corrections --- subjects/forum/authentication.audit.en.md | 8 ++++++++ subjects/forum/authentication.en.md | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/subjects/forum/authentication.audit.en.md b/subjects/forum/authentication.audit.en.md index 0858444b2..76b0ce923 100644 --- a/subjects/forum/authentication.audit.en.md +++ b/subjects/forum/authentication.audit.en.md @@ -1,21 +1,27 @@ #### Functional ##### Try to login with Github. + ###### Is it possible to enter the forum? ##### Try to login with Google. + ###### Is it possible to enter the forum? ##### Try login with Github or Google, creating a post with that user and logout. + ###### Is the post created visible? ##### Try to login with the user you created. + ###### Can you login and have all the rights of a registered user? ##### Try creating an account twice with the same credential. + ###### Does it present an error? ##### Try to enter your account with no email, password or with errors in any of them. + ###### Does it present an error and an error message? ###### Is it asked in the register for an email and a password? @@ -27,9 +33,11 @@ #### Basic ###### +Does the project run quickly and effectively (favoring of 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)? #### 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/forum/authentication.en.md b/subjects/forum/authentication.en.md index 5f5b7d4d3..7275e2e30 100644 --- a/subjects/forum/authentication.en.md +++ b/subjects/forum/authentication.en.md @@ -2,7 +2,7 @@ ### Objectives -The goal of this project is to implement, into your forum, new ways of authentication. You have to be able to register and to login using at least Google and Github authentification tools. +The goal of this project is to implement, into your forum, new ways of authentication. You have to be able to register and to login using at least Google and Github authentication tools. Some examples of authentication ways are: From c6b2f86acd1184e0bfd54017ac89d9c0a7a7ccff Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 02:58:09 +0000 Subject: [PATCH 125/146] fix language --- subjects/forum/authentication.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/forum/authentication.en.md b/subjects/forum/authentication.en.md index 7275e2e30..bb2f9b632 100644 --- a/subjects/forum/authentication.en.md +++ b/subjects/forum/authentication.en.md @@ -4,7 +4,7 @@ The goal of this project is to implement, into your forum, new ways of authentication. You have to be able to register and to login using at least Google and Github authentication tools. -Some examples of authentication ways are: +Some examples of authentication means are: - Facebook - GitHub @@ -17,6 +17,6 @@ This project will help you learn about: ### Instructions -- Your project must have implemented at least the two authentication examples given must be implemented. +- Your project must have implemented at least the two authentication examples given. - Your project must be written in **Go**. - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). From 22727726811e5460c6d31b4b84f2ab627a10e66a Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 03:00:21 +0000 Subject: [PATCH 126/146] typos --- subjects/forum/authentication.audit.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subjects/forum/authentication.audit.en.md b/subjects/forum/authentication.audit.en.md index 76b0ce923..a41aa6f60 100644 --- a/subjects/forum/authentication.audit.en.md +++ b/subjects/forum/authentication.audit.en.md @@ -24,15 +24,15 @@ ###### Does it present an error and an error message? -###### Is it asked in the register for an email and a password? +###### Does the registration ask for an email and a password? #### General -###### +Does the project presents more than two different authentication methods? +###### +Does the project present more than two different authentication methods? #### Basic -###### +Does the project run quickly and effectively (favoring of recursive, no unnecessary data requests, etc.)? +###### +Does the project run quickly and effectively (favoring of recursion, 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)? From 5dc83f20469459b63fd28fb643459639d2b57d99 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Thu, 5 Mar 2020 16:21:11 +0000 Subject: [PATCH 127/146] forum advanced features --- subjects/forum/.idea/.gitignore | 2 ++ .../forum/forum-advanced-features.audit.en.md | 21 ++++++++++++ subjects/forum/forum-advanced-features.en.md | 32 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 subjects/forum/.idea/.gitignore create mode 100644 subjects/forum/forum-advanced-features.audit.en.md create mode 100644 subjects/forum/forum-advanced-features.en.md diff --git a/subjects/forum/.idea/.gitignore b/subjects/forum/.idea/.gitignore new file mode 100644 index 000000000..5c98b4288 --- /dev/null +++ b/subjects/forum/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/subjects/forum/forum-advanced-features.audit.en.md b/subjects/forum/forum-advanced-features.audit.en.md new file mode 100644 index 000000000..098c8e3c4 --- /dev/null +++ b/subjects/forum/forum-advanced-features.audit.en.md @@ -0,0 +1,21 @@ +### Functional + + + +#### General + +##### +Are there any other feature not mentioned in the [subject](https://public.01-edu.org/subjects/forum/forum-advanced-features.en)? + +#### Basic + +###### +Does the project runs quickly and effectively (Favoring of recursive, no unnecessary data requests, etc.)? + +###### +Does the code obey the [good practices](https://public.01-edu.org/subjects/good-practices.en)? + +###### +Is there a test file for this code? + +#### 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/forum/forum-advanced-features.en.md b/subjects/forum/forum-advanced-features.en.md new file mode 100644 index 000000000..dfe0e1c02 --- /dev/null +++ b/subjects/forum/forum-advanced-features.en.md @@ -0,0 +1,32 @@ +## forum-advanced-features + +### Objectives + +You must follow the same [principles](https://public.01-edu.org/subjects/forum/forum.en) as the first subject. + +In forum advanced features, you will have to implement the following features : + +- Every type of users except guests can like and dislike posts/comments +- Implementation of websockets to: + - see creation of posts/comments in real time + - see likes and dislikes in real time +- Filter displayed posts by category + +We encourage you to add any other additional features that you find relevant. + +This project will help you learn about : + +- Websockets communication +- Data manipulation and storage + +### Instructions + +- The backend must be written in **Go** +- You must handle website errors +- 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 + +- The [standard go](https://golang.org/pkg/) packages are allowed +- github.com/gorilla/websocket \ No newline at end of file From 20b87033fa36197bfbd609d205701404aed46499 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Thu, 5 Mar 2020 17:40:11 +0000 Subject: [PATCH 128/146] rebuilding advanced features --- .../forum/forum-advanced-features.audit.en.md | 26 +++++++++++++++++++ subjects/forum/forum-advanced-features.en.md | 14 +++++----- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/subjects/forum/forum-advanced-features.audit.en.md b/subjects/forum/forum-advanced-features.audit.en.md index 098c8e3c4..627c7cff4 100644 --- a/subjects/forum/forum-advanced-features.audit.en.md +++ b/subjects/forum/forum-advanced-features.audit.en.md @@ -1,6 +1,32 @@ ### Functional +##### Try to like any post at your choice. +###### Does the liked post appear on the activity page? + +##### Try to dislike any post at your choice. + +###### Does the disliked post appear on the activity page? + +##### Try to comment any post at your choice. + +###### Does the commented post appear on the activity page along with the comment you made? + +##### Try to create a new post. + +###### Does new post appear on the activity page? + +##### Try login as other user and make a comment on the post you created above. Then return to the user that created the post. + +###### Does the user who created the post received a notification saying that the post has been commented? + +##### Try login as other user and like the post you created above. Then return to the user that created the post. + +###### Does the user who created the post received a notification saying that the post has been liked? + +##### Try login as other user and dislike the post you created above. Then return to the user that created the post. + +###### Does the user who created the post received a notification saying that the post has been disliked? #### General diff --git a/subjects/forum/forum-advanced-features.en.md b/subjects/forum/forum-advanced-features.en.md index dfe0e1c02..04841ef8b 100644 --- a/subjects/forum/forum-advanced-features.en.md +++ b/subjects/forum/forum-advanced-features.en.md @@ -6,17 +6,18 @@ You must follow the same [principles](https://public.01-edu.org/subjects/forum/f In forum advanced features, you will have to implement the following features : -- Every type of users except guests can like and dislike posts/comments -- Implementation of websockets to: - - see creation of posts/comments in real time - - see likes and dislikes in real time -- Filter displayed posts by category +- You will have to create a way to notify users when their posts are : + - liked/disliked + - commented +- You have to create an activity page that tracks the user own activity + - Shows the user created posts + - Shows where the user left a like/disliked + - Shows where the user has been commenting and the comment as well We encourage you to add any other additional features that you find relevant. This project will help you learn about : -- Websockets communication - Data manipulation and storage ### Instructions @@ -29,4 +30,3 @@ This project will help you learn about : ### Allowed packages - The [standard go](https://golang.org/pkg/) packages are allowed -- github.com/gorilla/websocket \ No newline at end of file From ca281a58e5489824e89f2a2514e1ab576adb5f0c Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Mon, 9 Mar 2020 16:02:34 +0000 Subject: [PATCH 129/146] add cases to af --- subjects/forum/forum-advanced-features.audit.en.md | 8 ++++++++ subjects/forum/forum-advanced-features.en.md | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/subjects/forum/forum-advanced-features.audit.en.md b/subjects/forum/forum-advanced-features.audit.en.md index 627c7cff4..7c66aac69 100644 --- a/subjects/forum/forum-advanced-features.audit.en.md +++ b/subjects/forum/forum-advanced-features.audit.en.md @@ -28,6 +28,14 @@ ###### Does the user who created the post received a notification saying that the post has been disliked? +##### Try to edit a post and a comment at your choice. + +###### Is it allowed to edit posts and comments? + +##### Try to remove a post and a comment at your choice. + +###### Is it allowed to remove posts and comments? + #### General ##### +Are there any other feature not mentioned in the [subject](https://public.01-edu.org/subjects/forum/forum-advanced-features.en)? diff --git a/subjects/forum/forum-advanced-features.en.md b/subjects/forum/forum-advanced-features.en.md index 04841ef8b..2ee4fa6b4 100644 --- a/subjects/forum/forum-advanced-features.en.md +++ b/subjects/forum/forum-advanced-features.en.md @@ -13,6 +13,7 @@ In forum advanced features, you will have to implement the following features : - Shows the user created posts - Shows where the user left a like/disliked - Shows where the user has been commenting and the comment as well +- You have to create a section where you wil be able to Edit/Remove posts and comments. We encourage you to add any other additional features that you find relevant. @@ -23,7 +24,6 @@ This project will help you learn about : ### Instructions - The backend must be written in **Go** -- You must handle website errors - 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** From 881563b5abe550ca3bdcc17a83f28cfdd34a6745 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Mon, 9 Mar 2020 17:10:19 +0000 Subject: [PATCH 130/146] delete .idea --- subjects/forum/.idea/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 subjects/forum/.idea/.gitignore diff --git a/subjects/forum/.idea/.gitignore b/subjects/forum/.idea/.gitignore deleted file mode 100644 index 5c98b4288..000000000 --- a/subjects/forum/.idea/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Default ignored files -/workspace.xml \ No newline at end of file From f6b1cfa3762822f4da374c8ede9f0e5b03120ad0 Mon Sep 17 00:00:00 2001 From: MSilva95 <53977751+MSilva95@users.noreply.github.com> Date: Thu, 12 Mar 2020 11:18:03 +0000 Subject: [PATCH 131/146] Update forum-advanced-features.en.md --- subjects/forum/forum-advanced-features.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/forum/forum-advanced-features.en.md b/subjects/forum/forum-advanced-features.en.md index 2ee4fa6b4..8863b1ad6 100644 --- a/subjects/forum/forum-advanced-features.en.md +++ b/subjects/forum/forum-advanced-features.en.md @@ -13,7 +13,7 @@ In forum advanced features, you will have to implement the following features : - Shows the user created posts - Shows where the user left a like/disliked - Shows where the user has been commenting and the comment as well -- You have to create a section where you wil be able to Edit/Remove posts and comments. +- You have to create a section where you will be able to Edit/Remove posts and comments. We encourage you to add any other additional features that you find relevant. From 2f9cfceb23f7094d3c7a5026823bb95e005b3d98 Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 16 Mar 2020 16:15:42 +0000 Subject: [PATCH 132/146] corrections --- subjects/forum/forum-advanced-features.audit.en.md | 2 +- subjects/forum/forum-advanced-features.en.md | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/subjects/forum/forum-advanced-features.audit.en.md b/subjects/forum/forum-advanced-features.audit.en.md index 7c66aac69..45309aaf3 100644 --- a/subjects/forum/forum-advanced-features.audit.en.md +++ b/subjects/forum/forum-advanced-features.audit.en.md @@ -10,7 +10,7 @@ ##### Try to comment any post at your choice. -###### Does the commented post appear on the activity page along with the comment you made? +###### Does the comment appear on the activity page along with the commented post you made? ##### Try to create a new post. diff --git a/subjects/forum/forum-advanced-features.en.md b/subjects/forum/forum-advanced-features.en.md index 8863b1ad6..fb47510c9 100644 --- a/subjects/forum/forum-advanced-features.en.md +++ b/subjects/forum/forum-advanced-features.en.md @@ -7,12 +7,16 @@ You must follow the same [principles](https://public.01-edu.org/subjects/forum/f In forum advanced features, you will have to implement the following features : - You will have to create a way to notify users when their posts are : + - liked/disliked - commented + - You have to create an activity page that tracks the user own activity + - Shows the user created posts - Shows where the user left a like/disliked - - Shows where the user has been commenting and the comment as well + - Shows where and what the user has been commenting. For this will have to show the comment and what post did he commented + - You have to create a section where you will be able to Edit/Remove posts and comments. We encourage you to add any other additional features that you find relevant. From ea229b1a2ff08ff52eb848fed2409d99600bdeb5 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Tue, 17 Mar 2020 18:26:06 +0000 Subject: [PATCH 133/146] forum-advanced-features add phrase --- subjects/forum/forum-advanced-features.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/forum/forum-advanced-features.en.md b/subjects/forum/forum-advanced-features.en.md index fb47510c9..57ae092d0 100644 --- a/subjects/forum/forum-advanced-features.en.md +++ b/subjects/forum/forum-advanced-features.en.md @@ -11,7 +11,7 @@ In forum advanced features, you will have to implement the following features : - liked/disliked - commented -- You have to create an activity page that tracks the user own activity +- You have to create an activity page that tracks the user own activity. In other words, a page that : - Shows the user created posts - Shows where the user left a like/disliked From 604ca62669b27501c52fda00808a8107123b813a Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 03:04:44 +0000 Subject: [PATCH 134/146] typos --- subjects/forum/forum-advanced-features.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subjects/forum/forum-advanced-features.en.md b/subjects/forum/forum-advanced-features.en.md index 57ae092d0..1f2583a38 100644 --- a/subjects/forum/forum-advanced-features.en.md +++ b/subjects/forum/forum-advanced-features.en.md @@ -4,7 +4,7 @@ You must follow the same [principles](https://public.01-edu.org/subjects/forum/forum.en) as the first subject. -In forum advanced features, you will have to implement the following features : +In `forum advanced features`, you will have to implement the following features : - You will have to create a way to notify users when their posts are : @@ -14,8 +14,8 @@ In forum advanced features, you will have to implement the following features : - You have to create an activity page that tracks the user own activity. In other words, a page that : - Shows the user created posts - - Shows where the user left a like/disliked - - Shows where and what the user has been commenting. For this will have to show the comment and what post did he commented + - Shows where the user left a like or a dislike + - Shows where and what the user has been commenting. For this, the comment will have to be shown, as well as the post commented - You have to create a section where you will be able to Edit/Remove posts and comments. From ca58e2f8afef6e6dfe6fc647b0e69f90ba13373e Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 03:09:11 +0000 Subject: [PATCH 135/146] typos --- .../forum/forum-advanced-features.audit.en.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/subjects/forum/forum-advanced-features.audit.en.md b/subjects/forum/forum-advanced-features.audit.en.md index 45309aaf3..824907e53 100644 --- a/subjects/forum/forum-advanced-features.audit.en.md +++ b/subjects/forum/forum-advanced-features.audit.en.md @@ -1,14 +1,14 @@ ### Functional -##### Try to like any post at your choice. +##### Try to like any post of your choice. ###### Does the liked post appear on the activity page? -##### Try to dislike any post at your choice. +##### Try to dislike any post of your choice. ###### Does the disliked post appear on the activity page? -##### Try to comment any post at your choice. +##### Try to comment any post of your choice. ###### Does the comment appear on the activity page along with the commented post you made? @@ -16,23 +16,23 @@ ###### Does new post appear on the activity page? -##### Try login as other user and make a comment on the post you created above. Then return to the user that created the post. +##### Try to login as another user and make a comment on the post you created above. Then return to the user that created the post. -###### Does the user who created the post received a notification saying that the post has been commented? +###### Did the user who created the post received a notification saying that the post has been commented? -##### Try login as other user and like the post you created above. Then return to the user that created the post. +##### Try to login as another user and like the post you created above. Then return to the user that created the post. -###### Does the user who created the post received a notification saying that the post has been liked? +###### Did the user who created the post received a notification saying that the post has been liked? -##### Try login as other user and dislike the post you created above. Then return to the user that created the post. +##### Try to login as another user and dislike the post you created above. Then return to the user that created the post. -###### Does the user who created the post received a notification saying that the post has been disliked? +###### Did the user who created the post received a notification saying that the post has been disliked? -##### Try to edit a post and a comment at your choice. +##### Try to edit a post and a comment of your choice. ###### Is it allowed to edit posts and comments? -##### Try to remove a post and a comment at your choice. +##### Try to remove a post and a comment of your choice. ###### Is it allowed to remove posts and comments? @@ -42,7 +42,7 @@ #### Basic -###### +Does the project runs quickly and effectively (Favoring of recursive, no unnecessary data requests, etc.)? +###### +Does the project runs quickly and effectively (Favoring of recursion, no unnecessary data requests, etc.)? ###### +Does the code obey the [good practices](https://public.01-edu.org/subjects/good-practices.en)? From 6d1725b9eef2737d7d0f71853ea5e8cfba4142ad Mon Sep 17 00:00:00 2001 From: OGordoo Date: Wed, 4 Mar 2020 12:06:44 +0000 Subject: [PATCH 136/146] Forum image upload --- subjects/forum/forum-image-upload.audit.en.md | 35 +++++++++++++++++++ subjects/forum/forum-image-upload.en.md | 31 ++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 subjects/forum/forum-image-upload.audit.en.md create mode 100644 subjects/forum/forum-image-upload.en.md diff --git a/subjects/forum/forum-image-upload.audit.en.md b/subjects/forum/forum-image-upload.audit.en.md new file mode 100644 index 000000000..074c9517f --- /dev/null +++ b/subjects/forum/forum-image-upload.audit.en.md @@ -0,0 +1,35 @@ +#### Functional + +##### Try creating a post with a PNG image. + +###### Was the post created successfully? + +##### Try creating a post with a JPEG image. + +###### Was the post created successfully? + +##### Try creating a post with a GIF image. + +###### Was the post created successfully? + +##### If is not restricted, try to create a post with a [large image](https://effigis.com/wp-content/themes/effigis_2014/img/RapidEye_RapidEye_5m_RGB_Altotting_Germany_Agriculture_and_Forestry_2009MAY17_8bits_sub_r_2.jpg). If it is restricted search for image with a size slightly below that limit. + +###### Was the post created successfully? + +##### Try navigating through the site and come back to one of the created posts. + +###### Can you still see the image associated to that post? + +#### Basic + +###### +Can you create a post with a different image type? + +###### +Does the code obey the [good practices](https://public.01-edu.org/subjects/good-practices.en)? + +###### +Are the instructions in the website clear? + +#### 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/forum/forum-image-upload.en.md b/subjects/forum/forum-image-upload.en.md new file mode 100644 index 000000000..e625f2a0a --- /dev/null +++ b/subjects/forum/forum-image-upload.en.md @@ -0,0 +1,31 @@ +## forum-image-upload + +### Objectives + +You must follow the same [principles](https://public.01-edu.org/subjects/forum/forum.en) as the first subject. + +In forum image upload, registered users have the possibility to create a post containing an image as well as text. + +- When viewing the post, users and guests should see the image associated to it. + +There are various extensions for images like: JPEG, SVG, PNG, GIF, etc. In this project you have to handle at least JPEG, PNG and GIF types. + +This project will help you learn about: + +- Image manipulation +- Image types + +### Hints + +- Be cautious with the size of the images. + +### Instructions + +- The backend must be written in **Go**. +- You must handle website errors. +- 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 + +- Only the [standard go](https://golang.org/pkg/) packages are allowed From 736ae889e89c53c407cd69c779bd485b1f619ea2 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Wed, 4 Mar 2020 14:53:40 +0000 Subject: [PATCH 137/146] general question --- subjects/forum/forum-image-upload.audit.en.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subjects/forum/forum-image-upload.audit.en.md b/subjects/forum/forum-image-upload.audit.en.md index 074c9517f..623feab4e 100644 --- a/subjects/forum/forum-image-upload.audit.en.md +++ b/subjects/forum/forum-image-upload.audit.en.md @@ -20,10 +20,12 @@ ###### Can you still see the image associated to that post? -#### Basic +#### General ###### +Can you create a post with a different image type? +#### Basic + ###### +Does the code obey the [good practices](https://public.01-edu.org/subjects/good-practices.en)? ###### +Are the instructions in the website clear? From 77227c4198e3969e781516f0ec2fb8f0f11f67df Mon Sep 17 00:00:00 2001 From: OGordoo Date: Mon, 16 Mar 2020 11:41:53 +0000 Subject: [PATCH 138/146] image size refactor --- subjects/forum/forum-image-upload.audit.en.md | 4 ++-- subjects/forum/forum-image-upload.en.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/subjects/forum/forum-image-upload.audit.en.md b/subjects/forum/forum-image-upload.audit.en.md index 623feab4e..d915e2f24 100644 --- a/subjects/forum/forum-image-upload.audit.en.md +++ b/subjects/forum/forum-image-upload.audit.en.md @@ -12,9 +12,9 @@ ###### Was the post created successfully? -##### If is not restricted, try to create a post with a [large image](https://effigis.com/wp-content/themes/effigis_2014/img/RapidEye_RapidEye_5m_RGB_Altotting_Germany_Agriculture_and_Forestry_2009MAY17_8bits_sub_r_2.jpg). If it is restricted search for image with a size slightly below that limit. +##### Try to create a post with an [image](https://effigis.com/wp-content/themes/effigis_2014/img/RapidEye_RapidEye_5m_RGB_Altotting_Germany_Agriculture_and_Forestry_2009MAY17_8bits_sub_r_2.jpg) bigger than 20mb. -###### Was the post created successfully? +###### Were you warned that this was not possible? ##### Try navigating through the site and come back to one of the created posts. diff --git a/subjects/forum/forum-image-upload.en.md b/subjects/forum/forum-image-upload.en.md index e625f2a0a..3b404b2fe 100644 --- a/subjects/forum/forum-image-upload.en.md +++ b/subjects/forum/forum-image-upload.en.md @@ -10,6 +10,8 @@ In forum image upload, registered users have the possibility to create a post co There are various extensions for images like: JPEG, SVG, PNG, GIF, etc. In this project you have to handle at least JPEG, PNG and GIF types. +The max size of the images to load should be 20 mb. If it is tried to load an image bigger than that it should inform the user with an error message, that the image is too big. + This project will help you learn about: - Image manipulation From 39c680dbff9dfce7665696b4082ef0dcbfcd77f5 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 03:16:08 +0000 Subject: [PATCH 139/146] clarification and typos --- subjects/forum/forum-image-upload.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/forum/forum-image-upload.en.md b/subjects/forum/forum-image-upload.en.md index 3b404b2fe..02529c0be 100644 --- a/subjects/forum/forum-image-upload.en.md +++ b/subjects/forum/forum-image-upload.en.md @@ -4,13 +4,13 @@ You must follow the same [principles](https://public.01-edu.org/subjects/forum/forum.en) as the first subject. -In forum image upload, registered users have the possibility to create a post containing an image as well as text. +In `forum image upload`, registered users have the possibility to create a post containing an image as well as text. - When viewing the post, users and guests should see the image associated to it. There are various extensions for images like: JPEG, SVG, PNG, GIF, etc. In this project you have to handle at least JPEG, PNG and GIF types. -The max size of the images to load should be 20 mb. If it is tried to load an image bigger than that it should inform the user with an error message, that the image is too big. +The max size of the images to load should be 20 mb. If there is an attempt to load an image greater than 20mb, an error message should inform the user that the image is too big. This project will help you learn about: From 204f56b7823c42b27f4df2bb83245bd36f727d89 Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 9 Mar 2020 17:06:32 +0000 Subject: [PATCH 140/146] forum moderation --- subjects/forum/forum-moderation.audit.md | 49 +++++++++++++++++++++++ subjects/forum/forum-moderation.en.md | 51 ++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 subjects/forum/forum-moderation.audit.md create mode 100644 subjects/forum/forum-moderation.en.md diff --git a/subjects/forum/forum-moderation.audit.md b/subjects/forum/forum-moderation.audit.md new file mode 100644 index 000000000..ed47c4b31 --- /dev/null +++ b/subjects/forum/forum-moderation.audit.md @@ -0,0 +1,49 @@ +#### Functional + +###### Does the forum present the 4 types of users? + +##### Try to enter the forum as a Guest + +###### Can you confirm that it is only possible to see the content? + +##### Try registering as a normal user. + +###### Can you create posts and comments? + +##### Try registering as a normal user. + +###### Can you like or dislike a post? + +##### Try registering has a moderator, and see if the admin user has received the request. + +###### Can you confirm that the admin received the request? + +##### Try accepting a moderator using the admin user. + +###### Has the moderator been promoted? + +##### Try using the moderator to delete a obscene post + +###### Can you confirm that it is possible? + +##### Try using the moderator to report a illegal post + +###### Did the admin user received the report? + +##### Try using the admin user to answer the moderator request. + +###### Did the moderator received the answer from the admin? + +##### Try using an admin user to demote a moderator. + +###### Can you confirm that it is possible? + +#### General + +###### +Does the project present more then 4 types of users? + +#### 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/forum/forum-moderation.en.md b/subjects/forum/forum-moderation.en.md new file mode 100644 index 000000000..8fd548fb5 --- /dev/null +++ b/subjects/forum/forum-moderation.en.md @@ -0,0 +1,51 @@ +## forum-moderation + +### Objectives + +You must follow the same [principles](https://public.01-edu.org/subjects/forum/forum.en) as the first subject. + +The forum-moderation will be based on moderation system. It must present a moderator that, depending on the access level of a user or the forum set-up, approves posted messages before it becomes publicly visible. + +- The filtering can be done depending on the categories of the post being sorted by irrelevance, obscene, illegal or insulting. + +For this optional you should take into account all the type of users that can exist in a forum and their levels. + +You should implement at least 4 types of users : + +#### Guest + +- These are unregistered-users that neither can post, comment, like or dislike a post, only having the permission to see the posts, comments, likes or dislikes. + +#### Users + +- These are the users that will be able to create, comment, like or dislike posts. + +#### Moderators + +- Moderators, as explained above are users that are granted access to special functions : + - They should monitor the content in the forum by deleting or reporting post to the admin +- To create a moderator the user should request an admin for that role + +#### Administration + +- Users that manage the technical details required for running the forum. This user must be able to : + - Promote or demote a normal user to or from a moderator user. + - Receive reports from moderators. If the admin receives a report from a moderator, he can respond to that report + - Delete posts and comments + - Manage the categories, creating and deleting them. + +This project will help you learn about : + +- Moderation System +- User access levels + +### Allowed packages + +- All [standard go](https://golang.org/pkg/) packages are allowed. + +### Instructions + +- You must handle website errors, HTTPS status. +- You must handle all sort of technical errors. +- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). +- It is recommend that the code should present a **test file**. From a40f3b29e0cce6928988199b44d3b059d7733ffe Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 16 Mar 2020 16:51:29 +0000 Subject: [PATCH 141/146] corrections --- subjects/forum/forum-moderation.audit.md | 2 +- subjects/forum/forum-moderation.en.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/forum/forum-moderation.audit.md b/subjects/forum/forum-moderation.audit.md index ed47c4b31..894dbd8de 100644 --- a/subjects/forum/forum-moderation.audit.md +++ b/subjects/forum/forum-moderation.audit.md @@ -14,7 +14,7 @@ ###### Can you like or dislike a post? -##### Try registering has a moderator, and see if the admin user has received the request. +##### Try registering as a moderator. Then login to a admin account and see if the admin user has received the request. ###### Can you confirm that the admin received the request? diff --git a/subjects/forum/forum-moderation.en.md b/subjects/forum/forum-moderation.en.md index 8fd548fb5..d15d73514 100644 --- a/subjects/forum/forum-moderation.en.md +++ b/subjects/forum/forum-moderation.en.md @@ -22,7 +22,7 @@ You should implement at least 4 types of users : #### Moderators -- Moderators, as explained above are users that are granted access to special functions : +- Moderators, as explained above are users that have granted access to special functions : - They should monitor the content in the forum by deleting or reporting post to the admin - To create a moderator the user should request an admin for that role From 5f8c145b31a1f9087c5240b8832b919ab87d50c0 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 03:23:24 +0000 Subject: [PATCH 142/146] fix of typos --- subjects/forum/forum-moderation.en.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/subjects/forum/forum-moderation.en.md b/subjects/forum/forum-moderation.en.md index d15d73514..a4c954bee 100644 --- a/subjects/forum/forum-moderation.en.md +++ b/subjects/forum/forum-moderation.en.md @@ -4,17 +4,17 @@ You must follow the same [principles](https://public.01-edu.org/subjects/forum/forum.en) as the first subject. -The forum-moderation will be based on moderation system. It must present a moderator that, depending on the access level of a user or the forum set-up, approves posted messages before it becomes publicly visible. +The `forum-moderation` will be based on a moderation system. It must present a moderator that, depending on the access level of a user or the forum set-up, approves posted messages before they become publicly visible. -- The filtering can be done depending on the categories of the post being sorted by irrelevance, obscene, illegal or insulting. +- The filtering can be done depending on the categories of the post being sorted by irrelevant, obscene, illegal or insulting. -For this optional you should take into account all the type of users that can exist in a forum and their levels. +For this optional you should take into account all types of users that can exist in a forum and their levels. You should implement at least 4 types of users : -#### Guest +#### Guests -- These are unregistered-users that neither can post, comment, like or dislike a post, only having the permission to see the posts, comments, likes or dislikes. +- These are unregistered-users that can neither post, comment, like or dislike a post. They only have the permission to **see** those posts, comments, likes or dislikes. #### Users @@ -22,17 +22,17 @@ You should implement at least 4 types of users : #### Moderators -- Moderators, as explained above are users that have granted access to special functions : - - They should monitor the content in the forum by deleting or reporting post to the admin +- Moderators, as explained above, are users that have a granted access to special functions : + - They should be able to monitor the content in the forum by deleting or reporting post to the admin - To create a moderator the user should request an admin for that role -#### Administration +#### Administrators - Users that manage the technical details required for running the forum. This user must be able to : - - Promote or demote a normal user to or from a moderator user. + - Promote or demote a normal user to, or from a moderator user. - Receive reports from moderators. If the admin receives a report from a moderator, he can respond to that report - Delete posts and comments - - Manage the categories, creating and deleting them. + - Manage the categories, by being able to creating and deleting them. This project will help you learn about : @@ -48,4 +48,4 @@ This project will help you learn about : - You must handle website errors, HTTPS status. - You must handle all sort of technical errors. - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). -- It is recommend that the code should present a **test file**. +- It is recommended that the code should present a **test file**. From 5ceeaabdd0e6a644c363bf16792ca286c5987bbc Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 03:25:57 +0000 Subject: [PATCH 143/146] fix of typos --- subjects/forum/forum-moderation.audit.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subjects/forum/forum-moderation.audit.md b/subjects/forum/forum-moderation.audit.md index 894dbd8de..f0d37a3d0 100644 --- a/subjects/forum/forum-moderation.audit.md +++ b/subjects/forum/forum-moderation.audit.md @@ -4,7 +4,7 @@ ##### Try to enter the forum as a Guest -###### Can you confirm that it is only possible to see the content? +###### Can you confirm that the content is only viewable? ##### Try registering as a normal user. @@ -14,7 +14,7 @@ ###### Can you like or dislike a post? -##### Try registering as a moderator. Then login to a admin account and see if the admin user has received the request. +##### Try registering as a moderator. Then login to an admin account and see if the admin user has received the request. ###### Can you confirm that the admin received the request? @@ -28,11 +28,11 @@ ##### Try using the moderator to report a illegal post -###### Did the admin user received the report? +###### Did the admin user receive the report? ##### Try using the admin user to answer the moderator request. -###### Did the moderator received the answer from the admin? +###### Did the moderator receive the answer from the admin? ##### Try using an admin user to demote a moderator. From b3de6d147b5355f246e08bf580f8810060820c01 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 03:31:35 +0000 Subject: [PATCH 144/146] typo --- subjects/forum/forum-security.en.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subjects/forum/forum-security.en.md b/subjects/forum/forum-security.en.md index 886d297c6..f61a1f23a 100644 --- a/subjects/forum/forum-security.en.md +++ b/subjects/forum/forum-security.en.md @@ -7,6 +7,7 @@ You must follow the same [principles](https://public.01-edu.org/subjects/forum/f For this project you must take into account the security of your forum. - You should implement a Hypertext Transfer Protocol Secure ([HTTPS](https://www.globalsign.com/en/blog/the-difference-between-http-and-https)) protocol : + - Encrypted connection : for this you will have to generate an SSL certificate, you can think of this like a identity card for your website. You can create your certificates or use "Certificate Authorities"(CA's) - Clients session cookies should be unique. For instance, the session state is stored on the server and the session should present an unique identifier. This way the client has no direct access to it. Therefore, there is no way for attackers to read or tamper with session state. @@ -39,7 +40,7 @@ This project will help you learn about : - You must handle website errors, HTTPS status. - You must handle all sort of technical errors. - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). -- It is recommend that the code should present a **test file**. +- It is recommended that the code should present a **test file**. ### Allowed packages From 9c4997988b2c3b05a71a8f9656c487be36b96dcf Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 18 Mar 2020 03:33:18 +0000 Subject: [PATCH 145/146] clarification --- subjects/forum/forum-security.audit.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/forum/forum-security.audit.en.md b/subjects/forum/forum-security.audit.en.md index ed3cb5589..05d9f2e94 100644 --- a/subjects/forum/forum-security.audit.en.md +++ b/subjects/forum/forum-security.audit.en.md @@ -24,9 +24,9 @@ ###### Does the session cookie present a UUID(Universal Unique Identifier)? -###### Does the project present a way to configure the certificates information, either via .env or config files or other method? +###### Does the project present a way to configure the certificates information, either via .env or config files or another method? -###### Are the allowed packages being respected? +###### Are only the allowed packages being used? #### General From 7aff5f5b9e8f380c3cb15d92d2f0245ee3430720 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Wed, 25 Mar 2020 17:57:28 +0100 Subject: [PATCH 146/146] Add script to configure debian-based systems (servers & dev machines) --- scripts/install-debian.sh | 161 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100755 scripts/install-debian.sh diff --git a/scripts/install-debian.sh b/scripts/install-debian.sh new file mode 100755 index 000000000..f91e86040 --- /dev/null +++ b/scripts/install-debian.sh @@ -0,0 +1,161 @@ +#!/usr/bin/env bash + +# Unofficial Bash Strict Mode +set -euo pipefail +IFS=' +' + +# Debian stable OS +apt-get update +apt-get -y upgrade +apt-get -y dist-upgrade + +# Disable OpenStack SSH malware +mv /home/debian/.ssh/authorized_keys /root/.ssh/authorized_keys ||: +sed -i '/Generated-by-Nova/d' /root/.ssh/authorized_keys ||: +chown root:root /root/.ssh/authorized_keys ||: + +# Terminal goodies +touch .hushlogin + +cat <<'EOF'>> /root/.bashrc +export LS_OPTIONS="--color=auto" +eval "`dircolors`" + +alias ctop="docker run --rm -it --name=ctop -v /var/run/docker.sock:/var/run/docker.sock:ro quay.io/vektorlab/ctop" +alias df="df --si" +alias du="du -cs --si" +alias free="free -h --si" +alias l="ls $LS_OPTIONS -al --si --group-directories-first" +alias less="less -i" +alias nano="nano -clDOST4" +alias pstree="pstree -palU" +alias gobuild='CGO_ENABLED=0 GOARCH=amd64 go build -trimpath -ldflags="-s -w"' + +export HISTFILESIZE= +export HISTSIZE= +export HISTTIMEFORMAT="%F %T " + +GOPATH=$HOME/go +HISTCONTROL=ignoreboth +HISTFILESIZE= +HISTSIZE= +HISTTIMEFORMAT="%F %T " +EOF + +cat <> /etc/inputrc +set completion-ignore-case +set show-all-if-ambiguous On +set show-all-if-unmodified On +EOF + +cat <> /etc/bash.bashrc +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi +EOF + +# Basic packages +apt-get -y install man bash-completion git ufw jq curl build-essential netcat wget psmisc lz4 file net-tools brotli unzip zip moreutils xauth sysfsutils rsync iperf pv tree mc screen + +# Configure screen +cat <<'EOF'>> /etc/screenrc +startup_message off +shell -$SHELL +defscrollback 100000 +bind l eval clear "scrollback 0" "scrollback 100000" +EOF + +# Configure SSH +cat <> /etc/ssh/sshd_config +Port 521 +PasswordAuthentication no +AllowUsers root +X11UseLocalhost no +EOF +service ssh restart + +touch /root/.Xauthority + +# Firewall +ufw allow in 80/tcp +ufw allow in 443/tcp +ufw allow in 521/tcp +ufw logging off +ufw --force enable +ufw --force delete 4 +ufw --force delete 4 +ufw --force delete 4 + +# Optimize +systemctl disable unattended-upgrades.service apt-daily.timer apt-daily-upgrade.timer console-setup.service keyboard-setup.service remote-fs.target man-db.timer systemd-timesyncd.service +apt-get -y purge apparmor +sed -i 's/MODULES=most/MODULES=dep/g' /etc/initramfs-tools/initramfs.conf +sed -i 's/COMPRESS=gzip/COMPRESS=lz4/g' /etc/initramfs-tools/initramfs.conf +update-initramfs -u +echo 'GRUB_TIMEOUT=0' >> /etc/default/grub +update-grub +apt-get -y purge exim\* + +for i in $(seq 0 $(nproc --ignore 1)); do + echo "devices/system/cpu/cpu${i}/cpufreq/scaling_governor = performance" >> /etc/sysfs.conf +done + +# Disable sleep when closing laptop screen +echo HandleLidSwitch=ignore >> /etc/systemd/logind.conf + +# noatime +sed -i 's| / ext4 | / ext4 noatime,|g' /etc/fstab + +# Disable swap +swapoff -a +sed -i '/swap/d' /etc/fstab + +# node.JS & yarn +curl -sL https://deb.nodesource.com/setup_12.x | bash - +apt-get -y install nodejs +curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - +echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list +apt-get update +apt-get -y install yarn + +# Docker +apt-get -y install apt-transport-https ca-certificates curl gnupg2 software-properties-common +curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - +add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" +apt-get update +apt-get -y install docker-ce docker-ce-cli containerd.io + +# ripgrep +curl -LO https://github.com/BurntSushi/ripgrep/releases/download/11.0.2/ripgrep_11.0.2_amd64.deb +dpkg -i ripgrep_11.0.2_amd64.deb +rm ripgrep_11.0.2_amd64.deb + +# Go +wget https://dl.google.com/go/go1.14.linux-amd64.tar.gz +tar -C /usr/local -xzf go1.14.linux-amd64.tar.gz +rm go1.14.linux-amd64.tar.gz +echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile + +# Netdata +# bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh) --no-updates --stable-channel --disable-telemetry + +# Caddy +curl https://getcaddy.com | bash -s personal http.ipfilter + +# Generate SSH key +ssh-keygen -ted25519 -f ~/.ssh/id_ed25519 -N '' + +# Cleanup +sed -i '/^deb-src/d' /etc/apt/sources.list +apt-get update +apt-get -y purge unattended-upgrades +apt-get -y autoremove --purge +apt-get clean + +# The end +reboot