Browse Source

Change titles format

`sed -i 's/^\(#\+\) /\1# /' *.md`
pull/57/head
Clement Denis 6 years ago
parent
commit
25dad2b1c8
  1. 8
      subjects/abort.md
  2. 8
      subjects/activebits.md
  3. 6
      subjects/bool.md
  4. 8
      subjects/btreeapplybylevel.md
  5. 8
      subjects/btreedeletenode.md
  6. 8
      subjects/btreeisbinary.md
  7. 8
      subjects/btreelevelcount.md
  8. 8
      subjects/btreemax.md
  9. 8
      subjects/btreemin.md
  10. 8
      subjects/btreetransplant.md
  11. 6
      subjects/cat.md
  12. 8
      subjects/collatzcountdown.md
  13. 8
      subjects/comcheck.md
  14. 8
      subjects/compact.md
  15. 8
      subjects/countdown.md
  16. 8
      subjects/createelem.md
  17. 6
      subjects/dispfirstpar.md
  18. 6
      subjects/displastpar.md
  19. 8
      subjects/displaya.md
  20. 4
      subjects/displayalpham.md
  21. 4
      subjects/displayalrevm.md
  22. 6
      subjects/displayfile.md
  23. 6
      subjects/displayz.md
  24. 8
      subjects/enigma.md
  25. 6
      subjects/firstword.md
  26. 8
      subjects/fixthemain.md
  27. 8
      subjects/hello.md
  28. 6
      subjects/inter.md
  29. 8
      subjects/join.md
  30. 4
      subjects/lastword.md
  31. 8
      subjects/listat.md
  32. 8
      subjects/listclear.md
  33. 8
      subjects/listfind.md
  34. 8
      subjects/listforeach.md
  35. 8
      subjects/listforeachif.md
  36. 8
      subjects/listlast.md
  37. 8
      subjects/listmerge.md
  38. 8
      subjects/listpushback.md
  39. 8
      subjects/listpushfront.md
  40. 4
      subjects/listpushpara.md
  41. 8
      subjects/listremoveif.md
  42. 8
      subjects/listreverse.md
  43. 8
      subjects/listsize.md
  44. 8
      subjects/listsort.md
  45. 8
      subjects/max.md
  46. 4
      subjects/onlya.md
  47. 4
      subjects/onlyz.md
  48. 6
      subjects/pilot.md
  49. 4
      subjects/point.md
  50. 8
      subjects/rectangle.md
  51. 4
      subjects/repeatalpha.md
  52. 4
      subjects/reversebits.md
  53. 6
      subjects/rot13.md
  54. 8
      subjects/rot14.md
  55. 6
      subjects/searchreplace.md
  56. 8
      subjects/sortedlistmerge.md
  57. 8
      subjects/sortlistinsert.md
  58. 6
      subjects/strlen.md
  59. 4
      subjects/swapbits.md
  60. 6
      subjects/switchcase.md
  61. 4
      subjects/union.md
  62. 8
      subjects/unmatch.md
  63. 6
      subjects/wdmatch.md
  64. 4
      subjects/ztail.md

8
subjects/abort.md

