une suite d instructions executees dans un ordre clair.
atelier
Ruby
parcours pratique pour apprendre Ruby depuis zero
definition d abord
ce que signifie Ruby
Ruby sert a ecrire des instructions precises. Ici tu l abordes comme parcours pratique pour apprendre Ruby depuis zero. Commence par une idee simple: des entrees passent par des etapes et deviennent une sortie.
app.rbexecuter ruby app.rbhabitude apprends une petite piece de Ruby, tape un exemple minimal et execute-leune valeur est une donnee. Une variable est le nom qui la garde.
un petit travail nomme qui recoit une entree et produit un resultat.
Ruby execute le code de app.rb.
premier code lisible
sortie du programme
entry point output syntax putsputs 42
sortie 42lignee du langage
arbre de Ruby
vois d ou vient Ruby, quels langages sont proches, et quoi apprendre ensuite.
utile pour parcours pratique pour apprendre Ruby depuis zero
parcours debutant
Banque de questions
Chercher puis pratiquer
Choisis une etape ou cherche dans la banque de ce langage puis ouvre l exercice.
Ruby question 1
Ruby question 1. Choisis l explication qui correspond le mieux a afficher une valeur.
Ruby question 2
Ruby question 2. Choisis l explication qui correspond le mieux a nommer une valeur.
Ruby question 3
Ruby question 3. Choisis l explication qui correspond le mieux a fonction reutilisable.
Ruby question 4
Ruby question 4. Choisis l explication qui correspond le mieux a collection de base.
Ruby question 5
Ruby question 5. Choisis l explication qui correspond le mieux a afficher une valeur.
Ruby question 6
Ruby question 6. Choisis l explication qui correspond le mieux a nommer une valeur.
Ruby question 7
Ruby question 7. Choisis l explication qui correspond le mieux a fonction reutilisable.
Ruby question 8
Ruby question 8. Choisis l explication qui correspond le mieux a collection de base.
Ruby question 9
Ruby question 9. Choisis l explication qui correspond le mieux a afficher une valeur.
Ruby question 10
Ruby question 10. Choisis l explication qui correspond le mieux a nommer une valeur.
Ruby question 11
Ruby question 11. Choisis l explication qui correspond le mieux a fonction reutilisable.
Ruby question 12
Ruby question 12. Choisis l explication qui correspond le mieux a collection de base.
Ruby question 13
Ruby question 13. Choisis l explication qui correspond le mieux a afficher une valeur.
Ruby question 14
Ruby question 14. Choisis l explication qui correspond le mieux a nommer une valeur.
Ruby question 15
Ruby question 15. Choisis l explication qui correspond le mieux a fonction reutilisable.
Ruby question 16
Ruby question 16. Choisis l explication qui correspond le mieux a collection de base.
Ruby question 17
Ruby question 17. Choisis l explication qui correspond le mieux a afficher une valeur.
Ruby question 18
Ruby question 18. Choisis l explication qui correspond le mieux a nommer une valeur.
choix multiple
Ruby question 1
Ruby question 1. Choisis l explication qui correspond le mieux a afficher une valeur.
puts 42
reference
modeles pour app.rb
ruby app.rbentry point output syntax puts
sortie du programme
puts 42
- Run the smallest file first
- Print one known value
- Check the output before adding more code
variables assignment types =
valeurs et noms
total = 42 puts total
- Give values readable names
- Keep one idea per line while learning
- Trace the value before changing it
function collection Array
fonctions et collections
def add(a, b) a + b end scores = [40, 2] puts scores.length
- Keep functions small
- Return useful values
- Use the common collection before reaching for frameworks