Browse Source

Refactor & Beautify & destruction commit

return early, remove else branches, reorder conditions and top-level functions, remove empty lines, remove unnecessary append(), fix typos, stop using testing package, remove dead code, fix mistakes in subjects, tests and solutions, remove disclaimers, reformat comments, simplify solutions, tests, add more instructions to subjects, remove obsolete files, etc.
Some of the reasons behind those modifications will be added to good-practices.en.md
Some of the exercises are now broken, they will have to be fixed, most of them have a "TODO:" comment.
pull/533/head
Xavier Petit 4 years ago committed by xpetit
parent
commit
0424daa985
  1. 8
      .github/ISSUE_TEMPLATE/bug_report.md
  2. 7
      .github/ISSUE_TEMPLATE/feature_request.md
  3. 17
      docs/addition_of_exercise_draft.md
  4. 1
      docs/server-installation.md
  5. 4
      docs/server-requirements.md
  6. 11
      docs/tasks.md
  7. 12
      rc/README.md
  8. 2
      rc/rc.go
  9. 2
      subjects/activebits.en.md
  10. 15
      subjects/addlinkednumbers.en.md
  11. 4
      subjects/advancedsortwordarr.en.md
  12. 6
      subjects/alphacount.en.md
  13. 5
      subjects/alphamirror.en.md
  14. 14
      subjects/any.en.md
  15. 36
      subjects/ascii-art/ascii-art.audit.en.md
  16. 15
      subjects/atoibaseprog.en.md
  17. 15
      subjects/atoiprog.en.md
  18. 6
      subjects/basicatoi.en.md
  19. 2
      subjects/basicatoi2.en.md
  20. 2
      subjects/basicjoin.en.md
  21. 8
      subjects/boolean.en.md
  22. 5
      subjects/brackets.en.md
  23. 3
      subjects/capitalizeprog.en.md
  24. 18
      subjects/changeorder.en.md
  25. 11
      subjects/chunk.en.md
  26. 5
      subjects/cleanstr.en.md
  27. 20
      subjects/compact.en.md
  28. 3
      subjects/concatparams.en.md
  29. 2
      subjects/costumeprofit.en.md
  30. 2
      subjects/countif.en.md
  31. 7
      subjects/displaya.en.md
  32. 3
      subjects/displayalpham.en.md
  33. 3
      subjects/displayalrevm.en.md
  34. 4
      subjects/displayz.en.md
  35. 17
      subjects/doppelgangerprog.en.md
  36. 9
      subjects/expandstr.en.md
  37. 15
      subjects/fib.en.md
  38. 15
      subjects/findprevprimeprog.en.md
  39. 11
      subjects/firstruneprog.en.md
  40. 4
      subjects/firstword.en.md
  41. 5
      subjects/fixthemain.en.md
  42. 13
      subjects/foldint.en.md
  43. 8
      subjects/foreach.en.md
  44. 19
      subjects/foreachprog.en.md
  45. 7
      subjects/fprime.en.md
  46. 15
      subjects/game23.en.md
  47. 20
      subjects/gcd.en.md
  48. 377
      subjects/go-reloaded/go-reloaded.audit.en.md
  49. 12
      subjects/go-reloaded/go-reloaded.en.md
  50. 6
      subjects/grouping.en.md
  51. 15
      subjects/halfcontestprog.en.md
  52. 5
      subjects/hiddenp.en.md
  53. 2
      subjects/inter.en.md
  54. 11
      subjects/interestingnumber.en.md
  55. 11
      subjects/inverttree.en.md
  56. 11
      subjects/isanagram.en.md
  57. 14
      subjects/ispowerof2.en.md
  58. 13
      subjects/issorted.en.md
  59. 11
      subjects/itoabaseprog.en.md
  60. 11
      subjects/itoaprog.en.md
  61. 2
      subjects/join.en.md
  62. 11
      subjects/lastruneprog.en.md
  63. 8
      subjects/lastword.en.md
  64. 11
      subjects/lcm.en.md
  65. 11
      subjects/listremoveifprog.en.md
  66. 11
      subjects/listsizeprog.en.md
  67. 8
      subjects/map.en.md
  68. 8
      subjects/max.en.md
  69. 17
      subjects/maxprog.en.md
  70. 11
      subjects/merge.en.md
  71. 11
      subjects/nauuo.en.md
  72. 2
      subjects/nbrconvertalpha.en.md
  73. 2
      subjects/nenokku.en.md
  74. 11
      subjects/nruneprog.en.md
  75. 3
      subjects/piglatin.en.md
  76. 11
      subjects/printmemory.en.md
  77. 4
      subjects/printprogramname.en.md
  78. 6
      subjects/printwordstables.en.md
  79. 19
      subjects/priorprime.en.md
  80. 16
      subjects/raid1a.en.md
  81. 16
      subjects/raid1b.en.md
  82. 16
      subjects/raid1c.en.md
  83. 16
      subjects/raid1d.en.md
  84. 16
      subjects/raid1e.en.md
  85. 6
      subjects/range.en.md
  86. 25
      subjects/reachablenumberprog.en.md
  87. 3
      subjects/rectangle.en.md
  88. 11
      subjects/reduceint.en.md
  89. 14
      subjects/repeatalpha.en.md
  90. 15
      subjects/reverse.en.md
  91. 15
      subjects/reversebits.en.md
  92. 6
      subjects/reverserange.en.md
  93. 25
      subjects/revivethreenums.en.md
  94. 2
      subjects/robottoorigin.en.md
  95. 4
      subjects/romannumbers.en.md
  96. 3
      subjects/rot13.en.md
  97. 7
      subjects/rot14.en.md
  98. 2
      subjects/rot14prog.en.md
  99. 11
      subjects/sametree.en.md
  100. 3
      subjects/searchreplace.en.md
  101. Some files were not shown because too many files changed in this diff diff.show_more

8
.github/ISSUE_TEMPLATE/bug_report.md

@ -2,9 +2,8 @@
name: Bug report name: Bug report
about: Create a report to help us improve about: Create a report to help us improve
title: "[INSCRIPTION FORM] - input type date doesn't appear in safari" title: "[INSCRIPTION FORM] - input type date doesn't appear in safari"
labels: '' labels: ""
assignees: '' assignees: ""
--- ---
**Describe the bug** **Describe the bug**
@ -12,6 +11,7 @@ A clear and concise description of what the bug is.
**To Reproduce** **To Reproduce**
Steps to reproduce the behavior: Steps to reproduce the behavior:
1. Go to '...' 1. Go to '...'
2. Click on '....' 2. Click on '....'
3. Scroll down to '....' 3. Scroll down to '....'
@ -24,11 +24,13 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem. If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):** **Desktop (please complete the following information):**
- OS: [e.g. iOS] - OS: [e.g. iOS]
- Browser [e.g. chrome, safari] - Browser [e.g. chrome, safari]
- Version [e.g. 22] - Version [e.g. 22]
**Smartphone (please complete the following information):** **Smartphone (please complete the following information):**
- Device: [e.g. iPhone6] - Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1] - OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari] - Browser [e.g. stock browser, safari]

7
.github/ISSUE_TEMPLATE/feature_request.md

@ -1,10 +1,9 @@
--- ---
name: Feature request name: Feature request
about: Suggest an idea for this project about: Suggest an idea for this project
title: '' title: ""
labels: '' labels: ""
assignees: '' assignees: ""
--- ---
**Is your feature request related to a problem? Please describe.** **Is your feature request related to a problem? Please describe.**

17
docs/addition_of_exercise_draft.md

@ -1,6 +1,5 @@
# THE ADDITION OF EXERCISE PROCEDURE # THE ADDITION OF EXERCISE PROCEDURE
##### This is for a go exercise in the piscine-go ##### This is for a go exercise in the piscine-go
## **1. Writing the subject and / or writing the solution** ## **1. Writing the subject and / or writing the solution**
@ -39,13 +38,12 @@ Some students found this mistake. An update of the subject during the exam treat
2. Always check the formating md 2. Always check the formating md
------ ---
### fprime <span style="color:#ff3234">(Title of the exercise)</span> ### fprime <span style="color:#ff3234">(Title of the exercise)</span>
#### Instructions <span style="color:#ff3234">(Instructions of the exercise)</span> #### Instructions <span style="color:#ff3234">(Instructions of the exercise)</span>
Write a program that takes a positive `int` and displays its prime factors, followed by a newline (`'\n'`). <span style="color:#ff3234">(general guidelines, notice the imperative style tense and the avoidance of “you”. “You” is authorized in the case of a presence of a back story where the player is immersed)</span> Write a program that takes a positive `int` and displays its prime factors, followed by a newline (`'\n'`). <span style="color:#ff3234">(general guidelines, notice the imperative style tense and the avoidance of “you”. “You” is authorized in the case of a presence of a back story where the player is immersed)</span>
- Factors must be displayed in ascending order and separated by `*`. <span style="color:#ff3234">(formating requirement) </span> - Factors must be displayed in ascending order and separated by `*`. <span style="color:#ff3234">(formating requirement) </span>
@ -79,11 +77,11 @@ student@ubuntu:~/piscine-go/test$ ./test 1
student@ubuntu:~/piscine-go/test$ student@ubuntu:~/piscine-go/test$
``` ```
------ ---
## **2. Creating the files for tests (4 main cases)** ## **2. Creating the files for tests (4 main cases)**
### always in -> *all/tests/go/* ### always in -> _all/tests/go/_
### **Folder organization** ### **Folder organization**
@ -154,7 +152,7 @@ go
| __ student (the same thing as the solutions, just run "cp -aT solutions/ student/") | __ student (the same thing as the solutions, just run "cp -aT solutions/ student/")
``` ```
------ ---
## **3. Writing a file_test.go (test file for go)** ## **3. Writing a file_test.go (test file for go)**
@ -212,7 +210,7 @@ z01.Challenge(t, studentSol, studentStu) // if the program doesn’t have argume
z01.Challenge(t, studentSol, studentStu, args...) //if the program has arguments z01.Challenge(t, studentSol, studentStu, args...) //if the program has arguments
``` ```
------ ---
## **4. Testing locally (`go test` or `go test -run=Test\<nameOfTheFunction\>`)** ## **4. Testing locally (`go test` or `go test -run=Test\<nameOfTheFunction\>`)**
@ -247,7 +245,7 @@ go test -run=TestDoop
- Program exercise in the exam `(dooprog)` Screenshots to be added. - Program exercise in the exam `(dooprog)` Screenshots to be added.
Here you can do just *go test*, because there's only one test file Here you can do just _go test_, because there's only one test file
`all/test/go/student/dooprog` `all/test/go/student/dooprog`
@ -263,10 +261,9 @@ go test
go test go test
``` ```
### **NOTE:** If a go test gives a (cached) result, use this type of command (example with raid3): ### **NOTE:** If a go test gives a (cached) result, use this type of command (example with raid3):
```go test count=1 raid3_test.go``` `go test count=1 raid3_test.go`
The result should be an OK message: The result should be an OK message:

1
docs/server-installation.md

@ -44,4 +44,3 @@ raw.githubusercontent.com/01-edu/public/master/scripts/preseed.cfg
``` ```
and select "Continue", let us know when the server's remote access is ready, we will configure it. and select "Continue", let us know when the server's remote access is ready, we will configure it.

4
docs/server-requirements.md

@ -3,7 +3,7 @@
**Linux compatible only** **Linux compatible only**
| Component | Recommended specifications | | Component | Recommended specifications |
| --------- | --------------------------------- | | --------- | --------------------------- |
| Processor | 16 threads x86-64 (64 bits) | | Processor | 16 threads x86-64 (64 bits) |
| Memory | 64 GB ECC DDR4 2133 Mhz frequency | | Memory | 16 GB DDR4 |
| Disk | 500 GB SSD NVMe | | Disk | 500 GB SSD NVMe |

11
docs/tasks.md

