Browse Source

Merge pull request #826 from 01-edu/go-piscine-fixes

Go piscine fixes
content-update
augusto-mantilla 3 years ago committed by GitHub
parent
commit
3890d9df6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      subjects/appendrange/README.md
  2. 6
      subjects/boolean/README.md
  3. 2
      subjects/btreeapplybylevel/README.md
  4. 6
      subjects/btreeapplyinorder/README.md
  5. 6
      subjects/btreeapplypostorder/README.md
  6. 6
      subjects/btreeapplypreorder/README.md
  7. 6
      subjects/btreeinsertdata/README.md
  8. 2
      subjects/btreeisbinary/README.md
  9. 2
      subjects/btreesearchitem/README.md
  10. 2
      subjects/collatzcountdown/README.md
  11. 4
      subjects/compact/README.md
  12. 8
      subjects/convertbase/README.md
  13. 2
      subjects/enigma/README.md
  14. 2
      subjects/fibonacci/README.md
  15. 2
      subjects/iterativepower/README.md
  16. 2
      subjects/join/README.md
  17. 2
      subjects/makerange/README.md
  18. 6
      subjects/pilot/README.md
  19. 6
      subjects/point/README.md
  20. 4
      subjects/printwordstables/README.md
  21. 2
      subjects/recursivepower/README.md
  22. 4
      subjects/split/README.md
  23. 2
      subjects/splitwhitespaces/README.md
  24. 2
      subjects/unmatch/README.md

2
subjects/appendrange/README.md

@ -2,7 +2,7 @@
### Instructions
Write a function that takes an `int` min and an `int` max as parameters. That function returns a slice of `int` with all the values between min and max.
Write a function that takes an `int` min and an `int` max as parameters. That function returns a slice of `int`s with all the values between min and max.
Min is included, and max is excluded.

6
subjects/boolean/README.md

@ -2,14 +2,12 @@
### Instructions
Create a `.go` file.
Create a new directory called `boolean`.
- The code below has to be copied in that file.
- The code below has to be copied in a file called `main.go` inside the `boolean` directory.
- The necessary changes have to be applied so that the program works.
- The program must be submitted inside a folder with the name `boolean`.
### Code to be copied
```go

2
subjects/btreeapplybylevel/README.md

@ -2,7 +2,7 @@
### Instructions
Write a function, `BTreeApplyByLevel`, that applies the function given by `fn` to each node of the tree given by `root`.
Write a function, `BTreeApplyByLevel`, that applies the function given by `f`, to each node of the tree given by `root`.
### Expected function

6
subjects/btreeapplyinorder/README.md

@ -2,7 +2,11 @@
### Instructions
Write a function that applies a function in order to each element in the tree (see "in order tree walks").
Write a function that applies a given function `f`, **in order**, to each element in the tree.
### Notions
- [Tree Traversal](https://en.wikipedia.org/wiki/Tree_traversal)
### Expected function

6
subjects/btreeapplypostorder/README.md

@ -2,7 +2,11 @@
### Instructions
Write a function that applies a function using a postorder walk to each element in the tree.
Write a function that applies a given function `f`, to each element in the tree using a postorder walk.
### Notions
- [Tree Traversal](https://en.wikipedia.org/wiki/Tree_traversal)
### Expected function

6
subjects/btreeapplypreorder/README.md

@ -2,7 +2,11 @@
### Instructions
Write a function that applies a function using a preorder walk to each element in the tree.
Write a function that applies a given function `f` to each element in the tree using a preorder walk.
### Notions
- [Tree Traversal](https://en.wikipedia.org/wiki/Tree_traversal)
### Expected function

6
subjects/btreeinsertdata/README.md

@ -2,10 +2,14 @@
### Instructions
Write a function that inserts new data in a binary search tree following the properties of binary search trees.
Write a function that inserts new data in a `binary search tree` following the special properties of a `binary search trees`.
The nodes must be defined as follows :
### Notions
- [binary search trees](https://en.wikipedia.org/wiki/Binary_search_tree)
### Expected function
```go

2
subjects/btreeisbinary/README.md

