Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions translations/en/try_ruby_160.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
lang: EN
title: Saved, Tucked Away
lang: EN
title: Saved, Tucked Away
answer: \[12, 35, 47\]
load: ticket = [12, 47, 35]
ok: You've sorted the list
error:
load: ticket = [12, 47, 35]
ok: You've sorted the list
error:
---

You've hung on to your lotto numbers, tucking them away inside a __variable__ called ticket.
You've hung on to your lotto numbers, tucking them away inside a **variable** called ticket.
But any other name, like _jimmyslist_, would have been fine too.

Programming, you will discover, is mostly about working with variables.

Let's put your lotto numbers in order, how about?

Use:
Use:

ticket.sort!

You had a list. You sorted the list. The ticket variable is now changed.
Did you notice that the _sort!_ method has a big, bright exclamation at the end?
A lot of times Ruby methods shout like that if they alter the variable for good.
It's nothin special, just a mark.
It's nothing special, just a mark.
12 changes: 6 additions & 6 deletions translations/en/try_ruby_190.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
lang: EN
title: Sadly, You Hate Toast Poetry
lang: EN
title: Sadly, You Hate Toast Poetry
answer: (toast){0}
load: prev
ok: Excellent
error: Still smells like toast to me
load: prev
ok: Excellent
error: Still smells like toast to me
---

Look, it's okay. You don't have to like it. Hack it up, be my guest. Instead of toast, go for a
melon or something. Try this to see the new poem:

poem.gsub("toast", "honeydew")

The __gsub__ method is short for global substitute. It replaces all occurences of "toast" with
The **gsub** method is short for global substitute. It replaces all occurrences of "toast" with
"honeydew".
14 changes: 7 additions & 7 deletions translations/en/try_ruby_440.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
lang: EN
title: Me hungry
lang: EN
title: Me hungry
answer: ^Me not hungry
ok: Yes
error: No way am I hungry at 10 AM!
ok: Yes
error: No way am I hungry at 10 AM!
---

Okay, this is coming along wonderfully. This is simple stuff for you, but keep in mind that you
didn't know __any Ruby whatsoever__ just fifteen minutes ago!
didn't know **any Ruby whatsoever** just fifteen minutes ago!

Last step. Let's tie it all together, you know? Let's make it chime together like a very nice set
of glistening chimes on the beach in the maginificent sunlight!
of glistening chimes on the beach in the magnificent sunlight!

We'll define two methods first and then take a decision:

Expand All @@ -27,5 +27,5 @@ We'll define two methods first and then take a decision:

eat_an 'apple' if hungry?(10)

Now see if you can change the method __hungry?__ to display __"Me not hungry"__ and returning false
Now see if you can change the method **hungry?** to display **"Me not hungry"** and returning false
when the time is less than 12.