@ -1,11 +0,0 @@
# Tasks
- [x] Install, connect, check the server and the HP clients (_Alem_, _Vitalii_)
- [x] Check the settings of the virtual machine (_01_, _Vitalii_)
- [x] Install the server (_01_, _Vitalii_)
- [x] Tests & benchmark of the server (_01_)
- [x] Test the [OS deployment](https://github.com/01-edu/public/blob/master/docs/os-deployment.md) (_01_, _Vitalii_)
- [ ] Write process documentation (_01_, _Alem_, _Vitalii_)
- [ ] Ensure the tester only works inside the school (_01_, _Alem_)
- [ ] Ensure the exam app works as expected (_01_, _Alem_)
- [ ] Test the entire piscine (_01_, _Alem_)

12
rc/README.md

@ -45,6 +45,7 @@ The program must be executed passing the go source file to be analyze as the fir
- `<package>`.`<function>#amout` for certain amounts (only certain amount os a function is allowed) - `<package>`.`<function>#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) - 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 - Allowed built-in functions
- Use the name of the built-in function - Use the name of the built-in function
- Ex: `make`, `append`, `len`. - Ex: `make`, `append`, `len`.
- Allowed casting - Allowed casting
@ -52,6 +53,7 @@ The program must be executed passing the go source file to be analyze as the fir
- Or use the flag `--cast`, to allow every type of casting - Or use the flag `--cast`, to allow every type of casting
- Import relative packages - Import relative packages
- Use the relative path - Use the relative path
- Ex: `../piscine`, `..`, `.` - Ex: `../piscine`, `..`, `.`
@ -70,8 +72,10 @@ The program must be executed passing the go source file to be analyze as the fir
```console ```console
_$ ./rc main.go fmt.* github.com/01-edu/z01.PrintRune len --no-array --no-lit=[b-yB-Y] _$ ./rc main.go fmt.* github.com/01-edu/z01.PrintRune len --no-array --no-lit=[b-yB-Y]
``` ```
- Optional lasts arguments - 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 - The flag `--no-array` must be given as the last argument or to signal that all the arguments after are unallowed array types
### Usage: ### Usage:
- To allow the import of the whole `fmt` package, `z01.PrintRune` and the built-in functions len in the file `main.go` - To allow the import of the whole `fmt` package, `z01.PrintRune` and the built-in functions len in the file `main.go`
@ -81,27 +85,33 @@ The program must be executed passing the go source file to be analyze as the fir
```console ```console
_$ ./rc main.go fmt.* github.com/01-edu/z01.PrintRune len _$ ./rc main.go fmt.* github.com/01-edu/z01.PrintRune len
``` ```
- More examples: - More examples:
- import "fmt" is allowed by executing - import "fmt" is allowed by executing
```console ```console
_$ ./rc sourcefile.go fmt.* _$ ./rc sourcefile.go fmt.*
``` ```
- import "go/parser" is allowed by executing - import "go/parser" is allowed by executing
```console ```console
_$ ./rc sourcefile.go go/parser.* _$ ./rc sourcefile.go go/parser.*
``` ```
- import "github.com/01-edu/z01" is allowed by executing - import "github.com/01-edu/z01" is allowed by executing
```console ```console
./rc sourcefile.go github.com/01-edu/z01.* ./rc sourcefile.go github.com/01-edu/z01.*
``` ```
- import "../../../all/tests/go/solutions" is allowed by executing - import "../../../all/tests/go/solutions" is allowed by executing
```console ```console
_$ ./rc sourcefile.go ../../../all/tests/go/solutions _$ ./rc sourcefile.go ../../../all/tests/go/solutions
``` ```
(no `.*` is needed, all the functions from this relative package are allowed) (no `.*` is needed, all the functions from this relative package are allowed)
- allow all type of casting - allow all type of casting
@ -109,6 +119,7 @@ The program must be executed passing the go source file to be analyze as the fir
```console ```console
_$ ./rc sourcefile.go ../../../all/tests/go/solutions/ztail/ztail.go fmt.* github.com/01-edu/z01 os.* strconv.* make len append --cast _$ ./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 - this will allow all type of casting in the file ztail.go
- to allow just one type of casting - to allow just one type of casting
@ -116,4 +127,5 @@ The program must be executed passing the go source file to be analyze as the fir
```console ```console
_$ ./rc sourcefile.go ../../../all/tests/go/solutions/ztail/ztail.go fmt.* github.com/01-edu/z01 os.* strconv.* make len append rune _$ ./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`, ... - this will allow `rune`, but not `int8`, ..., `string`, `float32`, ...

2
rc/rc.go

@ -93,6 +93,7 @@ func (fv *fileVisitor) getPos(n ast.Node) string {
func (p *pkgVisitor) getPos(n ast.Node) string { func (p *pkgVisitor) getPos(n ast.Node) string {
return p.Fset.Position(n.Pos()).String() return p.Fset.Position(n.Pos()).String()
} }
func (c *callVisitor) getPos(n ast.Node) string { func (c *callVisitor) getPos(n ast.Node) string {
return c.Fset.Position(n.Pos()).String() return c.Fset.Position(n.Pos()).String()
} }
@ -549,7 +550,6 @@ func (fv *fileVisitor) Visit(n ast.Node) ast.Visitor {
position: fv.getPos(n), position: fv.getPos(n),
}) })
} }
} }
if exp, ok := n.(*ast.FuncDecl); ok { if exp, ok := n.(*ast.FuncDecl); ok {

2
subjects/activebits.en.md

@ -7,7 +7,7 @@ Write a function, `ActiveBits`, that returns the number of active `bits` (bits w
### Expected function ### Expected function
```go ```go
func ActiveBits(n int) uint { func ActiveBits(n int) int {
} }
``` ```

15
subjects/addlinkednumbers.en.md

@ -1,16 +1,5 @@
## addlinkednumbers ## addlinkednumbers
## **WARNING! VERY IMPORTANT!**
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:
This means that:
- The package needs to be named `package main`.
- The submitted code needs one declared function main(`func main()`) even if empty.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done.
- Every other rules are obviously the same than for a `program`.
### Instructions ### Instructions
You have two numbers represented by a linked list, where each NodeAddL contains a single digit. You have two numbers represented by a linked list, where each NodeAddL contains a single digit.
@ -39,9 +28,7 @@ Here is a possible program to test your function:
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func pushFront(node *NodeAddL, num int) *NodeAddL { func pushFront(node *NodeAddL, num int) *NodeAddL {

4
subjects/advancedsortwordarr.en.md

@ -2,12 +2,12 @@
### Instructions ### Instructions
Write a function `AdvancedSortWordArr` that sorts a `string` array, based on the function `f` passed in parameter. Write a function `AdvancedSortWordArr` that sorts a slice of `string`, based on the function `f` passed in parameter.
### Expected function ### Expected function
```go ```go
func AdvancedSortWordArr(array []string, f func(a, b string) int) { func AdvancedSortWordArr(a []string, f func(a, b string) int) {
} }
``` ```

6
subjects/alphacount.en.md

@ -10,7 +10,7 @@ The letters are only the ones from the latin alphabet.
### Expected function ### Expected function
```go ```go
func AlphaCount(str string) int { func AlphaCount(s string) int {
} }
``` ```
@ -28,8 +28,8 @@ import (
) )
func main() { func main() {
str := "Hello 78 World! 4455 /" s := "Hello 78 World! 4455 /"
nb := piscine.AlphaCount(str) nb := piscine.AlphaCount(s)
fmt.Println(nb) fmt.Println(nb)
} }
``` ```

5
subjects/alphamirror.en.md

@ -11,7 +11,7 @@ The case of the letter stays the same, for example :
The final result will be followed by a newline (`'\n'`). 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'`). If the number of arguments is different from 1, the program displays nothing.
### Usage ### Usage
@ -21,7 +21,6 @@ student@ubuntu:~/[[ROOT]]/alphamirror$ ./alphamirror "abc"
zyx zyx
student@ubuntu:~/[[ROOT]]/alphamirror$ ./alphamirror "My horse is Amazing." | cat -e student@ubuntu:~/[[ROOT]]/alphamirror$ ./alphamirror "My horse is Amazing." | cat -e
Nb slihv rh Znzarmt.$ Nb slihv rh Znzarmt.$
student@ubuntu:~/[[ROOT]]/alphamirror$ ./alphamirror | cat -e student@ubuntu:~/[[ROOT]]/alphamirror$ ./alphamirror
$
student@ubuntu:~/[[ROOT]]/alphamirror$ student@ubuntu:~/[[ROOT]]/alphamirror$
``` ```

14
subjects/any.en.md

@ -2,14 +2,14 @@
### Instructions ### Instructions
Write a function `Any` that returns `true`, for a `string` array : Write a function `Any` that returns `true`, for a `string` slice :
- if, when that `string` array is passed through an `f` function, at least one element returns `true`. - if, when that `string` slice is passed through an `f` function, at least one element returns `true`.
### Expected function ### Expected function
```go ```go
func Any(f func(string) bool, arr []string) bool { func Any(f func(string) bool, a []string) bool {
} }
``` ```
@ -27,11 +27,11 @@ import (
) )
func main() { func main() {
tab1 := []string{"Hello", "how", "are", "you"} a1 := []string{"Hello", "how", "are", "you"}
tab2 := []string{"This", "is", "4", "you"} a2 := []string{"This", "is", "4", "you"}
result1 := piscine.Any(piscine.IsNumeric, tab1) result1 := piscine.Any(piscine.IsNumeric, a1)
result2 := piscine.Any(piscine.IsNumeric, tab2) result2 := piscine.Any(piscine.IsNumeric, a2)
fmt.Println(result1) fmt.Println(result1)
fmt.Println(result2) fmt.Println(result2)

36
subjects/ascii-art/ascii-art.audit.en.md

@ -3,6 +3,7 @@
###### 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? (Reminder for this project: (only [standard packages](https://golang.org/pkg/)
##### Try passing as argument `"hello"`. ##### Try passing as argument `"hello"`.
``` ```
_ _ _ _ _ _
| | | | | | | | | | | |
@ -13,9 +14,11 @@
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing as argument `"HELLO"`. ##### Try passing as argument `"HELLO"`.
``` ```
_ _ ______ _ _ ____ _ _ ______ _ _ ____
| | | | | ____| | | | | / __ \ | | | | | ____| | | | | / __ \
@ -26,9 +29,11 @@
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing as argument `"HeLlo HuMaN"`. ##### Try passing as argument `"HeLlo HuMaN"`.
``` ```
_ _ _ _ _ _ __ __ _ _ _ _ _ _ _ _ __ __ _ _
| | | | | | | | | | | | | \/ | | \ | | | | | | | | | | | | | | | \/ | | \ | |
@ -39,9 +44,11 @@
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing as argument `"1Hello 2There"`. ##### Try passing as argument `"1Hello 2There"`.
``` ```
_ _ _ _ _______ _ _ _ _ _ _______ _
_ | | | | | | | | ____ |__ __| | | _ | | | | | | | | ____ |__ __| | |
@ -52,9 +59,11 @@
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing as argument `"Hello\nThere"`. ##### Try passing as argument `"Hello\nThere"`.
``` ```
_ _ _ _ _ _ _ _
| | | | | | | | | | | | | | | |
@ -73,9 +82,11 @@
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `"{Hello & There #}"` as argument. ##### Try passing `"{Hello & There #}"` as argument.
``` ```
__ _ _ _ _ _______ _ _ _ __ __ _ _ _ _ _______ _ _ _ __
/ / | | | | | | | | ___ |__ __| | | _| || |_ \ \ / / | | | | | | | | ___ |__ __| | | _| || |_ \ \
@ -86,9 +97,11 @@
\_\ /_/ \_\ /_/
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `"hello There 1 to 2!"` as argument. ##### Try passing `"hello There 1 to 2!"` as argument.
``` ```
_ _ _ _______ _ _ _ _ _ _ _______ _ _ _
| | | | | | |__ __| | | _ | | ____ | | | | | | | | |__ __| | | _ | | ____ | |
@ -99,9 +112,11 @@
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `"MaD3IrA&LiSboN"` as argument. ##### Try passing `"MaD3IrA&LiSboN"` as argument.
``` ```
__ __ _____ _____ _ _ _____ _ _ _ __ __ _____ _____ _ _ _____ _ _ _
| \/ | | __ \ _____ |_ _| /\ ___ | | (_) / ____| | | | \ | | | \/ | | __ \ _____ |_ _| /\ ___ | | (_) / ____| | | | \ | |
@ -112,9 +127,11 @@
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `"1a\"#FdwHywR&/()="` as argument. ##### Try passing `"1a\"#FdwHywR&/()="` as argument.
``` ```
_ _ _ _ ______ _ _ _ _____ __ __ __ _ _ _ _ ______ _ _ _ _____ __ __ __
_ ( | ) _| || |_ | ____| | | | | | | | __ \ ___ / / / / \ \ ______ _ ( | ) _| || |_ | ____| | | | | | | | __ \ ___ / / / / \ \ ______
@ -125,9 +142,11 @@
__/ / \_\ /_/ __/ / \_\ /_/
|___/ |___/
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `"{|}~"` as argument. ##### Try passing `"{|}~"` as argument.
``` ```
__ _ __ /\/| __ _ __ /\/|
/ / | | \ \ |/\/ / / | | \ \ |/\/
@ -138,9 +157,11 @@
\_\ | | /_/ \_\ | | /_/
|_| |_|
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `"[\]^_ 'a"` as argument. ##### Try passing `"[\]^_ 'a"` as argument.
``` ```
___ __ ___ /\ _ ___ __ ___ /\ _
| _| \ \ |_ | |/\| ( ) | _| \ \ |_ | |/\| ( )
@ -151,9 +172,11 @@
|___| |___| ______ |___| |___| ______
|______| |______|
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `"RGB"` as argument. ##### Try passing `"RGB"` as argument.
``` ```
_____ _____ ____ _____ _____ ____
| __ \ / ____| | _ \ | __ \ / ____| | _ \
@ -164,9 +187,11 @@
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `":;<=>?@"` as argument. ##### Try passing `":;<=>?@"` as argument.
``` ```
__ __ ___ __ __ ___
_ _ / / ______ \ \ |__ \ ____ _ _ / / ______ \ \ |__ \ ____
@ -177,9 +202,11 @@
|/ \____/ |/ \____/
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `"\!\" #$%&'()*+,-./"` as argument. ##### Try passing `"\!\" #$%&'()*+,-./"` as argument.
``` ```
__ _ _ _ _ _ _ _ __ _ __ __ _ __ __ _ _ _ _ _ _ _ __ _ __ __ _ __
\ \ | | ( | ) _| || |_ | | (_) / / ___ ( ) / / \ \ /\| |/\ _ / / \ \ | | ( | ) _| || |_ | | (_) / / ___ ( ) / / \ \ /\| |/\ _ / /
@ -190,9 +217,11 @@ __ _ _ _ _ _ _ _ __ _ __ __ _
\_\ /_/ |/ \_\ /_/ |/
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `"ABCDEFGHIJKLMNOPQRSTUVWXYZ"` as argument. ##### Try passing `"ABCDEFGHIJKLMNOPQRSTUVWXYZ"` as argument.
``` ```
____ _____ _____ ______ ______ _____ _ _ _____ _ _ __ _ __ __ _ _ ____ _____ ____ _____ _____ _______ _ _ __ __ __ __ __ __ __ __ ______ ____ _____ _____ ______ ______ _____ _ _ _____ _ _ __ _ __ __ _ _ ____ _____ ____ _____ _____ _______ _ _ __ __ __ __ __ __ __ __ ______
/\ | _ \ / ____| | __ \ | ____| | ____| / ____| | | | | |_ _| | | | |/ / | | | \/ | | \ | | / __ \ | __ \ / __ \ | __ \ / ____| |__ __| | | | | \ \ / / \ \ / / \ \ / / \ \ / / |___ / /\ | _ \ / ____| | __ \ | ____| | ____| / ____| | | | | |_ _| | | | |/ / | | | \/ | | \ | | / __ \ | __ \ / __ \ | __ \ / ____| |__ __| | | | | \ \ / / \ \ / / \ \ / / \ \ / / |___ /
@ -203,9 +232,11 @@ __ _ _ _ _ _ _ _ __ _ __ __ _
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `"abcdefghijklmnopqrstuvwxyz"` as argument. ##### Try passing `"abcdefghijklmnopqrstuvwxyz"` as argument.
``` ```
_ _ __ _ _ _ _ _ _ _ __ _ _ _ _ _
| | | | / _| __ _ | | (_) (_) _ | | | | | | | | / _| __ _ | | (_) (_) _ | | | |
@ -216,18 +247,23 @@ __ _ _ _ _ _ _ _ __ _ __ __ _
|___/ _/ | | | | | __/ / |___/ _/ | | | | | __/ /
|__/ |_| |_| |___/ |__/ |_| |_| |___/
``` ```
###### Does it display the right graphical representation in ASCII as above? ###### Does it display the right graphical representation in ASCII as above?
##### Try passing `<a random string>` with at least four lower case letters and three upper case letters. ##### Try passing `<a random string>` with at least four lower case letters and three upper case letters.
###### Does it display the right graphical representation in ASCII as expected? ###### Does it display the right graphical representation in ASCII as expected?
##### Try passing `<a random string>` with at least five lower case letters, a space and two numbers. ##### Try passing `<a random string>` with at least five lower case letters, a space and two numbers.
###### Does it display the right graphical representation in ASCII as expected? ###### Does it display the right graphical representation in ASCII as expected?
##### Try passing `<a random string>` with at least one upper case letters and 3 special characters. ##### Try passing `<a random string>` with at least one upper case letters and 3 special characters.
###### Does it display the right graphical representation in ASCII as expected? ###### Does it display the right graphical representation in ASCII as expected?
##### Try passing `<a random string>` with at least two lower case letters, two spaces, one number, two special characters and three upper case letters. ##### Try passing `<a random string>` with at least two lower case letters, two spaces, one number, two special characters and three upper case letters.
###### Does it display the right graphical representation in ASCII as expected? ###### Does it display the right graphical representation in ASCII as expected?
#### Basic #### Basic

15
subjects/atoibaseprog.en.md

@ -1,16 +1,5 @@
## atoibaseprog ## atoibaseprog
## **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 ### Instructions
Write a function that takes a `string` number and its `string` base in parameters and returns its conversion as an `int`. Write a function that takes a `string` number and its `string` base in parameters and returns its conversion as an `int`.
@ -42,9 +31,7 @@ Here is a possible program to test your function :
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
fmt.Println(AtoiBase("125", "0123456789")) fmt.Println(AtoiBase("125", "0123456789"))

15
subjects/atoiprog.en.md

@ -1,16 +1,5 @@
## atoiprog ## atoiprog
## **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 ### Instructions
- 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`. - 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`.
@ -36,9 +25,7 @@ Here is a possible program to test your function :
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
s := "12345" s := "12345"

6
subjects/basicatoi.en.md

@ -2,13 +2,13 @@
### Instructions ### 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` 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 ### Expected function

2
subjects/basicatoi2.en.md

@ -2,7 +2,7 @@
### Instructions ### 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.

2
subjects/basicjoin.en.md

@ -2,7 +2,7 @@
### Instructions ### Instructions
Write a function that returns the concatenation of all the `string` of a table of `string` passed in argument. Write a function that returns the concatenation of all the `string` of a slice of `string` passed in argument.
### Expected function ### Expected function

8
subjects/boolean.en.md

@ -13,11 +13,9 @@ Create a `.go` file.
### Code to be copied ### Code to be copied
```go ```go
func printStr(str string) { func printStr(s string) {
arrayStr := []rune(str) for _, r := range s {
z01.PrintRune(r)
for i := 0; i < len(arrayStr); i++ {
z01.PrintRune(arrayStr[i])
} }
z01.PrintRune('\n') z01.PrintRune('\n')
} }

5
subjects/brackets.en.md

@ -8,7 +8,7 @@ Symbols considered as brackets are parentheses `(` and `)`, square brackets `[`
An opening bracket must always be closed by the good closing bracket in the correct order. A `string` which does not contain any bracket is considered as a correctly bracketed `string`. An opening bracket must always be closed by the good closing bracket in the correct order. A `string` which does not contain any bracket is considered as a correctly bracketed `string`.
If there is no argument, the program must print only a newline. If there is no argument, the program must print nothing.
### Usage ### Usage
@ -21,7 +21,6 @@ Error$
student@ubuntu:~/[[ROOT]]/brackets$ ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e student@ubuntu:~/[[ROOT]]/brackets$ ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e
OK$ OK$
OK$ OK$
student@ubuntu:~/[[ROOT]]/brackets$ ./brackets | cat -e student@ubuntu:~/[[ROOT]]/brackets$ ./brackets
$
student@ubuntu:~/[[ROOT]]/brackets$ student@ubuntu:~/[[ROOT]]/brackets$
``` ```

3
subjects/capitalizeprog.en.md

@ -8,7 +8,7 @@ Write a program that capitalizes the first letter of each word **and** lowercase
- 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 nothing.
### Usage : ### Usage :
@ -19,6 +19,5 @@ Hello! How Are You? How+Are+Things+4you?$
student@ubuntu:~/capitalizeprog$ ./capitalizeprog Hello! How are you? | cat -e student@ubuntu:~/capitalizeprog$ ./capitalizeprog Hello! How are you? | cat -e
Too many arguments$ Too many arguments$
student@ubuntu:~/capitalizeprog$ ./capitalizeprog student@ubuntu:~/capitalizeprog$ ./capitalizeprog
student@ubuntu:~/capitalizeprog$ student@ubuntu:~/capitalizeprog$
``` ```

18
subjects/changeorder.en.md

@ -1,21 +1,9 @@
## changeorder ## changeorder
## **WARNING! VERY IMPORTANT!**
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:
This means that:
- The package needs to be named `package main`.
- The submitted code needs one declared function main(`func main()`) even if empty.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done.
- Every other rules are obviously the same than for a `program`.
### Instructions ### Instructions
You are given a linked list, where each node contains a single digit. You are given a linked list, where each node contains a single digit.
Change order of linked list so that elements with odd index come first, elements Change order of linked list so that elements with odd index come first, elements with even index come afterwards.
with even index come afterwards.
You have to return pointer/reference to the beginning of new list You have to return pointer/reference to the beginning of new list
### Expected function and structure ### Expected function and structure
@ -40,9 +28,7 @@ Here is a possible program to test your function:
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
// I implemented pushBack for this // I implemented pushBack for this

11
subjects/chunk.en.md

@ -1,16 +1,5 @@
## chunk ## 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 ### 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`. 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`.

5
subjects/cleanstr.en.md

@ -12,7 +12,7 @@ A "word" is defined as a part of a `string` delimited either by spaces/tabs, or
by the start/end of the `string`. by the start/end of the `string`.
If the number of arguments is not 1, or if there are no words to display, the If the number of arguments is not 1, or if there are no words to display, the
program displays a newline ("`\n`"). program displays nothing.
### Usage : ### Usage :
@ -24,7 +24,6 @@ student@ubuntu:~/[[ROOT]]/cleanstr$ ./cleanstr " only it's harder "
only it's harder$ only it's harder$
student@ubuntu:~/[[ROOT]]/cleanstr$ ./cleanstr " how funny" "Did you hear Mathilde ?" student@ubuntu:~/[[ROOT]]/cleanstr$ ./cleanstr " how funny" "Did you hear Mathilde ?"
$ $
student@ubuntu:~/[[ROOT]]/cleanstr$ ./cleanstr "" | cat -e student@ubuntu:~/[[ROOT]]/cleanstr$ ./cleanstr ""
$
student@ubuntu:~/[[ROOT]]/cleanstr$ student@ubuntu:~/[[ROOT]]/cleanstr$
``` ```

20
subjects/compact.en.md

@ -2,12 +2,12 @@
### Instructions ### Instructions
Write a function `Compact` that takes a pointer to a slice of strings as the argument. Write a function `Compact` that takes a pointer to a slice of `string` as the argument.
This function must: This function must:
- Return the number of elements with non-`nil`. - Return the number of elements with non-zero value.
- Compact, i.e., delete the elements with `nil` in the slice. - Compact, i.e., delete the elements with zero-values in the slice.
### Expected functions ### Expected functions
@ -33,18 +33,18 @@ import (
const N = 6 const N = 6
func main() { func main() {
arr := make([]string, N) a := make([]string, N)
arr[0] = "a" a[0] = "a"
arr[2] = "b" a[2] = "b"
arr[4] = "c" a[4] = "c"
for _, v := range arr { for _, v := range a {
fmt.Println(v) fmt.Println(v)
} }
fmt.Println("Size after compacting:", piscine.Compact(&arr)) fmt.Println("Size after compacting:", piscine.Compact(&a))
for _, v := range arr { for _, v := range a {
fmt.Println(v) fmt.Println(v)
} }
} }

3
subjects/concatparams.en.md

@ -3,8 +3,7 @@
### Instructions ### Instructions
Write a function that takes the arguments received in parameters and returns them as a `string`. Write a function that takes the arguments received in parameters and returns them as a `string`.
The `string` is the result of all the arguments concatenated with a newline (`\n`) between.
The arguments must be **separated** by a `\n`.
### Expected function ### Expected function

2
subjects/costumeprofit.en.md

@ -19,6 +19,6 @@ In the output put '\n' at the end.
Input: `./main **a** **b** **c** **d** **e** **f**` Input: `./main **a** **b** **c** **d** **e** **f**`
```console ```console
$> ./main 12 11 13 20 4 6 $ ./main 12 11 13 20 4 6
102 102
``` ```

2
subjects/countif.en.md

@ -2,7 +2,7 @@
### Instructions ### Instructions
Write a function `CountIf` that returns the number of elements of a `string` array for which the `f` function returns `true`. Write a function `CountIf` that returns the number of elements of a `string` slice for which the `f` function returns `true`.
### Expected function ### Expected function

7
subjects/displaya.en.md

@ -2,10 +2,9 @@
### Instructions ### Instructions
Write a program that takes a `string`, and displays the first `a` character it Write a program that takes a `string`, and displays the first `a` character it encounters in it, followed by a newline (`'\n'`).
encounters in it, followed by a newline (`'\n'`). If there are no `a` characters in the If there are no `a` characters in the string, the program just writes `a` followed by a newline (`'\n'`).
string, the program just writes `a` followed by a newline (`'\n'`). If the number of parameters is not If the number of parameters is not 1, the program displays an `a` followed by a newline (`'\n'`).
1, the program displays an `a` followed by a newline (`'\n'`).
### Usage ### Usage

3
subjects/displayalpham.en.md

@ -2,8 +2,7 @@
### Instructions ### Instructions
Write a program that displays the alphabet, with even letters in uppercase, and Write a program that displays the alphabet, with even letters in uppercase, and odd letters in lowercase, followed by a newline (`'\n'`).
odd letters in lowercase, followed by a newline (`'\n'`).
### Usage ### Usage

3
subjects/displayalrevm.en.md

@ -2,8 +2,7 @@
### Instructions ### Instructions
Write a program that displays the alphabet in reverse, with even letters in Write a program that displays the alphabet in reverse, with even letters in uppercase, and odd letters in lowercase, followed by a newline (`'\n'`).
uppercase, and odd letters in lowercase, followed by a newline (`'\n'`).
### Usage ### Usage

4
subjects/displayz.en.md

@ -2,7 +2,9 @@
### Instructions ### Instructions
Write a program that takes a `string`, and displays the first `z` character it encounters in it, followed by a newline (`'\n'`). If there are no `z` characters in the string, the program just writes `z` followed by a newline (`'\n'`). If the number of parameters is not 1, the program displays an `z` followed by a newline (`'\n'`). Write a program that takes a `string`, and displays the first `z` character it encounters in it, followed by a newline (`'\n'`).
If there are no `z` characters in the string, the program just writes `z` followed by a newline (`'\n'`).
If the number of parameters is not 1, the program displays an `z` followed by a newline (`'\n'`).
### Usage ### Usage

17
subjects/doppelgangerprog.en.md

@ -1,16 +1,5 @@
## doppelganger ## 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 ### 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" 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"
@ -20,7 +9,7 @@ You are given 2 strings. Find out if first string contains second string. If it
```go ```go
package main package main
func DoppelGanger(big, little string) int { func DoppelGanger(s, substr string) int {
} }
``` ```
@ -28,9 +17,7 @@ func DoppelGanger(big, little string) int {
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
var result int var result int

9
subjects/expandstr.en.md

@ -2,15 +2,13 @@
### Instructions ### Instructions
Write a program that takes a `string` and displays it with exactly three spaces Write a program that takes a `string` and displays it with exactly three spaces between each word, with no spaces or tabs at either the beginning nor the end.
between each word, with no spaces or tabs at either the beginning nor the end.
The `string` will be followed by a newline (`'\n'`). The `string` will be followed by a newline (`'\n'`).
A word is a sequence of alphanumerical characters. A word is a sequence of alphanumerical characters.
If the number of parameters is not 1, or if there are no word, the program displays If the number of parameters is not 1, or if there are no word, the program displays nothing.
a newline.
### Usage ### Usage
@ -22,7 +20,6 @@ student@ubuntu:~/[[ROOT]]/expandstr$ ./expandstr " only it's harder " | cat
only it's harder$ only it's harder$
student@ubuntu:~/[[ROOT]]/expandstr$ ./expandstr " how funny it is" "did you hear, Mathilde ?" | cat -e student@ubuntu:~/[[ROOT]]/expandstr$ ./expandstr " how funny it is" "did you hear, Mathilde ?" | cat -e
$ $
student@ubuntu:~/[[ROOT]]/expandstr$ ./expandstr | cat -e student@ubuntu:~/[[ROOT]]/expandstr$ ./expandstr
$
student@ubuntu:~/[[ROOT]]/expandstr$ student@ubuntu:~/[[ROOT]]/expandstr$
``` ```

15
subjects/fib.en.md

@ -1,16 +1,5 @@
## fib ## 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 ### 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). 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).
@ -37,9 +26,7 @@ Here is a possible program to test your function :
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
fmt.Println(Fib(0)) fmt.Println(Fib(0))

15
subjects/findprevprimeprog.en.md

@ -1,16 +1,5 @@
## findprevprime ## 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 ### Instructions
Write a function that returns the first prime number that is equal or inferior to the `int` passed as parameter. Write a function that returns the first prime number that is equal or inferior to the `int` passed as parameter.
@ -32,9 +21,7 @@ Here is a possible [program](TODO-LINK) to test your function :
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
fmt.Println(FindPrevPrime(5)) fmt.Println(FindPrevPrime(5))

11
subjects/firstruneprog.en.md

@ -1,16 +1,5 @@
## firstruneprog ## firstruneprog
> ### **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 ### Instructions
Write a function that returns the first `rune` of a `string`. Write a function that returns the first `rune` of a `string`.

4
subjects/firstword.en.md

@ -8,7 +8,7 @@ Write a program that takes a `string` and displays its first word, followed by a
- 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 nothing.
### Usage ### Usage
@ -19,8 +19,6 @@ hello
student@ubuntu:~/[[ROOT]]/test$ ./test "hello ......... bye" student@ubuntu:~/[[ROOT]]/test$ ./test "hello ......... bye"
hello hello
student@ubuntu:~/[[ROOT]]/test$ ./test student@ubuntu:~/[[ROOT]]/test$ ./test
student@ubuntu:~/[[ROOT]]/test$ ./test "hello" "there" student@ubuntu:~/[[ROOT]]/test$ ./test "hello" "there"
student@ubuntu:~/[[ROOT]]/test$ student@ubuntu:~/[[ROOT]]/test$
``` ```

5
subjects/fixthemain.en.md

@ -10,9 +10,8 @@ Fix the following program.
package piscine package piscine
func PrintStr(str string) { func PrintStr(str string) {
arrayRune := []rune(str) for _, r := range str {
for _, s := range arrayRune { z01.PrintRune(r)
z01.PrintRune(s)
} }
} }

13
subjects/foldint.en.md

@ -1,16 +1,5 @@
## foldint ## 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 ### Instructions
Write a function called `FoldInt` that simulates the behavior of reduce from JavaScript. Write a function called `FoldInt` that simulates the behavior of reduce from JavaScript.
@ -20,7 +9,7 @@ The function should have as parameters a function, `f func(int, int) int` a slic
### Expected function ### Expected function
```go ```go
func FoldInt(f func(int, int) int, arr []int, n int) { func FoldInt(f func(int, int) int, a []int, n int) {
} }
``` ```

8
subjects/foreach.en.md

@ -2,12 +2,12 @@
### Instructions ### Instructions
Write a function `ForEach` that, for an `int` array, applies a function on each elements of that array. Write a function `ForEach` that, for an `int` slice, applies a function on each elements of that slice.
### Expected function ### Expected function
```go ```go
func ForEach(f func(int), arr []int) { func ForEach(f func(int), a []int) {
} }
``` ```
@ -22,8 +22,8 @@ package main
import piscine ".." import piscine ".."
func main() { func main() {
arr := []int{1, 2, 3, 4, 5, 6} a := []int{1, 2, 3, 4, 5, 6}
piscine.ForEach(piscine.PrintNbr, arr) piscine.ForEach(piscine.PrintNbr, a)
} }
``` ```

19
subjects/foreachprog.en.md

@ -1,24 +1,13 @@
## foreachprog ## foreachprog
##**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 ### Instructions
Write a function `ForEach` that, for an `int` array, applies a function on each elements of that array. Write a function `ForEach` that, for an `int` slice, applies a function on each elements of that slice.
### Expected function ### Expected function
```go ```go
func ForEach(f func(int), arr []int) { func ForEach(f func(int), a []int) {
} }
``` ```
@ -31,8 +20,8 @@ Here is a possible program to test your function :
package main package main
func main() { func main() {
arr := []int{1, 2, 3, 4, 5, 6} a := []int{1, 2, 3, 4, 5, 6}
ForEach(PrintNbr, arr) ForEach(PrintNbr, a)
} }
func PrintNbr(int) { func PrintNbr(int) {

7
subjects/fprime.en.md

@ -6,9 +6,7 @@ Write a program that takes a positive `int` and displays its prime factors, foll
- 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 arguments is different from 1, if the argument is invalid or if the integer doesn't have a prime factor, the program displays nothing.
- The input, when there is one, will always be valid.
### Usage ### Usage
@ -25,10 +23,7 @@ student@ubuntu:~/[[ROOT]]/test$ ./test 804577
student@ubuntu:~/[[ROOT]]/test$ ./test 42 student@ubuntu:~/[[ROOT]]/test$ ./test 42
2*3*7 2*3*7
student@ubuntu:~/[[ROOT]]/test$ ./test a student@ubuntu:~/[[ROOT]]/test$ ./test a
student@ubuntu:~/[[ROOT]]/test$ ./test 0 student@ubuntu:~/[[ROOT]]/test$ ./test 0
student@ubuntu:~/[[ROOT]]/test$ ./test 1 student@ubuntu:~/[[ROOT]]/test$ ./test 1
student@ubuntu:~/[[ROOT]]/test$ student@ubuntu:~/[[ROOT]]/test$
``` ```

15
subjects/game23.en.md

@ -1,16 +1,5 @@
## game23 ## 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 ### 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). 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).
@ -35,9 +24,7 @@ Here is a possible program to test your function :
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
fmt.Println(Game23(1, 3)) fmt.Println(Game23(1, 3))

20
subjects/gcd.en.md

@ -6,7 +6,7 @@ Write a program that takes two `string` representing two strictly positive integ
The program displays their greatest common divisor followed by a newline (`'\n'`). The program displays their greatest common divisor followed by a newline (`'\n'`).
If the number of parameters is different from 2, the program displays a newline. If the number of parameters is different from 2, the program displays nothing.
All arguments tested will be positive `int` values. All arguments tested will be positive `int` values.
@ -16,15 +16,13 @@ All arguments tested will be positive `int` values.
student@ubuntu:~/[[ROOT]]/gcd$ go build student@ubuntu:~/[[ROOT]]/gcd$ go build
student@ubuntu:~/[[ROOT]]/gcd$ ./gcd 42 10 | cat -e student@ubuntu:~/[[ROOT]]/gcd$ ./gcd 42 10 | cat -e
2$ 2$
student@ubuntu:~/[[ROOT]]/gcd$ ./gcd 42 12 | cat -e student@ubuntu:~/[[ROOT]]/gcd$ ./gcd 42 12
6$ 6
student@ubuntu:~/[[ROOT]]/gcd$ ./gcd 14 77 | cat -e student@ubuntu:~/[[ROOT]]/gcd$ ./gcd 14 77
7$ 7
student@ubuntu:~/[[ROOT]]/gcd$ ./gcd 17 3 | cat -e student@ubuntu:~/[[ROOT]]/gcd$ ./gcd 17 3
1$ 1
student@ubuntu:~/[[ROOT]]/gcd$ ./gcd | cat -e student@ubuntu:~/[[ROOT]]/gcd$ ./gcd
$ student@ubuntu:~/[[ROOT]]/gcd$ ./gcd 50 12 4
student@ubuntu:~/[[ROOT]]/gcd$ ./gcd 50 12 4 | cat -e
$
student@ubuntu:~/[[ROOT]]/gcd$ student@ubuntu:~/[[ROOT]]/gcd$
``` ```

377
subjects/go-reloaded/go-reloaded.audit.en.md

@ -1,433 +1,767 @@
#### Atoi #### Atoi
##### Try with the argument: `""` ##### Try with the argument: `""`
`0` `0`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `"-"` ##### Try with the argument: `"-"`
`0` `0`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `"--123"` ##### Try with the argument: `"--123"`
`0` `0`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `"1"` ##### Try with the argument: `"1"`
`1` `1`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `"-3"` ##### Try with the argument: `"-3"`
`-3` `-3`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `"8292"` ##### Try with the argument: `"8292"`
`8292` `8292`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `"9223372036854775807"` ##### Try with the argument: `"9223372036854775807"`
`9223372036854775807` `9223372036854775807`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `"-9223372036854775808"` ##### Try with the argument: `"-9223372036854775808"`
`-9223372036854775808` `-9223372036854775808`
###### Does the function returns the value above? ###### Does the function returns the value above?
#### RecursivePower #### RecursivePower
##### Try with the arguments: `nb = -7 and power = -2` ##### Try with the arguments: `nb = -7 and power = -2`
`0` `0`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `nb = -8 and power = -7` ##### Try with the arguments: `nb = -8 and power = -7`
`0` `0`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `nb = 4 and power = 8` ##### Try with the arguments: `nb = 4 and power = 8`
`65536` `65536`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `nb = 1 and power = 3` ##### Try with the arguments: `nb = 1 and power = 3`
`1` `1`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `nb = -1 and power = 1` ##### Try with the arguments: `nb = -1 and power = 1`
`-1` `-1`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `nb = -6 and power = 5` ##### Try with the arguments: `nb = -6 and power = 5`
`-7776` `-7776`
###### Does the function returns the value above? ###### Does the function returns the value above?
#### PrintCombN #### PrintCombN
##### Try with the argument: `n = 1` ##### Try with the argument: `n = 1`
`0, 1, 2, 3, 4, 5, 6, 7, 8, 9` `0, 1, 2, 3, 4, 5, 6, 7, 8, 9`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `n = 2` ##### Try with the argument: `n = 2`
`01, 02, 03, 04, 05, 06, 07, 08, 09, 12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89` `01, 02, 03, 04, 05, 06, 07, 08, 09, 12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `n = 3` ##### Try with the argument: `n = 3`
`012, 013, 014, 015, 016, 017, 018, 019, 023, 024, 025, 026, 027, 028, 029, 034, 035, 036, 037, 038, 039, 045, 046, 047, 048, 049, 056, 057, 058, 059, 067, 068, 069, 078, 079, 089, 123, 124, 125, 126, 127, 128, 129, 134, 135, 136, 137, 138, 139, 145, 146, 147, 148, 149, 156, 157, 158, 159, 167, 168, 169, 178, 179, 189, 234, 235, 236, 237, 238, 239, 245, 246, 247, 248, 249, 256, 257, 258, 259, 267, 268, 269, 278, 279, 289, 345, 346, 347, 348, 349, 356, 357, 358, 359, 367, 368, 369, 378, 379, 389, 456, 457, 458, 459, 467, 468, 469, 478, 479, 489, 567, 568, 569, 578, 579, 589, 678, 679, 689, 789` `012, 013, 014, 015, 016, 017, 018, 019, 023, 024, 025, 026, 027, 028, 029, 034, 035, 036, 037, 038, 039, 045, 046, 047, 048, 049, 056, 057, 058, 059, 067, 068, 069, 078, 079, 089, 123, 124, 125, 126, 127, 128, 129, 134, 135, 136, 137, 138, 139, 145, 146, 147, 148, 149, 156, 157, 158, 159, 167, 168, 169, 178, 179, 189, 234, 235, 236, 237, 238, 239, 245, 246, 247, 248, 249, 256, 257, 258, 259, 267, 268, 269, 278, 279, 289, 345, 346, 347, 348, 349, 356, 357, 358, 359, 367, 368, 369, 378, 379, 389, 456, 457, 458, 459, 467, 468, 469, 478, 479, 489, 567, 568, 569, 578, 579, 589, 678, 679, 689, 789`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `n = 4` ##### Try with the argument: `n = 4`
`0123, 0124, 0125, 0126, 0127, 0128, 0129, 0134, 0135, 0136, 0137, 0138, 0139, 0145, 0146, 0147, 0148, 0149, 0156, 0157, 0158, 0159, 0167, 0168, 0169, 0178, 0179, 0189, 0234, 0235, 0236, 0237, 0238, 0239, 0245, 0246, 0247, 0248, 0249, 0256, 0257, 0258, 0259, 0267, 0268, 0269, 0278, 0279, 0289, 0345, 0346, 0347, 0348, 0349, 0356, 0357, 0358, 0359, 0367, 0368, 0369, 0378, 0379, 0389, 0456, 0457, 0458, 0459, 0467, 0468, 0469, 0478, 0479, 0489, 0567, 0568, 0569, 0578, 0579, 0589, 0678, 0679, 0689, 0789, 1234, 1235, 1236, 1237, 1238, 1239, 1245, 1246, 1247, 1248, 1249, 1256, 1257, 1258, 1259, 1267, 1268, 1269, 1278, 1279, 1289, 1345, 1346, 1347, 1348, 1349, 1356, 1357, 1358, 1359, 1367, 1368, 1369, 1378, 1379, 1389, 1456, 1457, 1458, 1459, 1467, 1468, 1469, 1478, 1479, 1489, 1567, 1568, 1569, 1578, 1579, 1589, 1678, 1679, 1689, 1789, 2345, 2346, 2347, 2348, 2349, 2356, 2357, 2358, 2359, 2367, 2368, 2369, 2378, 2379, 2389, 2456, 2457, 2458, 2459, 2467, 2468, 2469, 2478, 2479, 2489, 2567, 2568, 2569, 2578, 2579, 2589, 2678, 2679, 2689, 2789, 3456, 3457, 3458, 3459, 3467, 3468, 3469, 3478, 3479, 3489, 3567, 3568, 3569, 3578, 3579, 3589, 3678, 3679, 3689, 3789, 4567, 4568, 4569, 4578, 4579, 4589, 4678, 4679, 4689, 4789, 5678, 5679, 5689, 5789, 6789` `0123, 0124, 0125, 0126, 0127, 0128, 0129, 0134, 0135, 0136, 0137, 0138, 0139, 0145, 0146, 0147, 0148, 0149, 0156, 0157, 0158, 0159, 0167, 0168, 0169, 0178, 0179, 0189, 0234, 0235, 0236, 0237, 0238, 0239, 0245, 0246, 0247, 0248, 0249, 0256, 0257, 0258, 0259, 0267, 0268, 0269, 0278, 0279, 0289, 0345, 0346, 0347, 0348, 0349, 0356, 0357, 0358, 0359, 0367, 0368, 0369, 0378, 0379, 0389, 0456, 0457, 0458, 0459, 0467, 0468, 0469, 0478, 0479, 0489, 0567, 0568, 0569, 0578, 0579, 0589, 0678, 0679, 0689, 0789, 1234, 1235, 1236, 1237, 1238, 1239, 1245, 1246, 1247, 1248, 1249, 1256, 1257, 1258, 1259, 1267, 1268, 1269, 1278, 1279, 1289, 1345, 1346, 1347, 1348, 1349, 1356, 1357, 1358, 1359, 1367, 1368, 1369, 1378, 1379, 1389, 1456, 1457, 1458, 1459, 1467, 1468, 1469, 1478, 1479, 1489, 1567, 1568, 1569, 1578, 1579, 1589, 1678, 1679, 1689, 1789, 2345, 2346, 2347, 2348, 2349, 2356, 2357, 2358, 2359, 2367, 2368, 2369, 2378, 2379, 2389, 2456, 2457, 2458, 2459, 2467, 2468, 2469, 2478, 2479, 2489, 2567, 2568, 2569, 2578, 2579, 2589, 2678, 2679, 2689, 2789, 3456, 3457, 3458, 3459, 3467, 3468, 3469, 3478, 3479, 3489, 3567, 3568, 3569, 3578, 3579, 3589, 3678, 3679, 3689, 3789, 4567, 4568, 4569, 4578, 4579, 4589, 4678, 4679, 4689, 4789, 5678, 5679, 5689, 5789, 6789`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `n = 5` ##### Try with the argument: `n = 5`
`01234, 01235, 01236, 01237, 01238, 01239, 01245, 01246, 01247, 01248, 01249, 01256, 01257, 01258, 01259, 01267, 01268, 01269, 01278, 01279, 01289, 01345, 01346, 01347, 01348, 01349, 01356, 01357, 01358, 01359, 01367, 01368, 01369, 01378, 01379, 01389, 01456, 01457, 01458, 01459, 01467, 01468, 01469, 01478, 01479, 01489, 01567, 01568, 01569, 01578, 01579, 01589, 01678, 01679, 01689, 01789, 02345, 02346, 02347, 02348, 02349, 02356, 02357, 02358, 02359, 02367, 02368, 02369, 02378, 02379, 02389, 02456, 02457, 02458, 02459, 02467, 02468, 02469, 02478, 02479, 02489, 02567, 02568, 02569, 02578, 02579, 02589, 02678, 02679, 02689, 02789, 03456, 03457, 03458, 03459, 03467, 03468, 03469, 03478, 03479, 03489, 03567, 03568, 03569, 03578, 03579, 03589, 03678, 03679, 03689, 03789, 04567, 04568, 04569, 04578, 04579, 04589, 04678, 04679, 04689, 04789, 05678, 05679, 05689, 05789, 06789, 12345, 12346, 12347, 12348, 12349, 12356, 12357, 12358, 12359, 12367, 12368, 12369, 12378, 12379, 12389, 12456, 12457, 12458, 12459, 12467, 12468, 12469, 12478, 12479, 12489, 12567, 12568, 12569, 12578, 12579, 12589, 12678, 12679, 12689, 12789, 13456, 13457, 13458, 13459, 13467, 13468, 13469, 13478, 13479, 13489, 13567, 13568, 13569, 13578, 13579, 13589, 13678, 13679, 13689, 13789, 14567, 14568, 14569, 14578, 14579, 14589, 14678, 14679, 14689, 14789, 15678, 15679, 15689, 15789, 16789, 23456, 23457, 23458, 23459, 23467, 23468, 23469, 23478, 23479, 23489, 23567, 23568, 23569, 23578, 23579, 23589, 23678, 23679, 23689, 23789, 24567, 24568, 24569, 24578, 24579, 24589, 24678, 24679, 24689, 24789, 25678, 25679, 25689, 25789, 26789, 34567, 34568, 34569, 34578, 34579, 34589, 34678, 34679, 34689, 34789, 35678, 35679, 35689, 35789, 36789, 45678, 45679, 45689, 45789, 46789, 56789` `01234, 01235, 01236, 01237, 01238, 01239, 01245, 01246, 01247, 01248, 01249, 01256, 01257, 01258, 01259, 01267, 01268, 01269, 01278, 01279, 01289, 01345, 01346, 01347, 01348, 01349, 01356, 01357, 01358, 01359, 01367, 01368, 01369, 01378, 01379, 01389, 01456, 01457, 01458, 01459, 01467, 01468, 01469, 01478, 01479, 01489, 01567, 01568, 01569, 01578, 01579, 01589, 01678, 01679, 01689, 01789, 02345, 02346, 02347, 02348, 02349, 02356, 02357, 02358, 02359, 02367, 02368, 02369, 02378, 02379, 02389, 02456, 02457, 02458, 02459, 02467, 02468, 02469, 02478, 02479, 02489, 02567, 02568, 02569, 02578, 02579, 02589, 02678, 02679, 02689, 02789, 03456, 03457, 03458, 03459, 03467, 03468, 03469, 03478, 03479, 03489, 03567, 03568, 03569, 03578, 03579, 03589, 03678, 03679, 03689, 03789, 04567, 04568, 04569, 04578, 04579, 04589, 04678, 04679, 04689, 04789, 05678, 05679, 05689, 05789, 06789, 12345, 12346, 12347, 12348, 12349, 12356, 12357, 12358, 12359, 12367, 12368, 12369, 12378, 12379, 12389, 12456, 12457, 12458, 12459, 12467, 12468, 12469, 12478, 12479, 12489, 12567, 12568, 12569, 12578, 12579, 12589, 12678, 12679, 12689, 12789, 13456, 13457, 13458, 13459, 13467, 13468, 13469, 13478, 13479, 13489, 13567, 13568, 13569, 13578, 13579, 13589, 13678, 13679, 13689, 13789, 14567, 14568, 14569, 14578, 14579, 14589, 14678, 14679, 14689, 14789, 15678, 15679, 15689, 15789, 16789, 23456, 23457, 23458, 23459, 23467, 23468, 23469, 23478, 23479, 23489, 23567, 23568, 23569, 23578, 23579, 23589, 23678, 23679, 23689, 23789, 24567, 24568, 24569, 24578, 24579, 24589, 24678, 24679, 24689, 24789, 25678, 25679, 25689, 25789, 26789, 34567, 34568, 34569, 34578, 34579, 34589, 34678, 34679, 34689, 34789, 35678, 35679, 35689, 35789, 36789, 45678, 45679, 45689, 45789, 46789, 56789`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `n = 6` ##### Try with the argument: `n = 6`
`012345, 012346, 012347, 012348, 012349, 012356, 012357, 012358, 012359, 012367, 012368, 012369, 012378, 012379, 012389, 012456, 012457, 012458, 012459, 012467, 012468, 012469, 012478, 012479, 012489, 012567, 012568, 012569, 012578, 012579, 012589, 012678, 012679, 012689, 012789, 013456, 013457, 013458, 013459, 013467, 013468, 013469, 013478, 013479, 013489, 013567, 013568, 013569, 013578, 013579, 013589, 013678, 013679, 013689, 013789, 014567, 014568, 014569, 014578, 014579, 014589, 014678, 014679, 014689, 014789, 015678, 015679, 015689, 015789, 016789, 023456, 023457, 023458, 023459, 023467, 023468, 023469, 023478, 023479, 023489, 023567, 023568, 023569, 023578, 023579, 023589, 023678, 023679, 023689, 023789, 024567, 024568, 024569, 024578, 024579, 024589, 024678, 024679, 024689, 024789, 025678, 025679, 025689, 025789, 026789, 034567, 034568, 034569, 034578, 034579, 034589, 034678, 034679, 034689, 034789, 035678, 035679, 035689, 035789, 036789, 045678, 045679, 045689, 045789, 046789, 056789, 123456, 123457, 123458, 123459, 123467, 123468, 123469, 123478, 123479, 123489, 123567, 123568, 123569, 123578, 123579, 123589, 123678, 123679, 123689, 123789, 124567, 124568, 124569, 124578, 124579, 124589, 124678, 124679, 124689, 124789, 125678, 125679, 125689, 125789, 126789, 134567, 134568, 134569, 134578, 134579, 134589, 134678, 134679, 134689, 134789, 135678, 135679, 135689, 135789, 136789, 145678, 145679, 145689, 145789, 146789, 156789, 234567, 234568, 234569, 234578, 234579, 234589, 234678, 234679, 234689, 234789, 235678, 235679, 235689, 235789, 236789, 245678, 245679, 245689, 245789, 246789, 256789, 345678, 345679, 345689, 345789, 346789, 356789, 456789` `012345, 012346, 012347, 012348, 012349, 012356, 012357, 012358, 012359, 012367, 012368, 012369, 012378, 012379, 012389, 012456, 012457, 012458, 012459, 012467, 012468, 012469, 012478, 012479, 012489, 012567, 012568, 012569, 012578, 012579, 012589, 012678, 012679, 012689, 012789, 013456, 013457, 013458, 013459, 013467, 013468, 013469, 013478, 013479, 013489, 013567, 013568, 013569, 013578, 013579, 013589, 013678, 013679, 013689, 013789, 014567, 014568, 014569, 014578, 014579, 014589, 014678, 014679, 014689, 014789, 015678, 015679, 015689, 015789, 016789, 023456, 023457, 023458, 023459, 023467, 023468, 023469, 023478, 023479, 023489, 023567, 023568, 023569, 023578, 023579, 023589, 023678, 023679, 023689, 023789, 024567, 024568, 024569, 024578, 024579, 024589, 024678, 024679, 024689, 024789, 025678, 025679, 025689, 025789, 026789, 034567, 034568, 034569, 034578, 034579, 034589, 034678, 034679, 034689, 034789, 035678, 035679, 035689, 035789, 036789, 045678, 045679, 045689, 045789, 046789, 056789, 123456, 123457, 123458, 123459, 123467, 123468, 123469, 123478, 123479, 123489, 123567, 123568, 123569, 123578, 123579, 123589, 123678, 123679, 123689, 123789, 124567, 124568, 124569, 124578, 124579, 124589, 124678, 124679, 124689, 124789, 125678, 125679, 125689, 125789, 126789, 134567, 134568, 134569, 134578, 134579, 134589, 134678, 134679, 134689, 134789, 135678, 135679, 135689, 135789, 136789, 145678, 145679, 145689, 145789, 146789, 156789, 234567, 234568, 234569, 234578, 234579, 234589, 234678, 234679, 234689, 234789, 235678, 235679, 235689, 235789, 236789, 245678, 245679, 245689, 245789, 246789, 256789, 345678, 345679, 345689, 345789, 346789, 356789, 456789`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `n = 7` ##### Try with the argument: `n = 7`
`0123456, 0123457, 0123458, 0123459, 0123467, 0123468, 0123469, 0123478, 0123479, 0123489, 0123567, 0123568, 0123569, 0123578, 0123579, 0123589, 0123678, 0123679, 0123689, 0123789, 0124567, 0124568, 0124569, 0124578, 0124579, 0124589, 0124678, 0124679, 0124689, 0124789, 0125678, 0125679, 0125689, 0125789, 0126789, 0134567, 0134568, 0134569, 0134578, 0134579, 0134589, 0134678, 0134679, 0134689, 0134789, 0135678, 0135679, 0135689, 0135789, 0136789, 0145678, 0145679, 0145689, 0145789, 0146789, 0156789, 0234567, 0234568, 0234569, 0234578, 0234579, 0234589, 0234678, 0234679, 0234689, 0234789, 0235678, 0235679, 0235689, 0235789, 0236789, 0245678, 0245679, 0245689, 0245789, 0246789, 0256789, 0345678, 0345679, 0345689, 0345789, 0346789, 0356789, 0456789, 1234567, 1234568, 1234569, 1234578, 1234579, 1234589, 1234678, 1234679, 1234689, 1234789, 1235678, 1235679, 1235689, 1235789, 1236789, 1245678, 1245679, 1245689, 1245789, 1246789, 1256789, 1345678, 1345679, 1345689, 1345789, 1346789, 1356789, 1456789, 2345678, 2345679, 2345689, 2345789, 2346789, 2356789, 2456789, 3456789` `0123456, 0123457, 0123458, 0123459, 0123467, 0123468, 0123469, 0123478, 0123479, 0123489, 0123567, 0123568, 0123569, 0123578, 0123579, 0123589, 0123678, 0123679, 0123689, 0123789, 0124567, 0124568, 0124569, 0124578, 0124579, 0124589, 0124678, 0124679, 0124689, 0124789, 0125678, 0125679, 0125689, 0125789, 0126789, 0134567, 0134568, 0134569, 0134578, 0134579, 0134589, 0134678, 0134679, 0134689, 0134789, 0135678, 0135679, 0135689, 0135789, 0136789, 0145678, 0145679, 0145689, 0145789, 0146789, 0156789, 0234567, 0234568, 0234569, 0234578, 0234579, 0234589, 0234678, 0234679, 0234689, 0234789, 0235678, 0235679, 0235689, 0235789, 0236789, 0245678, 0245679, 0245689, 0245789, 0246789, 0256789, 0345678, 0345679, 0345689, 0345789, 0346789, 0356789, 0456789, 1234567, 1234568, 1234569, 1234578, 1234579, 1234589, 1234678, 1234679, 1234689, 1234789, 1235678, 1235679, 1235689, 1235789, 1236789, 1245678, 1245679, 1245689, 1245789, 1246789, 1256789, 1345678, 1345679, 1345689, 1345789, 1346789, 1356789, 1456789, 2345678, 2345679, 2345689, 2345789, 2346789, 2356789, 2456789, 3456789`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `n = 8` ##### Try with the argument: `n = 8`
`01234567, 01234568, 01234569, 01234578, 01234579, 01234589, 01234678, 01234679, 01234689, 01234789, 01235678, 01235679, 01235689, 01235789, 01236789, 01245678, 01245679, 01245689, 01245789, 01246789, 01256789, 01345678, 01345679, 01345689, 01345789, 01346789, 01356789, 01456789, 02345678, 02345679, 02345689, 02345789, 02346789, 02356789, 02456789, 03456789, 12345678, 12345679, 12345689, 12345789, 12346789, 12356789, 12456789, 13456789, 23456789` `01234567, 01234568, 01234569, 01234578, 01234579, 01234589, 01234678, 01234679, 01234689, 01234789, 01235678, 01235679, 01235689, 01235789, 01236789, 01245678, 01245679, 01245689, 01245789, 01246789, 01256789, 01345678, 01345679, 01345689, 01345789, 01346789, 01356789, 01456789, 02345678, 02345679, 02345689, 02345789, 02346789, 02356789, 02456789, 03456789, 12345678, 12345679, 12345689, 12345789, 12346789, 12356789, 12456789, 13456789, 23456789`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `n = 9` ##### Try with the argument: `n = 9`
`012345678, 012345679, 012345689, 012345789, 012346789, 012356789, 012456789, 013456789, 023456789, 123456789` `012345678, 012345679, 012345689, 012345789, 012346789, 012356789, 012456789, 013456789, 023456789, 123456789`
###### Does the function prints the value above? ###### Does the function prints the value above?
#### PrintNbrBase #### PrintNbrBase
##### Try with the argument: `nbr = 919617 and base = 01` ##### Try with the argument: `nbr = 919617 and base = 01`
`11100000100001000001` `11100000100001000001`
###### Does the function prints the value? ###### Does the function prints the value?
##### Try with the argument: `nbr = 753639 and base = CHOUMIisDAcat!` ##### Try with the argument: `nbr = 753639 and base = CHOUMIisDAcat!`
`HIDAHI` `HIDAHI`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `nbr = -174336 and base = CHOUMIisDAcat!` ##### Try with the argument: `nbr = -174336 and base = CHOUMIisDAcat!`
`-MssiD` `-MssiD`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `nbr = -661165 and base = 1` ##### Try with the argument: `nbr = -661165 and base = 1`
`NV` `NV`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `nbr = -861737 and base = Zone01Zone01` ##### Try with the argument: `nbr = -861737 and base = Zone01Zone01`
`NV` `NV`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `nbr = 125 and base = 0123456789ABCDEF` ##### Try with the argument: `nbr = 125 and base = 0123456789ABCDEF`
`7D` `7D`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `nbr = -125 and base = choumi` ##### Try with the argument: `nbr = -125 and base = choumi`
`-uoi` `-uoi`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `nbr = 125 and base = -ab` ##### Try with the argument: `nbr = 125 and base = -ab`
`NV` `NV`
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the argument: `nbr = -9223372036854775808 and base = 0123456789` ##### Try with the argument: `nbr = -9223372036854775808 and base = 0123456789`
`-9223372036854775808` `-9223372036854775808`
###### Does the function prints the value above? ###### Does the function prints the value above?
#### doop #### doop
##### Try with the arguments: `861 + 870` ##### Try with the arguments: `861 + 870`
`1731` `1731`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `861 - 870` ##### Try with the arguments: `861 - 870`
`-9` `-9`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `861 * 870` ##### Try with the arguments: `861 * 870`
`749070` `749070`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `861 % 870` ##### Try with the arguments: `861 % 870`
`861` `861`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `hello + 1` ##### Try with the arguments: `hello + 1`
`0` `0`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `1 p 1` ##### Try with the arguments: `1 p 1`
`0` `0`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `1 / 0` ##### Try with the arguments: `1 / 0`
`No division by 0` `No division by 0`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `1 % 0` ##### Try with the arguments: `1 % 0`
`No remainder of division by 0` `No remainder of division by 0`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `1 * 1` ##### Try with the arguments: `1 * 1`
`1` `1`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `9223372036854775807 + 1` ##### Try with the arguments: `9223372036854775807 + 1`
`0` `0`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `9223372036854775809 - 3` ##### Try with the arguments: `9223372036854775809 - 3`
`0` `0`
###### Does the program prints the value above? ###### Does the program prints the value above?
##### Try with the arguments: `9223372036854775807 * 3` ##### Try with the arguments: `9223372036854775807 * 3`
`0` `0`
###### Does the program prints the value above? ###### Does the program prints the value above?
#### Atoibase #### Atoibase
##### Try with the arguments: `s = bcbbbbaab and base = abc` ##### Try with the arguments: `s = bcbbbbaab and base = abc`
`12016` `12016`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `s = 0001 and base = 01` ##### Try with the arguments: `s = 0001 and base = 01`
`1` `1`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `s = 00 and base = 01` ##### Try with the arguments: `s = 00 and base = 01`
`0` `0`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `s = saDt!I!sI and base = CHOUMIisDAcat!` ##### Try with the arguments: `s = saDt!I!sI and base = CHOUMIisDAcat!`
`11557277891` `11557277891`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `s = AAho?Ao and base = WhoAmI?` ##### Try with the arguments: `s = AAho?Ao and base = WhoAmI?`
`406772` `406772`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `s = thisinputshouldnotmatter and base = abca` ##### Try with the arguments: `s = thisinputshouldnotmatter and base = abca`
`0` `0`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `s = 125 and base = 0123456789` ##### Try with the arguments: `s = 125 and base = 0123456789`
`125` `125`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `s = uoi and base = choumi` ##### Try with the arguments: `s = uoi and base = choumi`
`125` `125`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `s = bbbbbab and base = -ab` ##### Try with the arguments: `s = bbbbbab and base = -ab`
`0` `0`
###### Does the function returns the value above? ###### Does the function returns the value above?
#### splitwhitespaces #### splitwhitespaces
##### Try with the argument: `str = "The earliest foundations of what would become computer science predate the invention of the modern digital computer"` ##### Try with the argument: `str = "The earliest foundations of what would become computer science predate the invention of the modern digital computer"`
`[The earliest foundations of what would become computer science predate the invention of the modern digital computer]` `[The earliest foundations of what would become computer science predate the invention of the modern digital computer]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `str = Machines for calculating fixed numerical tasks such as the abacus have existed since antiquity,` ##### Try with the argument: `str = Machines for calculating fixed numerical tasks such as the abacus have existed since antiquity,`
`[Machines for calculating fixed numerical tasks such as the abacus have existed since antiquity,]` `[Machines for calculating fixed numerical tasks such as the abacus have existed since antiquity,]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `str = aiding in computations such as multiplication and division .` ##### Try with the argument: `str = aiding in computations such as multiplication and division .`
`[aiding in computations such as multiplication and division .]` `[aiding in computations such as multiplication and division .]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `str = Algorithms for performing computations have existed since antiquity, even before the development of sophisticated computing equipment.` ##### Try with the argument: `str = Algorithms for performing computations have existed since antiquity, even before the development of sophisticated computing equipment.`
`[Algorithms for performing computations have existed since antiquity, even before the development of sophisticated computing equipment.]` `[Algorithms for performing computations have existed since antiquity, even before the development of sophisticated computing equipment.]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `str = Wilhelm Schickard designed and constructed the first working mechanical calculator in 1623.[4]` ##### Try with the argument: `str = Wilhelm Schickard designed and constructed the first working mechanical calculator in 1623.[4]`
`[Wilhelm Schickard designed and constructed the first working mechanical calculator in 1623.[4]]` `[Wilhelm Schickard designed and constructed the first working mechanical calculator in 1623.[4]]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `str = In 1673, Gottfried Leibniz demonstrated a digital mechanical calculator,` ##### Try with the argument: `str = In 1673, Gottfried Leibniz demonstrated a digital mechanical calculator,`
`[In 1673, Gottfried Leibniz demonstrated a digital mechanical calculator,]` `[In 1673, Gottfried Leibniz demonstrated a digital mechanical calculator,]`
###### Does the function returns the value above? ###### Does the function returns the value above?
#### split #### split
##### Try with the arguments: ##### Try with the arguments:
``` ```
str = |=choumi=|which|=choumi=|itself|=choumi=|used|=choumi=|cards|=choumi=|and|=choumi=|a|=choumi=|central|=choumi=|computing|=choumi=|unit.|=choumi=|When|=choumi=|the|=choumi=|machine|=choumi=|was|=choumi=|finished, and charset = |=choumi=| str = |=choumi=|which|=choumi=|itself|=choumi=|used|=choumi=|cards|=choumi=|and|=choumi=|a|=choumi=|central|=choumi=|computing|=choumi=|unit.|=choumi=|When|=choumi=|the|=choumi=|machine|=choumi=|was|=choumi=|finished, and charset = |=choumi=|
``` ```
`[ which itself used cards and a central computing unit. When the machine was finished,]` `[ which itself used cards and a central computing unit. When the machine was finished,]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: ##### Try with the arguments:
``` ```
str = !==!which!==!was!==!making!==!all!==!kinds!==!of!==!punched!==!card!==!equipment!==!and!==!was!==!also!==!in!==!the!==!calculator!==!business[10]!==!to!==!develop!==!his!==!giant!==!programmable!==!calculator, and charset = !==! str = !==!which!==!was!==!making!==!all!==!kinds!==!of!==!punched!==!card!==!equipment!==!and!==!was!==!also!==!in!==!the!==!calculator!==!business[10]!==!to!==!develop!==!his!==!giant!==!programmable!==!calculator, and charset = !==!
``` ```
`[ which was making all kinds of punched card equipment and was also in the calculator business[10] to develop his giant programmable calculator,]` `[ which was making all kinds of punched card equipment and was also in the calculator business[10] to develop his giant programmable calculator,]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: ##### Try with the arguments:
``` ```
str = AFJCharlesAFJBabbageAFJstartedAFJtheAFJdesignAFJofAFJtheAFJfirstAFJautomaticAFJmechanicalAFJcalculator, and charset = AFJ str = AFJCharlesAFJBabbageAFJstartedAFJtheAFJdesignAFJofAFJtheAFJfirstAFJautomaticAFJmechanicalAFJcalculator, and charset = AFJ
``` ```
`[ Charles Babbage started the design of the first automatic mechanical calculator,]` `[ Charles Babbage started the design of the first automatic mechanical calculator,]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: ##### Try with the arguments:
``` ```
str = <<==123==>>In<<==123==>>1820,<<==123==>>Thomas<<==123==>>de<<==123==>>Colmar<<==123==>>launched<<==123==>>the<<==123==>>mechanical<<==123==>>calculator<<==123==>>industry[note<<==123==>>1]<<==123==>>when<<==123==>>he<<==123==>>released<<==123==>>his<<==123==>>simplified<<==123==>>arithmometer, and charset = <<==123==>> str = <<==123==>>In<<==123==>>1820,<<==123==>>Thomas<<==123==>>de<<==123==>>Colmar<<==123==>>launched<<==123==>>the<<==123==>>mechanical<<==123==>>calculator<<==123==>>industry[note<<==123==>>1]<<==123==>>when<<==123==>>he<<==123==>>released<<==123==>>his<<==123==>>simplified<<==123==>>arithmometer, and charset = <<==123==>>
``` ```
`[ In 1820, Thomas de Colmar launched the mechanical calculator industry[note 1] when he released his simplified arithmometer,]` `[ In 1820, Thomas de Colmar launched the mechanical calculator industry[note 1] when he released his simplified arithmometer,]`
###### Does the function returns the value above? ###### Does the function returns the value above?
#### convertbase #### convertbase
##### Try with the arguments `nbr = "4506C", baseFrom = "0123456789ABCDEF" and baseTo = "choumi"` ##### Try with the arguments `nbr = "4506C", baseFrom = "0123456789ABCDEF" and baseTo = "choumi"`
`"hccocimc"` `"hccocimc"`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments `nbr = "babcbaaaaabcb", baseFrom = "abc" and baseTo = "0123456789ABCDEF"` ##### Try with the arguments `nbr = "babcbaaaaabcb", baseFrom = "abc" and baseTo = "0123456789ABCDEF"`
`"9B611"` `"9B611"`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments `nbr = "256850", baseFrom = "0123456789" and baseTo = "01"` ##### Try with the arguments `nbr = "256850", baseFrom = "0123456789" and baseTo = "01"`
`"111110101101010010"` `"111110101101010010"`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments `nbr = "uuhoumo", baseFrom = "choumi" and baseTo = "Zone01"` ##### Try with the arguments `nbr = "uuhoumo", baseFrom = "choumi" and baseTo = "Zone01"`
`"eeone0n"` `"eeone0n"`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments `nbr = "683241", baseFrom = "0123456789" and baseTo = "0123456789"` ##### Try with the arguments `nbr = "683241", baseFrom = "0123456789" and baseTo = "0123456789"`
`"683241"` `"683241"`
###### Does the function returns the value above? ###### Does the function returns the value above?
#### rotatevowels #### rotatevowels
##### Try the program without any arguments ##### Try the program without any arguments
###### Does the program displays a new line? ###### Does the program displays a new line?
##### Try executing the program passing as argument: `"Hello World"` ##### Try executing the program passing as argument: `"Hello World"`
`Hollo Werld` `Hollo Werld`
###### Does the program returns the value above? ###### Does the program returns the value above?
##### Try executing the program passing as arguments: `"HEllO World" "problem solved"` ##### Try executing the program passing as arguments: `"HEllO World" "problem solved"`
`Hello Werld problom sOlvEd` `Hello Werld problom sOlvEd`
###### Does the program returns the value above? ###### Does the program returns the value above?
##### Try executing the program passing as argument: `"str" "shh" "psst"` ##### Try executing the program passing as argument: `"str" "shh" "psst"`
`str shh psst` `str shh psst`
###### Does the program returns the value above? ###### Does the program returns the value above?
##### Try executing the program passing as argument: `"happy thoughts" "good luck"` ##### Try executing the program passing as argument: `"happy thoughts" "good luck"`
`huppy thooghts guod lack` `huppy thooghts guod lack`
###### Does the program returns the value above? ###### Does the program returns the value above?
##### Try executing the program passing as argument: `"al's elEphAnt is overly underweight!"` ##### Try executing the program passing as argument: `"al's elEphAnt is overly underweight!"`
`il's elephunt es ovirly AndErweaght!` `il's elephunt es ovirly AndErweaght!`
###### Does the program returns the value above? ###### Does the program returns the value above?
#### advancedsortwordarr #### advancedsortwordarr
##### Try with the arguments ##### Try with the arguments
``` ```
array = [The earliest computing device undoubtedly consisted of the five fingers of each hand] and f = strings.Compare slice = [The earliest computing device undoubtedly consisted of the five fingers of each hand] and f = strings.Compare
``` ```
`[The computing consisted device each earliest fingers five hand of of the undoubtedly]` `[The computing consisted device each earliest fingers five hand of of the undoubtedly]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments ##### Try with the arguments
``` ```
array = [The word digital comesfrom "digits" or fingers] and f = strings.Compare slice = [The word digital comesfrom "digits" or fingers] and f = strings.Compare
``` ```
`["digits" The comesfrom digital fingers or word]` `["digits" The comesfrom digital fingers or word]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments ##### Try with the arguments
``` ```
array = [a A 1 b B 2 c C 3] and f = strings.Compare slice = [a A 1 b B 2 c C 3] and f = strings.Compare
``` ```
`[1 2 3 A B C a b c]` `[1 2 3 A B C a b c]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments ##### Try with the arguments
``` ```
array = [The computing consisted device each earliest fingers five hand of of the undoubtedly] and f = func(a, b string) int { slice = [The computing consisted device each earliest fingers five hand of of the undoubtedly] and f = func(a, b string) int {
return strings.Compare(b, a) return strings.Compare(b, a)
} }
``` ```
`[undoubtedly the of of hand five fingers earliest each device consisted computing The]` `[undoubtedly the of of hand five fingers earliest each device consisted computing The]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments ##### Try with the arguments
``` ```
array = ["digits" The comesfrom digital fingers or word] and f = func(a, b string) int { slice = ["digits" The comesfrom digital fingers or word] and f = func(a, b string) int {
return strings.Compare(b, a) return strings.Compare(b, a)
} }
``` ```
`[word or fingers digital comesfrom The "digits"]` `[word or fingers digital comesfrom The "digits"]`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments ##### Try with the arguments
``` ```
array = [1 2 3 A B C a b c] and f = func(a, b string) int { slice = [1 2 3 A B C a b c] and f = func(a, b string) int {
return strings.Compare(b, a) return strings.Compare(b, a)
} }
``` ```
`[c b a C B A 3 2 1]` `[c b a C B A 3 2 1]`
###### Does the function returns the value above? ###### Does the function returns the value above?
#### cat #### cat
##### Run the program without arguments and then write: `Hello` ##### Run the program without arguments and then write: `Hello`
`Hello` `Hello`
###### Does the program returns the value above? ###### Does the program returns the value above?
##### Write: `jaflsdfj` ##### Write: `jaflsdfj`
`jaflsdfj` `jaflsdfj`
###### Does the program returns the value above? ###### Does the program returns the value above?
##### Write: `Computer science (sometimes called computation science or computing science` ##### Write: `Computer science (sometimes called computation science or computing science`
`Computer science (sometimes called computation science or computing science` `Computer science (sometimes called computation science or computing science`
###### Does the program returns the value above? ###### Does the program returns the value above?
##### Run the program passing the file: `quest8.txt` as an argument of execution of the program (as shown in the subject) ##### Run the program passing the file: `quest8.txt` as an argument of execution of the program (as shown in the subject)
###### Does the the program displays the same output as in the readme? ###### Does the the program displays the same output as in the readme?
##### Run the program with the file: `quest8T.txt` ##### Run the program with the file: `quest8T.txt`
###### Does the program displays the content of the file? ###### Does the program displays the content of the file?
##### Run the program with the arguments: `quest8T.txt quest8.txt` ##### Run the program with the arguments: `quest8T.txt quest8.txt`
###### Does the program displays the content of the file in order? ###### Does the program displays the content of the file in order?
##### Run the program with a diferent file and then run the system program `cat` with the same file. ##### Run the program with a diferent file and then run the system program `cat` with the same file.
###### Are the outputs identical? ###### Are the outputs identical?
##### Run both this program and the system program `cat` passing as an argument a random string that is not the name of a file ##### Run both this program and the system program `cat` passing as an argument a random string that is not the name of a file
###### Are the outputs identical (ignoring the first word of and the capitalization of the output)? ###### Are the outputs identical (ignoring the first word of and the capitalization of the output)?
#### ztail #### ztail
##### Run both ztail and the system command `tail` with the arguments: `-c 20 <filename>` ##### Run both ztail and the system command `tail` with the arguments: `-c 20 <filename>`
###### Are the outputs exactly the same? ###### Are the outputs exactly the same?
##### Run both ztail and the system command `tail` with the arguments: `<filename> -c 23` ##### Run both ztail and the system command `tail` with the arguments: `<filename> -c 23`
###### Are the outputs exactly the same? ###### Are the outputs exactly the same?
##### Run both ztail and the system command `tail` with the arguments: `-c jelrjq 15` ##### Run both ztail and the system command `tail` with the arguments: `-c jelrjq 15`
###### Are the outputs exactly the same? ###### Are the outputs exactly the same?
##### Run both ztail and the system command `tail` with the arguments: `-c 11 <filename> jfdklsa` ##### Run both ztail and the system command `tail` with the arguments: `-c 11 <filename> jfdklsa`
###### Are the outputs exactly the same? ###### Are the outputs exactly the same?
##### Run both ztail and the system command `tail` with the arguments: `11 -c <filename>` ##### Run both ztail and the system command `tail` with the arguments: `11 -c <filename>`
###### Are the outputs exactly the same? ###### Are the outputs exactly the same?
#### activebits #### activebits
##### Try with the argument: `n = 15` ##### Try with the argument: `n = 15`
`4` `4`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `n = 17` ##### Try with the argument: `n = 17`
`2` `2`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `n = 4` ##### Try with the argument: `n = 4`
`1` `1`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `n = 11` ##### Try with the argument: `n = 11`
`3` `3`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `n = 9` ##### Try with the argument: `n = 9`
`2` `2`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `n = 12` ##### Try with the argument: `n = 12`
`2` `2`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the argument: `n = 2` ##### Try with the argument: `n = 2`
`1` `1`
###### Does the function returns the value above? ###### Does the function returns the value above?
#### sortlistinsert #### sortlistinsert
##### Try with the arguments: `l = 0-> <nil> and data_ref = 39` ##### Try with the arguments: `l = 0-> <nil> and data_ref = 39`
`(0-> 39-> <nil>)` `(0-> 39-> <nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `l = 0-> 1-> 2-> 3-> 4-> 5-> 24-> 25-> 54-> <nil> and data_ref = 33` ##### Try with the arguments: `l = 0-> 1-> 2-> 3-> 4-> 5-> 24-> 25-> 54-> <nil> and data_ref = 33`
`(0-> 1-> 2-> 3-> 4-> 5-> 24-> 25-> 33-> 54-> <nil>)` `(0-> 1-> 2-> 3-> 4-> 5-> 24-> 25-> 33-> 54-> <nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `l = 0-> 2-> 18-> 33-> 37-> 37-> 39-> 52-> 53-> 57-> <nil> and data_ref = 53` ##### Try with the arguments: `l = 0-> 2-> 18-> 33-> 37-> 37-> 39-> 52-> 53-> 57-> <nil> and data_ref = 53`
`(0-> 2-> 18-> 33-> 37-> 37-> 39-> 52-> 53-> 53-> 57-> <nil>)` `(0-> 2-> 18-> 33-> 37-> 37-> 39-> 52-> 53-> 53-> 57-> <nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `l = 0-> 5-> 18-> 24-> 28-> 35-> 42-> 45-> 52-> <nil> and data_ref = 52` ##### Try with the arguments: `l = 0-> 5-> 18-> 24-> 28-> 35-> 42-> 45-> 52-> <nil> and data_ref = 52`
`(0-> 5-> 18-> 24-> 28-> 35-> 42-> 45-> 52-> 52-> <nil>)` `(0-> 5-> 18-> 24-> 28-> 35-> 42-> 45-> 52-> 52-> <nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `l = 0-> 12-> 20-> 23-> 23-> 24-> 30-> 41-> 53-> 57-> 59-> <nil> and data_ref = 38` ##### Try with the arguments: `l = 0-> 12-> 20-> 23-> 23-> 24-> 30-> 41-> 53-> 57-> 59-> <nil> and data_ref = 38`
`(0-> 12-> 20-> 23-> 23-> 24-> 30-> 38-> 41-> 53-> 57-> 59-> <nil>)` `(0-> 12-> 20-> 23-> 23-> 24-> 30-> 38-> 41-> 53-> 57-> 59-> <nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
#### sortedlistmerge #### sortedlistmerge
##### Try with the arguments: `n1 = <nil> and n2 = <nil>` ##### Try with the arguments: `n1 = <nil> and n2 = <nil>`
`(<nil>)` `(<nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `n1 = <nil> and n2 = 2-> 2-> 4-> 9-> 12-> 12-> 19-> 20-> <nil>` ##### Try with the arguments: `n1 = <nil> and n2 = 2-> 2-> 4-> 9-> 12-> 12-> 19-> 20-> <nil>`
`(2-> 2-> 4-> 9-> 12-> 12-> 19-> 20-> <nil>)` `(2-> 2-> 4-> 9-> 12-> 12-> 19-> 20-> <nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `n1 = 4-> 4-> 6-> 9-> 13-> 18-> 20-> 20-> <nil> and n2 = <nil>` ##### Try with the arguments: `n1 = 4-> 4-> 6-> 9-> 13-> 18-> 20-> 20-> <nil> and n2 = <nil>`
`(4-> 4-> 6-> 9-> 13-> 18-> 20-> 20-> <nil>)` `(4-> 4-> 6-> 9-> 13-> 18-> 20-> 20-> <nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `n1 = 0-> 7-> 39-> 92-> 97-> 93-> 91-> 28-> 64-> <nil> and n2 = 80-> 23-> 27-> 30-> 85-> 81-> 75-> 70-> <nil>` ##### Try with the arguments: `n1 = 0-> 7-> 39-> 92-> 97-> 93-> 91-> 28-> 64-> <nil> and n2 = 80-> 23-> 27-> 30-> 85-> 81-> 75-> 70-> <nil>`
`(0-> 7-> 23-> 27-> 28-> 30-> 39-> 64-> 70-> 75-> 80-> 81-> 85-> 91-> 92-> 93-> 97-> <nil>)` `(0-> 7-> 23-> 27-> 28-> 30-> 39-> 64-> 70-> 75-> 80-> 81-> 85-> 91-> 92-> 93-> 97-> <nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `n1 =0-> 2-> 11-> 30-> 54-> 56-> 70-> 79-> 99-> <nil> and n2 = 23-> 28-> 38-> 67-> 67-> 79-> 95-> 97-> <nil>` ##### Try with the arguments: `n1 =0-> 2-> 11-> 30-> 54-> 56-> 70-> 79-> 99-> <nil> and n2 = 23-> 28-> 38-> 67-> 67-> 79-> 95-> 97-> <nil>`
`(0-> 2-> 11-> 23-> 28-> 30-> 38-> 54-> 56-> 67-> 67-> 70-> 79-> 79-> 95-> 97-> 99-> <nil>)` `(0-> 2-> 11-> 23-> 28-> 30-> 38-> 54-> 56-> 67-> 67-> 70-> 79-> 79-> 95-> 97-> 99-> <nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: `n1 = 0-> 3-> 8-> 8-> 13-> 19-> 34-> 38-> 46-> <nil> and n2 = 7-> 39-> 45-> 53-> 59-> 70-> 76-> 79-> <nil>` ##### Try with the arguments: `n1 = 0-> 3-> 8-> 8-> 13-> 19-> 34-> 38-> 46-> <nil> and n2 = 7-> 39-> 45-> 53-> 59-> 70-> 76-> 79-> <nil>`
`(0-> 3-> 7-> 8-> 8-> 13-> 19-> 34-> 38-> 39-> 45-> 46-> 53-> 59-> 70-> 76-> 79-> <nil>)` `(0-> 3-> 7-> 8-> 8-> 13-> 19-> 34-> 38-> 39-> 45-> 46-> 53-> 59-> 70-> 76-> 79-> <nil>)`
###### Does the function returns the value above? ###### Does the function returns the value above?
#### listremoveif #### listremoveif
##### Try with the arguments: `l = <nil> and data_ref = 1` ##### Try with the arguments: `l = <nil> and data_ref = 1`
`(<nil>)` `(<nil>)`
###### Does the function returns the list above? ###### Does the function returns the list above?
##### Try with the arguments: `l = <nil> and data_ref = 96` ##### Try with the arguments: `l = <nil> and data_ref = 96`
`(<nil>)` `(<nil>)`
###### Does the function returns the list above? ###### Does the function returns the list above?
##### Try with the arguments: `l = 98-> 98-> 33-> 34-> 33-> 34-> 33-> 89-> 33-> <nil> and data_ref = 34` ##### Try with the arguments: `l = 98-> 98-> 33-> 34-> 33-> 34-> 33-> 89-> 33-> <nil> and data_ref = 34`
`(98-> 98-> 33-> 33-> 33-> 89-> 33-> <nil>)` `(98-> 98-> 33-> 33-> 33-> 89-> 33-> <nil>)`
###### Does the function returns the list above? ###### Does the function returns the list above?
##### Try with the arguments: `l = 79-> 74-> 99-> 79-> 7-> <nil> and data_ref = 99` ##### Try with the arguments: `l = 79-> 74-> 99-> 79-> 7-> <nil> and data_ref = 99`
`(79-> 74-> 79-> 7-> <nil>)` `(79-> 74-> 79-> 7-> <nil>)`
###### Does the function returns the list above? ###### Does the function returns the list above?
##### Try with the arguments: `l = 56-> 93-> 68-> 56-> 87-> 68-> 56-> 68-> <nil> and data_ref = 68` ##### Try with the arguments: `l = 56-> 93-> 68-> 56-> 87-> 68-> 56-> 68-> <nil> and data_ref = 68`
`(56-> 93-> 56-> 87-> 56-> <nil>)` `(56-> 93-> 56-> 87-> 56-> <nil>)`
###### Does the function returns the list above? ###### Does the function returns the list above?
##### Try with the arguments: `l = mvkUxbqhQve4l-> 4Zc4t hnf SQ-> q2If E8BPuX -> <nil> and data_ref = 4Zc4t hnf SQ` ##### Try with the arguments: `l = mvkUxbqhQve4l-> 4Zc4t hnf SQ-> q2If E8BPuX -> <nil> and data_ref = 4Zc4t hnf SQ`
`(mvkUxbqhQve4l-> q2If E8BPuX -> <nil>)` `(mvkUxbqhQve4l-> q2If E8BPuX -> <nil>)`
###### Does the function returns the list above? ###### Does the function returns the list above?
#### btreetransplant #### btreetransplant
##### Try with the arguments: ##### Try with the arguments:
``` ```
root = root =
01 01
@ -445,6 +779,7 @@ repla =
└── 12 └── 12
└── 15 └── 15
``` ```
``` ```
01 01
└── 07 └── 07
@ -457,8 +792,11 @@ repla =
└── 02 └── 02
└── 03 └── 03
``` ```
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: ##### Try with the arguments:
``` ```
root = root =
33 33
@ -476,6 +814,7 @@ repla =
└── 12 └── 12
└── 15 └── 15
``` ```
``` ```
33 33
├── 5 ├── 5
@ -486,8 +825,11 @@ repla =
└── 12 └── 12
└── 15 └── 15
``` ```
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: ##### Try with the arguments:
``` ```
root = root =
03 03
@ -517,11 +859,13 @@ repla =
└── 12 └── 12
└── 15 └── 15
``` ```
###### Does the function returns the value above? ###### Does the function returns the value above?
#### btreeapplybylevel #### btreeapplybylevel
##### Try with the arguments: ##### Try with the arguments:
``` ```
root = root =
01 01
@ -533,6 +877,7 @@ root =
└── 03 └── 03
and f = fmt.Println and f = fmt.Println
``` ```
``` ```
01 01
07 07
@ -542,8 +887,11 @@ and f = fmt.Println
10 10
03 03
``` ```
###### Does the function prints the value above? ###### Does the function prints the value above?
##### Try with the arguments: ##### Try with the arguments:
``` ```
root = root =
01 01
@ -555,14 +903,17 @@ root =
└── 03 └── 03
and f = fmt.Print and f = fmt.Print
``` ```
``` ```
01070512021003 01070512021003
``` ```
###### Does the function prints the value above? ###### Does the function prints the value above?
#### btreedeletenode #### btreedeletenode
##### Try with the arguments: ##### Try with the arguments:
``` ```
root = root =
01 01
@ -574,6 +925,7 @@ root =
└── 03 └── 03
and node = 02 and node = 02
``` ```
``` ```
01 01
└── 07 └── 07
@ -582,8 +934,11 @@ and node = 02
└── 05 └── 05
└── 03 └── 03
``` ```
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: ##### Try with the arguments:
``` ```
root = root =
33 33
@ -595,6 +950,7 @@ root =
└── 11 └── 11
and node = 20 and node = 20
``` ```
``` ```
33 33
├── 5 ├── 5
@ -603,8 +959,11 @@ and node = 20
└── 13 └── 13
└── 11 └── 11
``` ```
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: ##### Try with the arguments:
``` ```
root = root =
03 03
@ -616,6 +975,7 @@ root =
└── 11 └── 11
and node = 03 and node = 03
``` ```
``` ```
39 39
├── 99 ├── 99
@ -624,8 +984,11 @@ root =
└── 14 └── 14
└── 11 └── 11
``` ```
###### Does the function returns the value above? ###### Does the function returns the value above?
##### Try with the arguments: ##### Try with the arguments:
``` ```
root = root =
03 03
@ -637,6 +1000,7 @@ root =
└── 01 └── 01
and node = 03 and node = 03
``` ```
``` ```
03 03
├── 94 ├── 94
@ -645,4 +1009,5 @@ and node = 03
│ └── 111 │ └── 111
└── 01 └── 01
``` ```
###### Does the function returns the value above? ###### Does the function returns the value above?

12
subjects/go-reloaded/go-reloaded.en.md

@ -417,7 +417,7 @@ student@ubuntu:~/[[ROOT]]/test$
### Instructions ### Instructions
Write a function that separates the words of a `string` and puts them in a `string` array. Write a function that separates the words of a `string` and puts them in a `string` slice.
The separators are spaces, tabs and newlines. The separators are spaces, tabs and newlines.
@ -467,13 +467,13 @@ student@ubuntu:~/[[ROOT]]/test$
### Instructions ### Instructions
Write a [function](TODO-LINK) that simulates the behaviour of the `strings.Split` function in Go. `strings.Split` separates the words of a `string` and puts them in a `string` array. Write a function that simulates the behaviour of the `strings.Split` function in Go. `strings.Split` separates the words of a `string` and puts them in a `string` slice.
The separators are the characters of the `charset string` given in parameter. The separators are the characters of the separator string given in parameter.
### Expected function ### Expected function
```go ```go
func Split(str, charset string) []string { func Split(s, sep string) []string {
} }
``` ```
@ -606,12 +606,12 @@ student@ubuntu:~/[[ROOT]]/test$
### Instructions ### Instructions
Write a function `AdvancedSortWordArr` that sorts a `string` array, based on the function `f` passed in parameter. Write a function `AdvancedSortWordArr` that sorts a `string` slice, based on the function `f` passed in parameter.
### Expected function ### Expected function
```go ```go
func AdvancedSortWordArr(array []string, f func(a, b string) int) { func AdvancedSortWordArr(a []string, f func(a, b string) int) {
} }
``` ```

6
subjects/grouping.en.md

@ -8,9 +8,7 @@ The program should handle the "`|`" operator, that searches for both strings on
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. 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`"). If the number of arguments is different from 2, if the regular expression is not valid, if the last argument is empty or there are no matches the program should print nothing.
If the number of arguments is different from 2 the program should print a newline ("`\n`").
### Usage ### Usage
@ -34,8 +32,6 @@ student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(hi)" "He swore he just saw his s
1: his 1: his
2: sushi 2: sushi
student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(s)" "" student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "(s)" ""
student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "i" "Something in the air" student@ubuntu:~/[[ROOT]]/test$ ./regbrackets "i" "Something in the air"
student@ubuntu:~/[[ROOT]]/test$ student@ubuntu:~/[[ROOT]]/test$
``` ```

15
subjects/halfcontestprog.en.md

@ -1,16 +1,5 @@
## halfcontest ## 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 ### 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). 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).
@ -36,9 +25,7 @@ Here is a possible program to test your function :
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
fmt.Println(Halfcontest(1, 15, 3, 33)) fmt.Println(Halfcontest(1, 15, 3, 33))

5
subjects/hiddenp.en.md

@ -8,7 +8,7 @@ Let s1 and s2 be `string`. It is considered that s1 is hidden in s2 if it is pos
If s1 is an empty `string` it is considered hidden in any `string`. If s1 is an empty `string` it is considered hidden in any `string`.
If the number of parameters is different from 2, the program displays a newline. If the number of parameters is different from 2, the program displays nothing.
### Usage ### Usage
@ -22,7 +22,6 @@ student@ubuntu:~/[[ROOT]]/hiddenp$ ./hiddenp "abc" "btarc" | cat -e
0$ 0$
student@ubuntu:~/[[ROOT]]/hiddenp$ ./hiddenp "DD" "DABC" | cat -e student@ubuntu:~/[[ROOT]]/hiddenp$ ./hiddenp "DD" "DABC" | cat -e
0$ 0$
student@ubuntu:~/[[ROOT]]/hiddenp$ ./hiddenp | cat -e student@ubuntu:~/[[ROOT]]/hiddenp$ ./hiddenp
$
student@ubuntu:~/[[ROOT]]/hiddenp$ student@ubuntu:~/[[ROOT]]/hiddenp$
``` ```

2
subjects/inter.en.md

@ -6,7 +6,7 @@ Write a program that takes two `string` and displays, without doubles, the chara
- 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 nothing.
### Usage ### Usage

11
subjects/interestingnumber.en.md

@ -1,16 +1,5 @@
## interesting_number ## 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 ### 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). 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).

11
subjects/inverttree.en.md

@ -1,16 +1,5 @@
## invert tree ## invert tree
## **WARNING! VERY IMPORTANT!**
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:
This means that:
- The package needs to be named `package main`.
- The submitted code needs one declared function main(`func main()`) even if empty.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done.
- Every other rules are obviously the same than for a `program`.
### Instructions ### Instructions
Write a function that takes tree and inverts(flips) and returns it. Write a function that takes tree and inverts(flips) and returns it.

11
subjects/isanagram.en.md

@ -1,16 +1,5 @@
## isanagram ## isanagram
## **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 ### Instructions
Write a function that returns `true` if two strings are anagrams, otherwise returns `false`. Write a function that returns `true` if two strings are anagrams, otherwise returns `false`.

14
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`. 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 nothing.
- When there is only 1 argument, it will always be a positive valid int. - When there is only one argument, it will always be a positive valid int.
### Usage : ### Usage :
@ -16,13 +16,11 @@ This program must print `true` if the given number is a power of 2, otherwise it
student@ubuntu:~/ispowerof2$ go build student@ubuntu:~/ispowerof2$ go build
student@ubuntu:~/ispowerof2$ ./ispowerof2 2 | cat -e student@ubuntu:~/ispowerof2$ ./ispowerof2 2 | cat -e
true$ true$
student@ubuntu:~/ispowerof2$ ./ispowerof2 64 | cat -e student@ubuntu:~/ispowerof2$ ./ispowerof2 64
true$ true
student@ubuntu:~/ispowerof2$ ./ispowerof2 513 | cat -e student@ubuntu:~/ispowerof2$ ./ispowerof2 513
false$ false
student@ubuntu:~/ispowerof2$ ./ispowerof2 student@ubuntu:~/ispowerof2$ ./ispowerof2
student@ubuntu:~/ispowerof2$ ./ispowerof2 64 1024 student@ubuntu:~/ispowerof2$ ./ispowerof2 64 1024
student@ubuntu:~/ispowerof2$ student@ubuntu:~/ispowerof2$
``` ```

13
subjects/issorted.en.md

@ -4,15 +4,14 @@
Write a function `IsSorted` that returns `true` if the slice of `int` is sorted, and that returns `false` otherwise. Write a function `IsSorted` that returns `true` if the slice of `int` is sorted, and that returns `false` otherwise.
The function passed in parameter returns a positive `int` if `a`(the first argument) is superior to `b`(the second argument), The function passed in parameter returns a positive `int` if `a` (the first argument) is superior to `b` (the second argument), it returns `0` if they are equal and it returns a negative `int` otherwise.
it returns `0` if they are equal and it returns a negative `int` otherwise.
To do your testing you have to write your own `f` function. To do your testing you have to write your own `f` function.
### Expected function ### Expected function
```go ```go
func IsSorted(f func(a, b int) int, tab []int) bool { func IsSorted(f func(a, b int) int, a []int) bool {
} }
``` ```
@ -30,11 +29,11 @@ import (
) )
func main() { func main() {
tab1 := []int{0, 1, 2, 3, 4, 5} a1 := []int{0, 1, 2, 3, 4, 5}
tab2 := []int{0, 2, 1, 3} a2 := []int{0, 2, 1, 3}
result1 := piscine.IsSorted(f, tab1) result1 := piscine.IsSorted(f, a1)
result2 := piscine.IsSorted(f, tab2) result2 := piscine.IsSorted(f, a2)
fmt.Println(result1) fmt.Println(result1)
fmt.Println(result2) fmt.Println(result2)

11
subjects/itoabaseprog.en.md

@ -1,16 +1,5 @@
## itoabase ## itoabase
## **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 ### Instructions
Write a function that: Write a function that:

11
subjects/itoaprog.en.md

@ -1,16 +1,5 @@
## itoaprog ## itoaprog
##**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 ### 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`.

2
subjects/join.en.md

@ -2,7 +2,7 @@
### Instructions ### Instructions
Write a function that returns the concatenation of all the `string` of a table of `string` **separated** by the separator passed in argument. Write a function that returns the concatenation of all the `string` of a slice of `string` **separated** by the separator passed in argument.
### Expected function ### Expected function

11
subjects/lastruneprog.en.md

@ -1,16 +1,5 @@
## lastruneprog ## lastruneprog
## **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 ### Instructions
Write a function that returns the last `rune` of a `string`. Write a function that returns the last `rune` of a `string`.

8
subjects/lastword.en.md

@ -8,7 +8,7 @@ Write a program that takes a `string` and displays its last word, followed by a
- 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 nothing.
### Usage ### Usage
@ -18,10 +18,8 @@ student@ubuntu:~/[[ROOT]]/lastword$ ./lastword "FOR PONY" | cat -e
PONY$ PONY$
student@ubuntu:~/[[ROOT]]/lastword$ ./lastword "this ... is sparta, then again, maybe not" | cat -e student@ubuntu:~/[[ROOT]]/lastword$ ./lastword "this ... is sparta, then again, maybe not" | cat -e
not$ not$
student@ubuntu:~/[[ROOT]]/lastword$ ./lastword " " | cat -e student@ubuntu:~/[[ROOT]]/lastword$ ./lastword " "
$ student@ubuntu:~/[[ROOT]]/lastword$ ./lastword "a" "b"
student@ubuntu:~/[[ROOT]]/lastword$ ./lastword "a" "b" | cat -e
$
student@ubuntu:~/[[ROOT]]/lastword$ ./lastword " lorem,ipsum " | cat -e student@ubuntu:~/[[ROOT]]/lastword$ ./lastword " lorem,ipsum " | cat -e
lorem,ipsum$ lorem,ipsum$
student@ubuntu:~/[[ROOT]]/lastword$ student@ubuntu:~/[[ROOT]]/lastword$

11
subjects/lcm.en.md

@ -1,16 +1,5 @@
## lcm ## lcm
## **WARNING! VERY IMPORTANT!**
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:
This means that:
- The package needs to be named `package main`.
- The submitted code needs one declared function main(`func main()`) even if empty.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done.
- Every other rules are obviously the same than for a `program`.
### Instructions ### Instructions
Write a function, `lcm`, that returns least common multiple. Write a function, `lcm`, that returns least common multiple.

11
subjects/listremoveifprog.en.md

@ -1,16 +1,5 @@
## listremoveifprog ## listremoveifprog
## **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 ### Instructions
Write a function `ListRemoveIf` that removes all elements that have a `Data` field equal to the `data_ref` in the argument of the function. Write a function `ListRemoveIf` that removes all elements that have a `Data` field equal to the `data_ref` in the argument of the function.

11
subjects/listsizeprog.en.md

@ -1,16 +1,5 @@
## listsizeprog ## listsizeprog
## **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 ### Instructions
Write a function `ListSize` that returns the number of elements in a linked list `l`. Write a function `ListSize` that returns the number of elements in a linked list `l`.

8
subjects/map.en.md

@ -2,12 +2,12 @@
### Instructions ### Instructions
Write a function `Map` that, for an `int` array, applies a function of this type `func(int) bool` on each elements of that array and returns an array of all the return values. Write a function `Map` that, for an `int` slice, applies a function of this type `func(int) bool` on each elements of that slice and returns a slice of all the return values.
### Expected function ### Expected function
```go ```go
func Map(f func(int) bool, arr []int) []bool { func Map(f func(int) bool, a []int) []bool {
} }
``` ```
@ -25,8 +25,8 @@ import (
) )
func main() { func main() {
arr := []int{1, 2, 3, 4, 5, 6} a := []int{1, 2, 3, 4, 5, 6}
result := piscine.Map(piscine.IsPrime, arr) result := piscine.Map(piscine.IsPrime, a)
fmt.Println(result) fmt.Println(result)
} }
``` ```

8
subjects/max.en.md

@ -2,12 +2,12 @@
### Instructions ### Instructions
Write a function, `Max`, that returns the maximum value in a slice of integers. Write a function, `Max`, that returns the maximum value in a slice of integers. If the slice is empty, returns 0.
### Expected function ### Expected function
```go ```go
func Max(arr []int) int { func Max(a []int) int {
} }
``` ```
@ -25,8 +25,8 @@ import (
) )
func main() { func main() {
arrInt := []int{23, 123, 1, 11, 55, 93} a := []int{23, 123, 1, 11, 55, 93}
max := piscine.Max(arrInt) max := piscine.Max(a)
fmt.Println(max) fmt.Println(max)
} }
``` ```

17
subjects/maxprog.en.md

@ -1,16 +1,5 @@
## maxprog ## maxprog
##**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 ### Instructions
Write a function, `Max`, that returns the maximum value in a slice of integers. Write a function, `Max`, that returns the maximum value in a slice of integers.
@ -18,7 +7,7 @@ Write a function, `Max`, that returns the maximum value in a slice of integers.
### Expected function ### Expected function
```go ```go
func Max(arr []int) int { func Max(a []int) int {
} }
``` ```
@ -30,9 +19,7 @@ Here is a possible program to test your function :
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
arrInt := []int{23, 123, 1, 11, 55, 93} arrInt := []int{23, 123, 1, 11, 55, 93}

11
subjects/merge.en.md

@ -1,16 +1,5 @@
## merge ## merge
## **WARNING! VERY IMPORTANT!**
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:
This means that:
- The package needs to be named `package main`.
- The submitted code needs one declared function main(`func main()`) even if empty.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done.
- Every other rules are obviously the same than for a `program`.
### Instructions ### Instructions
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.

11
subjects/nauuo.en.md

@ -1,16 +1,5 @@
## nauuo ## nauuo
## **WARNING! VERY IMPORTANT!**
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:
This means that:
- The package needs to be named `package main`.
- The submitted code needs one declared function main(`func main()`) even if empty.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done.
- Every other rules are obviously the same than for a `program`.
### Instructions ### Instructions
There was a vote. There are people who voted positively, negatively, and randomly. There was a vote. There are people who voted positively, negatively, and randomly.

2
subjects/nbrconvertalpha.en.md

@ -2,7 +2,7 @@
### Instructions ### Instructions
Write a **program** that prints the corresponding letter in the `n` position of the classic latin alphabet, where `n` is each argument received. Write a **program** that prints the corresponding letter in the `n` position of the latin alphabet, where `n` is each argument received.
For example `1` matches `a`, `2` matches `b`, etc. If `n` does not match a valid position of the alphabet or if the argument is not an integer, the **program** should print a space (" "). For example `1` matches `a`, `2` matches `b`, etc. If `n` does not match a valid position of the alphabet or if the argument is not an integer, the **program** should print a space (" ").

2
subjects/nenokku.en.md

@ -12,7 +12,7 @@ Intersection of words is counted as if it is in your dictionary (see example).
Write a program that takes as arguments operations. Write a program that takes as arguments operations.
```console ```console
$> ./main "? love" "? is" "A loveis" "? love" "? Who" "A Whoareyou" "? is" $ ./main "? love" "? is" "A loveis" "? love" "? Who" "A Whoareyou" "? is"
NO NO
NO NO
YES YES

11
subjects/nruneprog.en.md

@ -1,16 +1,5 @@
## nruneprog ## nruneprog
##**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 ### Instructions
Write a function that returns the nth `rune` of a `string`. Write a function that returns the nth `rune` of a `string`.

3
subjects/piglatin.en.md

@ -11,14 +11,13 @@ The rules used by Pig Latin are as follows:
If the word has no vowels the program should print "No vowels". 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 newline ("`\n`"). If the number of arguments is different from one, the program prints nothing.
### Usage ### Usage
```console ```console
student@ubuntu:~/student/test$ go build student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/test$ ./piglatin student@ubuntu:~/student/test$ ./piglatin
student@ubuntu:~/student/test$ ./piglatin pig | cat -e student@ubuntu:~/student/test$ ./piglatin pig | cat -e
igpay$ igpay$
student@ubuntu:~/student/test$ ./piglatin Is | cat -e student@ubuntu:~/student/test$ ./piglatin Is | cat -e

11
subjects/printmemory.en.md

@ -1,16 +1,5 @@
## printmemory ## printmemory
## **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 ### Instructions
Write a function that takes `(arr [10]int)`, and displays the memory as in the example. Write a function that takes `(arr [10]int)`, and displays the memory as in the example.

4
subjects/printprogramname.en.md

@ -11,7 +11,7 @@ student@ubuntu:~/[[ROOT]]/printprogramname$ go build main.go
student@ubuntu:~/[[ROOT]]/printprogramname$ ./main student@ubuntu:~/[[ROOT]]/printprogramname$ ./main
main main
student@ubuntu:~/[[ROOT]]/printprogramname$ go build student@ubuntu:~/[[ROOT]]/printprogramname$ go build
student@ubuntu:~/[[ROOT]]/printprogramname$ ./printprogramname student@ubuntu:~/[[ROOT]]/printprogramname$ ./printprogramname | cat -e
printprogramname printprogramname$
student@ubuntu:~/[[ROOT]]/printprogramname$ student@ubuntu:~/[[ROOT]]/printprogramname$
``` ```

6
subjects/printwordstables.en.md

@ -2,11 +2,9 @@
### Instructions ### Instructions
Write a function that prints the words of a `string` array that will be returned a function `SplitWhiteSpaces`. (the testing will be done with ours) Write a function that prints the words of a `string` slice that will be returned a function `SplitWhiteSpaces`.
Each word is on a single line. Each word is on a single line (each word ends with a `\n`).
Each word ends with a `\n`.
### Expected function ### Expected function

19
subjects/priorprime.en.md

@ -1,16 +1,5 @@
## priorprime ## priorprime
## **WARNING! VERY IMPORTANT!**
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:
This means that:
- The package needs to be named `package main`.
- The submitted code needs one declared function main(`func main()`) even if empty.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done.
- Every other rules are obviously the same than for a `program`.
### Instructions ### Instructions
You are given an integer. You are given an integer.
@ -21,7 +10,7 @@ Your function must return sum of all prime numbers prior to the number exclusive
```go ```go
package main package main
func Priorprime(x int) int { func PriorPrime(x int) int {
} }
``` ```
@ -33,12 +22,10 @@ Here is a possible program to test your function:
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
fmt.Println(Priorprime(14)) fmt.Println(PriorPrime(14))
} }
``` ```

16
subjects/raid1a.en.md

@ -25,9 +25,7 @@ Program #1
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1a(5,3) piscine.Raid1a(5,3)
@ -50,9 +48,7 @@ Program #2
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1a(5,1) piscine.Raid1a(5,1)
@ -73,9 +69,7 @@ Program #3
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1a(1,1) piscine.Raid1a(1,1)
@ -96,9 +90,7 @@ Program #4
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1a(1,5) piscine.Raid1a(1,5)

16
subjects/raid1b.en.md

@ -25,9 +25,7 @@ Program #1
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1b(5,3) piscine.Raid1b(5,3)
@ -50,9 +48,7 @@ Program #2
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1b(5,1) piscine.Raid1b(5,1)
@ -73,9 +69,7 @@ Program #3
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1b(1,1) piscine.Raid1b(1,1)
@ -96,9 +90,7 @@ Program #4
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1b(1,5) piscine.Raid1b(1,5)

16
subjects/raid1c.en.md

@ -25,9 +25,7 @@ Program #1
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1c(5,3) piscine.Raid1c(5,3)
@ -50,9 +48,7 @@ Program #2
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1c(5,1) piscine.Raid1c(5,1)
@ -73,9 +69,7 @@ Program #3
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1c(1,1) piscine.Raid1c(1,1)
@ -96,9 +90,7 @@ Program #4
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1c(1,5) piscine.Raid1c(1,5)

16
subjects/raid1d.en.md

@ -25,9 +25,7 @@ Program #1
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1d(5,3) piscine.Raid1d(5,3)
@ -50,9 +48,7 @@ Program #2
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1d(5,1) piscine.Raid1d(5,1)
@ -73,9 +69,7 @@ Program #3
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1d(1,1) piscine.Raid1d(1,1)
@ -96,9 +90,7 @@ Program #4
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1d(1,5) piscine.Raid1d(1,5)

16
subjects/raid1e.en.md

@ -25,9 +25,7 @@ Program #1
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1e(5,3) piscine.Raid1e(5,3)
@ -50,9 +48,7 @@ Program #2
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1e(5,1) piscine.Raid1e(5,1)
@ -73,9 +69,7 @@ Program #3
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1e(1,1) piscine.Raid1e(1,1)
@ -96,9 +90,7 @@ Program #4
```go ```go
package main package main
import ( import piscine ".."
piscine ".."
)
func main() { func main() {
piscine.Raid1e(1,5) piscine.Raid1e(1,5)

6
subjects/range.en.md

@ -4,15 +4,15 @@
Write a program which must: Write a program which must:
- **Allocate (with `make`)** an array of integers. - **Allocate (with `make`)** a slice 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 slice.
Errors should be handled. Errors should be handled.
If the number of arguments is different from 2 the program prints a newline ("`\n`"). If the number of arguments is different from 2 the program prints nothing.
### Expected output : ### Expected output :

25
subjects/reachablenumberprog.en.md

@ -1,15 +1,4 @@
## reachable_number ## reachablenumber
## **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 ### Instructions
@ -18,7 +7,7 @@ Let us define a function f(x) by the following: first we add 1 to x, and then wh
### Expected function ### Expected function
```go ```go
func Reachablenumber(n int) int { func ReachableNumber(n int) int {
} }
``` ```
@ -30,14 +19,12 @@ Here is a possible program to test your function :
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
fmt.Println(Reachablenumber(1)) fmt.Println(ReachableNumber(1))
fmt.Println(Reachablenumber(10)) fmt.Println(ReachableNumber(10))
fmt.Println(Reachablenumber(1001)) fmt.Println(ReachableNumber(1001))
} }
``` ```

3
subjects/rectangle.en.md

@ -2,8 +2,7 @@
### Instructions ### Instructions
Consider that a point is defined by its coordinates and that a rectangle 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.
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`.

11
subjects/reduceint.en.md

@ -1,16 +1,5 @@
## reduceint ## 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 ### Instructions
Write a function called `reduceint` that simulates the behaviour of reduce from JavaScript. Write a function called `reduceint` that simulates the behaviour of reduce from JavaScript.

14
subjects/repeatalpha.en.md

@ -2,29 +2,25 @@
### Instructions ### Instructions
Write a program called `repeat_alpha` that takes a `string` and displays it Write a program called `repeat_alpha` that takes a `string` and displays it repeating each alphabetical character as many times as its alphabetical index.
repeating each alphabetical character as many times as its alphabetical index.
The result must be followed by a newline (`'\n'`). The result must be followed by a newline (`'\n'`).
`'a'` becomes `'a'`, `'b'` becomes `'bb'`, `'e'` becomes `'eeeee'`, etc... `'a'` becomes `'a'`, `'b'` becomes `'bb'`, `'e'` becomes `'eeeee'`, etc...
The case remains unchanged. If the number of arguments is different from 1, the program displays nothing.
If the number of arguments is different from 1, the program displays a newline (`'\n'`).
### Usage ### Usage
```console ```console
student@ubuntu:~/[[ROOT]]/repeatalpha$ go build student@ubuntu:~/[[ROOT]]/repeatalpha$ go build
student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha "abc" | cat -e student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha abc | cat -e
abbccc abbccc
student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha "Choumi." | cat -e student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha Choumi. | cat -e
CCChhhhhhhhooooooooooooooouuuuuuuuuuuuuuuuuuuuummmmmmmmmmmmmiiiiiiiii.$ CCChhhhhhhhooooooooooooooouuuuuuuuuuuuuuuuuuuuummmmmmmmmmmmmiiiiiiiii.$
student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha "abacadaba 01!" | cat -e student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha "abacadaba 01!" | cat -e
abbacccaddddabba 01!$ abbacccaddddabba 01!$
student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha | cat -e student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha
$
student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha "" | cat -e student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha "" | cat -e
$ $
student@ubuntu:~/[[ROOT]]/repeatalpha$ student@ubuntu:~/[[ROOT]]/repeatalpha$

15
subjects/reverse.en.md

@ -1,16 +1,5 @@
## reverse ## reverse
## **WARNING! VERY IMPORTANT!**
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:
This means that:
- The package needs to be named `package main`.
- The submitted code needs one declared function main(`func main()`) even if empty.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done.
- Every other rules are obviously the same than for a `program`.
### Instructions ### Instructions
You are given a linked list, where each node contains a single digit. You are given a linked list, where each node contains a single digit.
@ -38,9 +27,7 @@ Here is a possible program to test your function :
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func pushBack(n *NodeAddL, num int) *NodeAddL{ func pushBack(n *NodeAddL, num int) *NodeAddL{

15
subjects/reversebits.en.md

@ -1,16 +1,5 @@
## reversebits ## reversebits
## **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 ### Instructions
Write a function that takes a `byte`, reverses it `bit` by `bit` (as shown in the example) and returns the result. Write a function that takes a `byte`, reverses it `bit` by `bit` (as shown in the example) and returns the result.
@ -27,7 +16,9 @@ func ReverseBits(oct byte) byte {
Example: Example:
1 byte 1 byte
_____________
---
0010 0110 0010 0110
|| ||
\/ \/

6
subjects/reverserange.en.md

@ -4,15 +4,15 @@
Write a program which must: Write a program which must:
- **Allocate (with `make`)** an array of integers. - **Allocate (with `make`)** a slice 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 slice.
Errors should be handled. Errors should be handled.
If the number of arguments is different from 2 the program prints a newline ("`\n`"). If the number of arguments is different from 2 the program prints nothing.
### Usage : ### Usage :

25
subjects/revivethreenums.en.md

@ -1,15 +1,4 @@
## revive_three_nums ## revivethreenums
## **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 ### Instructions
@ -23,7 +12,7 @@ There are basically three integers: **a**, **b**, **c**. You are given 4 integer
### Expected function ### Expected function
```go ```go
func Revive_three_nums(a, b, c, d int) int { func ReviveThreeNums(a, b, c, d int) int {
} }
``` ```
@ -35,14 +24,12 @@ Here is a possible program to test your function :
```go ```go
package main package main
import ( import "fmt"
"fmt"
)
func main() { func main() {
fmt.Println(Revive_three_nums(3, 6, 5, 4)) fmt.Println(ReviveThreeNums(3, 6, 5, 4))
fmt.Println(Revive_three_nums(40, 40, 40, 60)) fmt.Println(ReviveThreeNums(40, 40, 40, 60))
fmt.Println(Revive_three_nums(201, 101, 101, 200)) fmt.Println(ReviveThreeNums(201, 101, 101, 200))
} }
``` ```

2
subjects/robottoorigin.en.md

@ -13,7 +13,7 @@ Sequence of moves is a string, which characters state for movement direction:
- R - right - R - right
- L - left - L - left
If the number of arguments is not 1, output `\n`. If the number of arguments is not 1, output nothing.
### Usage ### Usage

4
subjects/romannumbers.en.md

@ -9,7 +9,7 @@ The program should have a limit of `4000`. In case of an invalid number, for exa
Roman Numerals reminder: Roman Numerals reminder:
| I | 1 | | I | 1 |
|:-:|:----:| | :-: | :--: |
| V | 5 | | V | 5 |
| X | 10 | | X | 10 |
| L | 50 | | L | 50 |
@ -22,7 +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. The following table gives the Roman numerals for the first few positive integers.
| 1 | I | 11 | XI | 21 | XXI | | 1 | I | 11 | XI | 21 | XXI |
|:--:|:----:|:--:|:-----:|:--:|:------:| | :-: | :--: | :-: | :---: | :-: | :----: |
| 2 | II | 12 | XII | 22 | XXII | | 2 | II | 12 | XII | 22 | XXII |
| 3 | III | 13 | XIII | 23 | XXIII | | 3 | III | 13 | XIII | 23 | XXIII |
| 4 | IV | 14 | XIV | 24 | XXIV | | 4 | IV | 14 | XIV | 24 | XXIV |

3
subjects/rot13.en.md

@ -9,7 +9,7 @@ letters by the letter 13 spaces ahead in alphabetical order.
- 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 nothing.
### Usage ### Usage
@ -22,6 +22,5 @@ uryyb gurer
student@ubuntu:~/[[ROOT]]/test$ ./test "HELLO, HELP" student@ubuntu:~/[[ROOT]]/test$ ./test "HELLO, HELP"
URYYB, URYC URYYB, URYC
student@ubuntu:~/[[ROOT]]/test$ ./test student@ubuntu:~/[[ROOT]]/test$ ./test
student@ubuntu:~/[[ROOT]]/test$ student@ubuntu:~/[[ROOT]]/test$
``` ```

7
subjects/rot14.en.md

@ -7,7 +7,7 @@ Write a function `rot14` that returns the `string` within the parameter transfor
### Expected function ### Expected function
```go ```go
func Rot14(str string) string { func Rot14(s string) string {
} }
``` ```
@ -26,10 +26,9 @@ import (
func main() { func main() {
result := piscine.Rot14("Hello How are You") result := piscine.Rot14("Hello How are You")
arrayRune := []rune(result)
for _, s := range arrayRune { for _, r := range result {
z01.PrintRune(s) z01.PrintRune(r)
} }
z01.PrintRune('\n') z01.PrintRune('\n')
} }

2
subjects/rot14prog.en.md

@ -11,8 +11,6 @@ student@ubuntu:~/rot14prog$ go build
student@ubuntu:~/rot14prog$ ./rot14prog "Hello How are You" | cat -e student@ubuntu:~/rot14prog$ ./rot14prog "Hello How are You" | cat -e
Vszzc Vck ofs Mci$ Vszzc Vck ofs Mci$
student@ubuntu:~/rot14prog$ ./rot14prog Hello How are You student@ubuntu:~/rot14prog$ ./rot14prog Hello How are You
student@ubuntu:~/rot14prog$ ./rot14prog student@ubuntu:~/rot14prog$ ./rot14prog
student@ubuntu:~/rot14prog$ student@ubuntu:~/rot14prog$
``` ```

11
subjects/sametree.en.md

@ -1,16 +1,5 @@
## sametree ## sametree
## **WARNING! VERY IMPORTANT!**
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:
This means that:
- The package needs to be named `package main`.
- The submitted code needs one declared function main(`func main()`) even if empty.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testing are done.
- Every other rules are obviously the same than for a `program`.
### Instructions ### Instructions
Given two binary trees, write a function to check if they are the same or not. Given two binary trees, write a function to check if they are the same or not.

3
subjects/searchreplace.en.md

@ -4,7 +4,7 @@
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). 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 nothing.
- 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'`).
@ -17,6 +17,5 @@ hello there
student@ubuntu:~/[[ROOT]]/test$ ./test "abcd" "z" "l" student@ubuntu:~/[[ROOT]]/test$ ./test "abcd" "z" "l"
abcd abcd
student@ubuntu:~/[[ROOT]]/test$ ./test "something" "a" "o" "b" "c" student@ubuntu:~/[[ROOT]]/test$ ./test "something" "a" "o" "b" "c"
student@ubuntu:~/[[ROOT]]/test$ student@ubuntu:~/[[ROOT]]/test$
``` ```

Some files were not shown because too many files changed in this diff diff.show_more

Loading…
Cancel
Save