Browse Source

Merge pull request #328 from 01-edu/readmes-fixup

Change splitprog from program to function
content-update
Christopher Fremond 5 years ago committed by GitHub
parent
commit
834e0ddb36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      subjects/atoibaseprog.en.md
  2. 2
      subjects/itoabaseprog.en.md
  3. 33
      subjects/reversebits.en.md
  4. 44
      subjects/reversebits.fr.md
  5. 5
      subjects/splitprog.fr.md

2
subjects/atoibaseprog.en.md

@ -1,6 +1,6 @@
## atoibaseprog ## atoibaseprog
##**WARNING! VERY IMPORTANT!** ## **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: For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:

2
subjects/itoabaseprog.en.md

@ -1,6 +1,6 @@
## itoabase ## itoabase
##**WARNING! VERY IMPORTANT!** ## **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: For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:

33
subjects/reversebits.en.md

@ -18,34 +18,17 @@ Write a function that takes a `byte`, reverses it `bit` by `bit` (as shown in th
### Expected function ### Expected function
```go ```go
func ReverseBits(by byte) byte {
} func ReverseBits(oct byte) byte {
```
### Usage
Here is a possible program to test your function :
```go
package main
import (
"fmt"
)
func main() {
a := byte(0x26)
fmt.Printf("%08b\n", a)
fmt.Printf("%08b\n", ReverseBits(a))
} }
``` ```
and its output : Example:
```console 1 byte
student@ubuntu:~/piscine-go/reversebits$ go build _____________
student@ubuntu:~/piscine-go/reversebits$ ./reversebits 0010 0110
00100110 ||
01100100 \/
student@ubuntu:~/piscine-go/reversebits$ 0110 0100
```

44
subjects/reversebits.fr.md

@ -1,5 +1,16 @@
## reversebits ## reversebits
## **AVERTISSEMENT! TRÈS IMPORTANT!**
Pour cet exercice une fonction sera testée **avec le main de l'examen**. Cependant l'étudiant **doit quand même** rendre un programme structuré:
Cela signifie que:
- Le package doit être nommé `package main`.
- Le code rendu doit avoir une fonction main déclarée(```func main()```) même si elle est vide.
- La fonction main déclarée doit **aussi passer** le `Restrictions Checker`(le testeur de fonctions illégales). Il est conseillé à l'étudiant de rendre une fonction main vide après ses tests finis.
- Toutes les autres régles sont les mêmes que pour un `programme`.
### Instructions ### Instructions
Écrire une fonction qui prend un `byte`, qui l'inverse `bit` par `bit` (comme montré sur l'exemple) et qui retourne le résultat. Écrire une fonction qui prend un `byte`, qui l'inverse `bit` par `bit` (comme montré sur l'exemple) et qui retourne le résultat.
@ -7,34 +18,17 @@
### Fonction attendue ### Fonction attendue
```go ```go
func ReverseBits(by byte) byte { func ReverseBits(oct byte) byte {
} }
```
### Utilisation
Voici un programme possible pour tester votre fonction :
```go
package main
import (
"fmt"
)
func main() {
a := byte(0x26)
fmt.Printf("%08b\n", a)
fmt.Printf("%08b\n", ReverseBits(a))
}
``` ```
et son résultat : Exemple:
```console 1 byte
student@ubuntu:~/piscine-go/reversebits$ go build _____________
student@ubuntu:~/piscine-go/reversebits$ ./reversebits 0010 0110
00100110 ||
01100100 \/
student@ubuntu:~/piscine-go/reversebits$ 0110 0100
```

5
subjects/splitprog.fr.md

@ -26,9 +26,9 @@ func Split(str, charset string) []string {
} }
``` ```
### Usage ### Utilsation
VOici un programm possible pour tester votre fonction : Voici un programme possible pour tester votre fonction :
```go ```go
package main package main
@ -44,6 +44,7 @@ func main() {
} }
``` ```
Et son résultat : Et son résultat :
```console ```console

Loading…
Cancel
Save