@ -2,7 +2,7 @@
### Instructions
Write a function, `BTreeIsBinary`, that returns `true` only if the tree given by `root` follows the binary search tree properties.
Write a function, `BTreeIsBinary`, that returns `true` only if the tree given by `root` follows the binary search tree [properties](https://en.wikipedia.org/wiki/Binary_search_tree#Definition).
### Expected function

2
subjects/btreesearchitem/README.md

@ -2,7 +2,7 @@
### Instructions
Write a function that searches for a node with a data element equal to `elem`and that returns that node.
Write a function that returns the `TreeNode` with a `data` field equal to `elem` if it exists in the tree, otherwise return `nil`.
### Expected function

2
subjects/collatzcountdown/README.md

@ -2,7 +2,7 @@
### Instructions
Write a function, `CollatzCountdown`, that returns the number of steps necessary to reach 1 using the collatz countdown.
Write a function, `CollatzCountdown`, that returns the number of steps necessary to reach 1 using the [collatz countdown](https://en.wikipedia.org/wiki/Collatz_conjecture).
- It must return `-1` if `start` is equal to `0` or negative.

4
subjects/compact/README.md

@ -2,10 +2,10 @@
### Instructions
Write a function `Compact` that takes a pointer to a slice of `string` as the argument.
Write a function `Compact` that takes a pointer to a slice of `string`s as the argument.
This function must:
- Return the number of elements with non-zero value.
- Return the number of elements with [non-zero value](https://tour.golang.org/basics/12).
- Compact, i.e., delete the elements with zero-values in the slice.

8
subjects/convertbase/README.md

@ -2,7 +2,13 @@
### Instructions
Write a function that returns the conversion of a `string` number from one `string` baseFrom to one `string` baseTo.
Write a function that receives three arguments:
- `nbr`: A string representing a numberic value in a [base](https://simple.wikipedia.org/wiki/Base_(mathematics)).
- `baseFrom`: A string representing the base `nbr` it's using.
- `baseTo`: A string representing the base `nbr` should be represented in the returned value.
Only valid bases will be tested.

2
subjects/enigma/README.md

@ -2,7 +2,7 @@
### Instructions
Write a function called `Enigma` that receives pointers to as arguments and move its values around to hide them.
Write a function called `Enigma` that receives pointers as arguments and move its values around to hide them.
This function will put :

2
subjects/fibonacci/README.md

@ -2,7 +2,7 @@
### Instructions
Write a **recursive** function that returns the value of the fibonacci sequence matching the index passed as parameter.
Write a **recursive** function that returns the value at the position `index` in the fibonacci sequence.
The first value is at index `0`.

2
subjects/iterativepower/README.md

@ -2,7 +2,7 @@
### Instructions
Write an **iterative** function that returns the power of the `int` passed as parameter.
Write an **iterative** function that returns the value of `nb` to the power of `power`.
Negative powers will return `0`. Overflows do **not** have to be dealt with.

2
subjects/join/README.md

@ -2,7 +2,7 @@
### Instructions
Write a function that simulates the behaviour of the `Join` function in Go. This function returns the concatenation of all the strings of a slice of strings **separated** by a separator passed in argument.
Write a function that returns the concatenation of all the `string`s of a slice of `string`s **separated** by the separator passed in the argument `sep`.
### Expected function

2
subjects/makerange/README.md

@ -3,7 +3,7 @@
### Instructions
Write a function that takes an `int` min and an `int` max as parameters.
That function returns a slice of `int` with all the values between min and max.
That function returns a slice of `int`s with all the values between min and max.
Min is included, and max is excluded.

6
subjects/pilot/README.md

@ -2,7 +2,11 @@
### Instructions
Append to the code below what is needed so that the program compiles.
- Create a directory called `pilot`.
- Inside the directory `pilot` create a file `main.go`.
- Copy the code below to `main.go` and add the code needed so that the program compiles.
> Note: You can only add code, not delete.
### Usage

6
subjects/point/README.md

@ -2,14 +2,12 @@
### Instructions
Create a `.go` file.
Create a new directory called `point`.
- The code below has to be copied in that file.
- The code below has to be copied in a file called `main.go` inside the `point` directory.
- The necessary changes have to be applied so that the program works.
- The program must be submitted inside a folder with the name `point`.
### Code to be copied
```go

4
subjects/printwordstables/README.md

@ -2,9 +2,7 @@
### Instructions
Write a function that prints the words of a `string` slice that will be returned by a function `SplitWhiteSpaces`.
Each word is on a single line (each word ends with a `\n`).
Write a function that receives a `string slice` and prints each element of the slice in one line.
### Expected function

2
subjects/recursivepower/README.md

@ -2,7 +2,7 @@
### Instructions
Write an **recursive** function that returns the power of the `int` passed as parameter.
Write a **recursive** function that returns the value of `nb` to the power of `power`.
Negative powers will return `0`. Overflows do **not** have to be dealt with.

4
subjects/split/README.md

@ -2,9 +2,7 @@
### Instructions
Write a function that separates the words of a `string` and puts them in a `string` slice.
The separators are the characters of the separator string given in parameter.
Write a function that receives a string and a separator and returns a `slice of strings` that results of splitting the string `s` by the separator `sep`.
### Expected function

2
subjects/splitwhitespaces/README.md

@ -2,7 +2,7 @@
### Instructions
Write a function that separates the words of a `string` and puts them in a `string` slice.
Write a function that separates the words of a `string` and puts them in a `string slice`.
The separators are spaces, tabs and newlines.

2
subjects/unmatch/README.md

@ -4,7 +4,7 @@
Write a function, `Unmatch`, that returns the element of the slice that does not have a correspondent pair.
- If all the number have a correspondent pair, it shoud return `-1`.
- If all the number have a correspondent pair, it should return `-1`.
### Expected function

Loading…
Cancel
Save