From zero to your first real Ruby programs. Every new word explained, every example runnable, one idea per lesson.
- 28 lessons
- 7 units
- 3 h 28 m in all
- £0, for good
what’s inside.
For people who have never written a line of code. Nothing is assumed: every new word is explained the moment it appears.
Ruby Level 1 assumes nothing. In 28 short lessons you go from what code is to writing your own methods, with a guess, a hands-on task and a fix-the-bug challenge in every lesson. It ends with a level check: a quiz game you build yourself and answer with `gets`.
every lesson goes the same way.
- meet it
- guess first
- your turn
- fix it
- nailed it
unit 1
Say hello
Make the computer do exactly what you tell it.
- What code really is5 minFind out what code is and run your very first program.
- Your first line6 minMake the computer show any message you like.
- Lines, print and puts7 minShow several lines, keep words together and make blank lines.
- When it goes wrong8 minRead error messages and fix the ones you will see most.
unit 2
Boxes with names
Make the computer remember things.
- A variable is a labelled box7 minStore a value under a name and get it back whenever you like.
- Boxes can change8 minSwap what is in a box, copy it and join strings together.
- Good names, bad names7 minPick names Ruby accepts and that tell you what is inside.
- Asking a question8 minAsk the person a question and use their answer.
unit 3
Words and numbers
Tell text and numbers apart and use both.
- Text vs numbers7 minSpot the difference between a number and a string that looks like one.
- Doing maths8 minAdd, take away, multiply and divide, and find what is left over.
- Tricks with text7 minCount, shout, whisper, trim and swap the letters in a string.
- Putting values inside text8 minDrop any value into a string and turn text into numbers.
unit 4
Make decisions
Make your program choose what to do.
unit 5
Repeat yourself
Do the same thing many times without copying.
unit 6
Arrays
Keep many things together and work through them.
- Making an array6 minKeep a whole list of values together in one variable.
- Reading and changing items9 minGrab any item by its number, swap it or add a new one.
- Looping over an array8 minVisit every item in turn and add them all up.
- Searching an array8 minAsk what is inside, add it all up and find the biggest.
unit 7
Your own methods
Wrap code up so you can use it again.
- Making a method7 minWrap lines of code under one name and run them whenever you like.
- Giving it information7 minHand your method a value so it can do something new each time.
- Getting an answer back7 minMake a method hand you a result you can keep and use.
- Putting it all together9 minBuild a small program from methods, arrays, loops and decisions.