@ -1,11 +1,11 @@
# abort ## abort
## Instructions ### Instructions
Write a function that returns the the value in the middle of 5 five arguments. Write a function that returns the the value in the middle of 5 five arguments.
This function must have the following signature. This function must have the following signature.
## Expected function ### Expected function
```go ```go
func Abort(a, b, c, d, e int) int { func Abort(a, b, c, d, e int) int {
@ -14,7 +14,7 @@ func Abort(a, b, c, d, e int) int {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/activebits.md

@ -1,11 +1,11 @@
# activebits ## activebits
## Instructions ### Instructions
Write a function, ActiveBitsthat, that returns the number of active bits (bits with the value 1) in the binary representation of an integer number. Write a function, ActiveBitsthat, that returns the number of active bits (bits with the value 1) in the binary representation of an integer number.
The function must have the next signature. The function must have the next signature.
## Expected function ### Expected function
```go ```go
@ -15,7 +15,7 @@ func ActiveBits(n int) uint {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

6
subjects/bool.md

@ -1,6 +1,6 @@
# Boolean # Boolean
## Instructions ### Instructions
Create a `.go` file and copy the code below into our file Create a `.go` file and copy the code below into our file
@ -36,11 +36,11 @@ func main() {
} }
``` ```
## Expected output ### Expected output
```go ```go
I have an even number of arguments I have an even number of arguments
``` ```
## Or ### Or
```go ```go
I have an odd number of arguments I have an odd number of arguments
``` ```

8
subjects/btreeapplybylevel.md

@ -1,11 +1,11 @@
# btreeapplybylevel ## btreeapplybylevel
## Instructions ### 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 fn to each node of the tree given by root.
This function must have the following signature. This function must have the following signature.
## Expected function ### Expected function
```go ```go
func BTreeApplyByLevel(root *TreeNode, fn interface{}) { func BTreeApplyByLevel(root *TreeNode, fn interface{}) {
@ -14,7 +14,7 @@ func BTreeApplyByLevel(root *TreeNode, fn interface{}) {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/btreedeletenode.md

@ -1,5 +1,5 @@
# btreedeletenode ## btreedeletenode
## Instructions ### Instructions
Write a function, BTreeDeleteNode, that deletes 'node' from the tree given by root. Write a function, BTreeDeleteNode, that deletes 'node' from the tree given by root.
@ -7,7 +7,7 @@ The resulting tree should still follow the binary search tree rules.
This function must have the following signature. This function must have the following signature.
## Expected function ### Expected function
```go ```go
func BTreeDeleteNode(root, node *TreeNode) *TreeNode { func BTreeDeleteNode(root, node *TreeNode) *TreeNode {
@ -16,7 +16,7 @@ func BTreeDeleteNode(root, node *TreeNode) *TreeNode {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/btreeisbinary.md

@ -1,11 +1,11 @@
# btreeisbinary ## btreeisbinary
## Instructions ### 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.
This function must have the following signature. This function must have the following signature.
## Expected function ### Expected function
```go ```go
func BTreeIsBinary(root *TreeNode) bool { func BTreeIsBinary(root *TreeNode) bool {
@ -14,7 +14,7 @@ func BTreeIsBinary(root *TreeNode) bool {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/btreelevelcount.md

@ -1,9 +1,9 @@
# btreelevelcount ## btreelevelcount
## Instructions ### Instructions
Write a function, BTreeLevelCount, that return the number of levels of the tree (height of the tree) Write a function, BTreeLevelCount, that return the number of levels of the tree (height of the tree)
## Expected function ### Expected function
```go ```go
func BTreeLevelCount(root *piscine.TreeNode) int { func BTreeLevelCount(root *piscine.TreeNode) int {
@ -12,7 +12,7 @@ func BTreeLevelCount(root *piscine.TreeNode) int {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/btreemax.md

@ -1,11 +1,11 @@
# btreemax ## btreemax
## Instructions ### Instructions
Write a function, BTreeMax, that returns the node with the maximum value in the tree given by root Write a function, BTreeMax, that returns the node with the maximum value in the tree given by root
This function must have the following signature. This function must have the following signature.
## Expected function ### Expected function
```go ```go
func BTreeMax(root *TreeNode) *TreeNode { func BTreeMax(root *TreeNode) *TreeNode {
@ -14,7 +14,7 @@ func BTreeMax(root *TreeNode) *TreeNode {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/btreemin.md

@ -1,11 +1,11 @@
# btreemin ## btreemin
## Instructions ### Instructions
Write a function, BTreeMin, that returns the node with the minimum value in the tree given by root Write a function, BTreeMin, that returns the node with the minimum value in the tree given by root
This function must have the following signature. This function must have the following signature.
## Expected function ### Expected function
```go ```go
func BTreeMin(root *TreeNode) *TreeNode { func BTreeMin(root *TreeNode) *TreeNode {
@ -14,7 +14,7 @@ func BTreeMin(root *TreeNode) *TreeNode {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/btreetransplant.md

@ -1,11 +1,11 @@
# btreetransplant ## btreetransplant
## Instructions ### Instructions
In order to move subtrees around within the binary search tree, write a function, BTreeTransplant, which replaces the subtree started by node with the node called 'rplc' in the tree given by root. In order to move subtrees around within the binary search tree, write a function, BTreeTransplant, which replaces the subtree started by node with the node called 'rplc' in the tree given by root.
This function must have the following signature. This function must have the following signature.
## Expected function ### Expected function
```go ```go
func BTreeTransplant(root, node, rplc *TreeNode) *TreeNode { func BTreeTransplant(root, node, rplc *TreeNode) *TreeNode {
@ -14,7 +14,7 @@ func BTreeTransplant(root, node, rplc *TreeNode) *TreeNode {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

6
subjects/cat.md

@ -1,6 +1,6 @@
# Cat ## Cat
## Instructions ### Instructions
Write a program that does the same thing as the system's `cat` command-line. Write a program that does the same thing as the system's `cat` command-line.
@ -20,7 +20,7 @@ Write a program that does the same thing as the system's `cat` command-line.
- In case of error it should print the error. - In case of error it should print the error.
## Output: ### Output:
```console ```console
student@ubuntu:~/student/test$ go build student@ubuntu:~/student/test$ go build

8
subjects/collatzcountdown.md

@ -1,11 +1,11 @@
# collatzcountdown ## collatzcountdown
## Instructions ### Instructions
Write a function, CollatzCountdown, that returns the number of steps to reach 1 using the collatz countdown. Write a function, CollatzCountdown, that returns the number of steps to reach 1 using the collatz countdown.
The function must have the following signature. The function must have the following signature.
## Expected function ### Expected function
```go ```go
func CollatzCountdown(start int) int { func CollatzCountdown(start int) int {
@ -14,7 +14,7 @@ func CollatzCountdown(start int) int {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/comcheck.md

@ -1,19 +1,19 @@
# ROT 14 ## ROT 14
## Instructions ### Instructions
Write a function `rot14` that returns the string within the parameter but transformed into a rot14 string. Write a function `rot14` that returns the string within the parameter but transformed into a rot14 string.
- If you not certain what we are talking about, there is a rot13 already. - If you not certain what we are talking about, there is a rot13 already.
## Expected function ### Expected function
```go ```go
func rot14(str string) string { func rot14(str string) string {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/compact.md

@ -1,19 +1,19 @@
# Compact ## Compact
## Instructions ### Instructions
Write a function that will take a pointer to a array as parameter and overwrites any element that points to `nil`. Write a function that will take a pointer to a array as parameter and overwrites any element that points to `nil`.
- If you not sure what the function does. It exists in Ruby. - If you not sure what the function does. It exists in Ruby.
## Expected functions ### Expected functions
```go ```go
func Compact(ptr *[]string, length int) int { func Compact(ptr *[]string, length int) int {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/countdown.md

@ -1,13 +1,13 @@
# countdown ## countdown
## Instructions ### Instructions
Write a program that displays all digits in descending order, followed by a Write a program that displays all digits in descending order, followed by a
newline. newline.
## Expected main and function for the program ### Expected main and function for the program
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

8
subjects/createelem.md

@ -1,10 +1,10 @@
# createelem ## createelem
## Instructions ### Instructions
Write a function `CreateElem` that creates a new element of type`Node`. Write a function `CreateElem` that creates a new element of type`Node`.
## Expected function and structure ### Expected function and structure
```go ```go
type Node struct { type Node struct {
@ -17,7 +17,7 @@ func CreateElem(n *Node, value int) {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

6
subjects/dispfirstpar.md

@ -1,10 +1,10 @@
# dispfirstpar ## dispfirstpar
## Instructions ### Instructions
Write a program that takes strings as arguments, and displays its first argument. Write a program that takes strings as arguments, and displays its first argument.
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

6
subjects/displastpar.md

@ -1,10 +1,10 @@
# displastpar ## displastpar
## Instructions ### Instructions
Write a program that takes strings as arguments, and displays its last argument. Write a program that takes strings as arguments, and displays its last argument.
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

8
subjects/displaya.md

@ -1,15 +1,15 @@
# displaya ## displaya
## 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. If there are no 'a' characters in the encounters in it, followed by a newline. If there are no 'a' characters in the
string, the program just writes a newline. If the number of parameters is not string, the program just writes a newline. If the number of parameters is not
1, the program displays 'a' followed by a newline. 1, the program displays 'a' followed by a newline.
## Expected main and function for the program ### Expected main and function for the program
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

4
subjects/displayalpham.md

@ -1,5 +1,5 @@
# displayalpham ## displayalpham
## 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. odd letters in lowercase, followed by a newline.

4
subjects/displayalrevm.md

@ -1,5 +1,5 @@
# displayalrevm ## displayalrevm
## 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. uppercase, and odd letters in lowercase, followed by a newline.

6
subjects/displayfile.md

@ -1,6 +1,6 @@
# Display File ## Display File
## Instructions ### Instructions
Write a program that displays, on the standard output, only the content of the file given as argument. Write a program that displays, on the standard output, only the content of the file given as argument.
@ -12,7 +12,7 @@ Write a program that displays, on the standard output, only the content of the f
- `File name missing`. - `File name missing`.
- `Too many arguments`. - `Too many arguments`.
## Output: ### Output:
```console ```console
student@ubuntu:~/student/test$ go build student@ubuntu:~/student/test$ go build

6
subjects/displayz.md

@ -1,13 +1,13 @@
# displayz ## displayz
## 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. If there are no 'a' characters in the encounters in it, followed by a newline. If there are no 'a' characters in the
string, the program just writes a newline. If the number of parameters is not string, the program just writes a newline. If the number of parameters is not
1, the program displays 'a' followed by a newline. 1, the program displays 'a' followed by a newline.
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

8
subjects/enigma.md

@ -1,5 +1,5 @@
# enigma ## enigma
## Instructions ### Instructions
Write a function called `Enigma` that receives poiters to functions and move its values around to hide them Write a function called `Enigma` that receives poiters to functions and move its values around to hide them
@ -7,7 +7,7 @@ This function will put a into c; c into d; d into b and b into a
This function must have the following signature. This function must have the following signature.
## Expected function ### Expected function
```go ```go
func Enigma(a ***int, b *int, c *******int, d ****int) { func Enigma(a ***int, b *int, c *******int, d ****int) {
@ -16,7 +16,7 @@ func Enigma(a ***int, b *int, c *******int, d ****int) {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

6
subjects/firstword.md

@ -1,6 +1,6 @@
# firstword ## firstword
## Instructions ### Instructions
Write a program that takes a string and displays its first word, followed by a newline. Write a program that takes a string and displays its first word, followed by a newline.
@ -10,7 +10,7 @@ Write a program that takes a string and displays its first word, followed by a n
- If the number of parameters is not 1, or if there are no words, simply display a newline. - If the number of parameters is not 1, or if there are no words, simply display a newline.
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

8
subjects/fixthemain.md

@ -1,10 +1,10 @@
# Fix the Main ## Fix the Main
## Instructions ### Instructions
Write and fix the folloing functions. Write and fix the folloing functions.
## Expected functions ### Expected functions
```go ```go
func PutStr(str string) { func PutStr(str string) {
@ -29,7 +29,7 @@ func IsDoorClose(ptrDoor *Door) bool {
PutStr("Door is close ?") PutStr("Door is close ?")
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/hello.md

@ -1,12 +1,12 @@
# hello ## hello
## Instructions ### Instructions
Write a program that displays "Hello World!". Write a program that displays "Hello World!".
## Expected main and function for the program ### Expected main and function for the program
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

6
subjects/inter.md

@ -1,6 +1,6 @@
# switchcase ## switchcase
## Instructions ### Instructions
Write a program that takes two strings and displays, without doubles, the characters that appear in both strings, in the order they appear in the first one. Write a program that takes two strings and displays, without doubles, the characters that appear in both strings, in the order they appear in the first one.
@ -9,7 +9,7 @@ Write a program that takes two strings and displays, without doubles, the charac
- If the number of arguments is not 2, the program displays `\n`. - If the number of arguments is not 2, the program displays `\n`.
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

8
subjects/join.md

@ -1,11 +1,11 @@
# join ## join
## Instructions ### Instructions
Write a function, Join, that returns the elements of a slice strings (arstr) join together in one string. Using the string 'sep' as a separator between each element of the array Write a function, Join, that returns the elements of a slice strings (arstr) join together in one string. Using the string 'sep' as a separator between each element of the array
The function must have the next signature. The function must have the next signature.
## Expected function ### Expected function
```go ```go
@ -15,7 +15,7 @@ func Join(arstr []string, sep string) string {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

4
subjects/lastword.md

@ -1,5 +1,5 @@
# lastword ## lastword
## Instructions ### Instructions
Write a program that takes a string and displays its last word, followed by a Write a program that takes a string and displays its last word, followed by a
newline. newline.

8
subjects/listat.md

@ -1,12 +1,12 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListAt` that haves one pointer to the list, `l`, and an `int` as parameters. This function should print a `Node` of the linked list, depending on the number, `nbr`. Write a function `ListAt` that haves one pointer to the list, `l`, and an `int` as parameters. This function should print a `Node` of the linked list, depending on the number, `nbr`.
- In case of error it should print `nil` - In case of error it should print `nil`
## Expected function and structure ### Expected function and structure
```go ```go
type Node struct { type Node struct {
@ -20,7 +20,7 @@ func ListAt(l *Node, nbr int) *Node{
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listclear.md

@ -1,12 +1,12 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListClear` that delets all `nodes` from a linked list, deleting the link between the list. Write a function `ListClear` that delets all `nodes` from a linked list, deleting the link between the list.
- Tip: assign the list's pointer to nil - Tip: assign the list's pointer to nil
## Expected function and structure ### Expected function and structure
```go ```go
type Node struct { type Node struct {
@ -24,7 +24,7 @@ func ListClear(l *List) {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listfind.md

@ -1,6 +1,6 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListFind` that returns the value of the first link that the function in the arguments its equal. Write a function `ListFind` that returns the value of the first link that the function in the arguments its equal.
@ -8,7 +8,7 @@ Write a function `ListFind` that returns the value of the first link that the fu
- Use pointers when ever you can. - Use pointers when ever you can.
## Expected function and structure ### Expected function and structure
```go ```go
type Node struct { type Node struct {
@ -30,7 +30,7 @@ func ListFind(l *List, comp func(l *List) bool) *interface{} {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listforeach.md

@ -1,12 +1,12 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListForEach` that applies a function given as argument to the information within each of the list's links. Write a function `ListForEach` that applies a function given as argument to the information within each of the list's links.
- The function given as argument must have a pointer as argument: `l *list` - The function given as argument must have a pointer as argument: `l *list`
## Expected function and structure ### Expected function and structure
```go ```go
type Node struct { type Node struct {
@ -23,7 +23,7 @@ func ListForEach(l *list, f func(l *list)) {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listforeachif.md

@ -1,6 +1,6 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListForEachIf` that applies a function given as argument to the information within some links of the list. Write a function `ListForEachIf` that applies a function given as argument to the information within some links of the list.
@ -10,7 +10,7 @@ Write a function `ListForEachIf` that applies a function given as argument to th
- Use pointers wen ever you can. - Use pointers wen ever you can.
## Expected function and structure ### Expected function and structure
```go ```go
type node struct { type node struct {
@ -32,7 +32,7 @@ func ListForEachIf(l *list, f func(l *list), comp func(l *list) bool) {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listlast.md

@ -1,10 +1,10 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListLast` that returns the last element of the linked list. Write a function `ListLast` that returns the last element of the linked list.
## Expected function and structure ### Expected function and structure
```go ```go
type Node struct { type Node struct {
@ -21,7 +21,7 @@ func ListLast(l *list) *list {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listmerge.md

@ -1,6 +1,6 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListMerge` that places elements of a list `l2` at the end of an other list `l1`. Write a function `ListMerge` that places elements of a list `l2` at the end of an other list `l1`.
@ -8,7 +8,7 @@ Write a function `ListMerge` that places elements of a list `l2` at the end of a
- Use pointers when ever you can. - Use pointers when ever you can.
## Expected function and structure ### Expected function and structure
```go ```go
type NodeL struct { type NodeL struct {
@ -26,7 +26,7 @@ func listMerge(l1 *List, l2 *List) {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listpushback.md

@ -1,10 +1,10 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListPushBack` that inserts a new element `Node` at the end of the list, using the structure `List` Write a function `ListPushBack` that inserts a new element `Node` at the end of the list, using the structure `List`
## Expected function and structure ### Expected function and structure
```go ```go
type Node struct { type Node struct {
@ -21,7 +21,7 @@ func ListPushBack(l *List, data interface{}) {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listpushfront.md

@ -1,10 +1,10 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListPushBack` that inserts a new element `node` at the beginning of the list using `list` Write a function `ListPushBack` that inserts a new element `node` at the beginning of the list using `list`
## Expected function and structure ### Expected function and structure
```go ```go
type Node struct { type Node struct {
@ -21,7 +21,7 @@ func ListPushFront(l *list, data interface{}) {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

4
subjects/listpushpara.md

@ -1,6 +1,6 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a program that creates a new linked list and includes each command-line argument in to the list. Write a program that creates a new linked list and includes each command-line argument in to the list.

8
subjects/listremoveif.md

@ -1,13 +1,13 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListRemoveIf` that removes all elements that are equal to the `data_ref` introduced in the argument of the function. Write a function `ListRemoveIf` that removes all elements that are equal to the `data_ref` introduced in the argument of the function.
- Use pointers wen ever you can. - Use pointers wen ever you can.
## Expected function and structure ### Expected function and structure
```go ```go
type NodeL struct { type NodeL struct {
@ -25,7 +25,7 @@ func ListPushFront(l *List, data interface{}) {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listreverse.md

@ -1,12 +1,12 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListReverse` that reverses the elements order of a given linked list. Write a function `ListReverse` that reverses the elements order of a given linked list.
- Use pointers when ever you can - Use pointers when ever you can
## Expected function and structure ### Expected function and structure
```go ```go
type Node struct { type Node struct {
@ -23,7 +23,7 @@ func ListReverse(l *list) {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listsize.md

@ -1,10 +1,10 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListSize` that returns the number of elements in the list. Write a function `ListSize` that returns the number of elements in the list.
## Expected function and structure ### Expected function and structure
```go ```go
type Node struct { type Node struct {
@ -22,7 +22,7 @@ func ListSize(l *List) int {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/listsort.md

@ -1,6 +1,6 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `ListSort` that sorts the linked list by ascending order. Write a function `ListSort` that sorts the linked list by ascending order.
@ -10,7 +10,7 @@ Write a function `ListSort` that sorts the linked list by ascending order.
- Use pointers when ever you can. - Use pointers when ever you can.
## Expected function and structure ### Expected function and structure
```go ```go
type Nodee struct { type Nodee struct {
@ -23,7 +23,7 @@ func ListSort(l *NodeL) *NodeL {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/max.md

@ -1,11 +1,11 @@
# max ## max
## 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
The function must have the next signature. The function must have the next signature.
## Expected function ### Expected function
```go ```go
@ -15,7 +15,7 @@ func Max(arr []int) int {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

4
subjects/onlya.md

@ -1,5 +1,5 @@
# onlya ## onlya
## Instructions ### Instructions
Write a program that displays a 'a' character on the standard output. Write a program that displays a 'a' character on the standard output.

4
subjects/onlyz.md

@ -1,4 +1,4 @@
# displayalpham ## displayalpham
## Instructions ### Instructions
Write a program that displays a 'z' character on the standard output. Write a program that displays a 'z' character on the standard output.

6
subjects/pilot.md

@ -1,9 +1,9 @@
# pilot ## pilot
## Instructions ### Instructions
Write a go file so that the following program compile Write a go file so that the following program compile
## Usage ### Usage
```go ```go
package main package main

4
subjects/point.md

@ -1,6 +1,6 @@
# Point # Point
## Instructions ### Instructions
Create a `.go` file and copy the code below into our file Create a `.go` file and copy the code below into our file
@ -24,7 +24,7 @@ func main() {
} }
``` ```
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

8
subjects/rectangle.md

@ -1,6 +1,6 @@
# Rectangle ## Rectangle
## 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.
@ -17,7 +17,7 @@ is defined by the points of the upper left and lower right corners.
- And calculates and prints the area of that rectangle you define. - And calculates and prints the area of that rectangle you define.
## Expected main and function for the program ### Expected main and function for the program
```go ```go
func defineRectangle(ptr *point, n int) *rectangle { func defineRectangle(ptr *point, n int) *rectangle {
@ -46,7 +46,7 @@ func main() {
``` ```
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

4
subjects/repeatalpha.md

@ -1,5 +1,5 @@
# repeatalpha ## repeatalpha
## Instructions ### Instructions
Write a program called repeat_alpha that takes a string and display it Write a program called repeat_alpha that takes a string and display it
repeating each alphabetical character as many times as its alphabetical index, repeating each alphabetical character as many times as its alphabetical index,

4
subjects/reversebits.md

@ -1,5 +1,5 @@
# reversebits ## reversebits
## Instructions ### Instructions
Write a function that takes a byte, reverses it, bit by bit (like the Write a function that takes a byte, reverses it, bit by bit (like the
example) and returns the result. example) and returns the result.

6
subjects/rot13.md

@ -1,6 +1,6 @@
# rot13 ## rot13
## Instructions ### Instructions
Write a program that takes a string and displays it, replacing each of its Write a program that takes a string and displays it, replacing each of its
letters by the letter 13 spaces ahead in alphabetical order. letters by the letter 13 spaces ahead in alphabetical order.
@ -11,7 +11,7 @@ letters by the letter 13 spaces ahead in alphabetical order.
- If the number of arguments is not 1, the program displays a newline. - If the number of arguments is not 1, the program displays a newline.
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

8
subjects/rot14.md

@ -1,19 +1,19 @@
# ROT 14 ## ROT 14
## Instructions ### Instructions
Write a function `rot14` that returns the string within the parameter but transformed into a rot14 string. Write a function `rot14` that returns the string within the parameter but transformed into a rot14 string.
- If you not certain what we are talking about, there is a rot13 already. - If you not certain what we are talking about, there is a rot13 already.
## Expected function ### Expected function
```go ```go
func rot14(str string) string { func rot14(str string) string {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

6
subjects/searchreplace.md

@ -1,6 +1,6 @@
# searchreplace ## searchreplace
## Instructions ### Instructions
Write a program that takes 3 arguments, the first arguments is a string in which to replace a letter (2nd argument) by another one (3rd argument). Write a program that takes 3 arguments, the first arguments is a string in which to replace a letter (2nd argument) by another one (3rd argument).
@ -8,7 +8,7 @@ Write a program that takes 3 arguments, the first arguments is a string in whic
- If the second argument is not contained in the first one (the string) then the program simply rewrites the string followed by a newline. - If the second argument is not contained in the first one (the string) then the program simply rewrites the string followed by a newline.
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

8
subjects/sortedlistmerge.md

@ -1,6 +1,6 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `SortedListMerge` that mereges two lists, `l1` and `l2`, but you have to join them in ascending order. Write a function `SortedListMerge` that mereges two lists, `l1` and `l2`, but you have to join them in ascending order.
@ -8,7 +8,7 @@ Write a function `SortedListMerge` that mereges two lists, `l1` and `l2`, but yo
- Use pointers when ever you can. - Use pointers when ever you can.
## Expected function and structure ### Expected function and structure
```go ```go
type Nodee struct { type Nodee struct {
@ -21,7 +21,7 @@ func SortedListMerge(l1 *Nodee, l2 *Nodee) *Nodee {
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

8
subjects/sortlistinsert.md

@ -1,6 +1,6 @@
# listpushback ## listpushback
## Instructions ### Instructions
Write a function `SortListInsert` that inserts `Data_ref` in the linked list, but it as to remain sorted in ascending order. Write a function `SortListInsert` that inserts `Data_ref` in the linked list, but it as to remain sorted in ascending order.
@ -8,7 +8,7 @@ Write a function `SortListInsert` that inserts `Data_ref` in the linked list, bu
- Use pointers when ever you can. - Use pointers when ever you can.
## Expected function and structure ### Expected function and structure
```go ```go
type Nodee struct { type Nodee struct {
@ -21,7 +21,7 @@ func SortListInsert(l *Nodee, Data_ref int) *Nodee{
} }
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

6
subjects/strlen.md

@ -1,12 +1,12 @@
# strlen ## strlen
## Instructions ### Instructions
Write a function that returns the length of a string. Write a function that returns the length of a string.
- `len` is forbidden - `len` is forbidden
## Expected function and structure ### Expected function and structure
```go ```go
func Strlen(str string) int { func Strlen(str string) int {

4
subjects/swapbits.md

@ -1,5 +1,5 @@
# swapbits ## swapbits
## Instructions ### Instructions
Write a function that takes a byte, swaps its halves (like the example) and Write a function that takes a byte, swaps its halves (like the example) and
returns the result. returns the result.

6
subjects/switchcase.md

@ -1,6 +1,6 @@
# switchcase ## switchcase
## Instructions ### Instructions
Write a program that takes a string and reverses the case of all its letters. Write a program that takes a string and reverses the case of all its letters.
@ -10,7 +10,7 @@ Write a program that takes a string and reverses the case of all its letters.
- If the number of arguments is not 1, the program displays '\n'. - If the number of arguments is not 1, the program displays '\n'.
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

4
subjects/union.md

@ -1,5 +1,5 @@
# union ## union
## Instructions ### Instructions
Write a program that takes two strings and displays, without doubles, the Write a program that takes two strings and displays, without doubles, the
characters that appear in either one of the strings. characters that appear in either one of the strings.

8
subjects/unmatch.md

@ -1,11 +1,11 @@
# join ## join
## Instructions ### Instructions
Write a function, Unmatch, that returns the element of the slice (arr) that does not have a correspondent pair. Write a function, Unmatch, that returns the element of the slice (arr) that does not have a correspondent pair.
The function must have the next signature. The function must have the next signature.
## Expected function ### Expected function
```go ```go
@ -15,7 +15,7 @@ func Unmatch(arr []int) int {
``` ```
## Usage ### Usage
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :

6
subjects/wdmatch.md

@ -1,6 +1,6 @@
# switchcase ## switchcase
## Instructions ### Instructions
Write a program that takes two strings and checks whether it's possible to write the first string with characters from the second string, while respecting the order in which these characters appear in the second string. Write a program that takes two strings and checks whether it's possible to write the first string with characters from the second string, while respecting the order in which these characters appear in the second string.
@ -9,7 +9,7 @@ Write a program that takes two strings and checks whether it's possible to write
- If the number of arguments is not 2, the program displays `\n`. - If the number of arguments is not 2, the program displays `\n`.
## Expected output ### Expected output
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

4
subjects/ztail.md

@ -1,5 +1,5 @@
# ztail ## ztail
## Instructions ### Instructions
Write a program called ztail that does the same thing as the system command tail, but witch takes at least one file as argument. Write a program called ztail that does the same thing as the system command tail, but witch takes at least one file as argument.

Loading…
Cancel
Save