Sophrinix / TryRuby

Try Ruby is a interactive shell that quickly and whimsically teaches the Ruby programming language. Originally _why's idea, it has been recreated from the ground up by Rubyists who have a passion for Ruby and for teaching their fellow (wo)man how to program.
tryruby.org
345 stars 80 forks source link

"cumslut"!?! #95

Closed hereticdave closed 13 years ago

hereticdave commented 13 years ago

Interesting feature you have..."Planting our flag on Cumslut's
comet, " !?!

Apparently "poem['toast'] = 'honeydew' has some hidden functionality. Full text of tutorial thus far, this also shows the problem with print poem not proceeding the tutorial. Printscreen available if you want it.

2+6
=> 8
40/4
=> 10
"Dave"
=> "Dave"
"Dave".reverse
=> "evaD"
"Dave".length
=> 4
"Dave"_5
.. reset
=> nil
"dave"_5
=> "davedavedavedavedave"
40.reverse
NoMethodError: undefined method `reverse' for 40:Fixnum
40.to_s.reverse
=> "04"
[]
=> []
[12,47,35]
=> [12, 47, 35]
[12,47,35].max
=> 47
ticket = [12,47,35]
=> [12, 47, 35]
ticket
=> [12, 47, 35]
ticket.sort!
=> [12, 35, 47]
print poem
My honeydew has flown from my hand
And my honeydew has gone to the
moon.
But when I saw it on television,
Planting our flag on Halley's
comet,
More still did I want to eat it.
=> nil

reset
=> nil
print poem
My honeydew has flown from my hand
And my honeydew has gone to the
moon.
But when I saw it on television,
Planting our flag on Halley's
comet,
More still did I want to eat it.
=> nil
reset
=> nil
print poem
My honeydew has flown from my hand
And my honeydew has gone to the
moon.
But when I saw it on television,
Planting our flag on Halley's
comet,
More still did I want to eat it.
=> nil
poem.reverse
=> "\n.ti tae ot tnaw I did llits eroM\n,temoc\ns'yellaH no galf ruo gni tnalP\n,noisivelet no ti was I nehw tuB\n.noom\neht ot enog sah wedyenoh ym dnA\ndnah ym morf nwolf sah wedyenoh yM"
print poem
My honeydew has flown from my hand
And my honeydew has gone to the
moon.
But when I saw it on television,
Planting our flag on Halley's
comet,
More still did I want to eat it.
=> nil
poem.reverse!
=> "\n.ti tae ot tnaw I did llits eroM\n,temoc\ns'yellaH no galf ruo gni tnalP\n,noisivelet no ti was I nehw tuB\n.noom\neht ot enog sah wedyenoh ym dnA\ndnah ym morf nwolf sah wedyenoh yM"
print poem

.ti tae ot tnaw I did llits eroM
,temoc
s'yellaH no galf ruo gnitnalP
,noisivelet no ti was I nehw tuB
.noom
eht ot enog sah wedyenoh ym dnA
dnah ym morf nwolf sah wedyenoh yM=> nil

poem.reverse!
=> "My honeydew has flown from my hand\nAnd my honeydew has gone to the\ nmoon.\nBut when I saw it on television,\nPlanting our flag on Halley's\ ncomet,\nMore still did I want to eat it.\n"
printpoem
NameError: undefined local variable or method `printpoem' for main:Objec t
print poem
My honeydew has flown from my hand
And my toast has gone to the
moon.
But when I saw it on television,
Planting our flag on Halley's
comet,
More still did I want to eat it.
=> nil
help 2
print poem
My toast has flown from my hand
And my toast has gone to the
moon.
But when I saw it on television,
Planting our flag on Halley's
comet,
More still did I want to eat it.
=> nil
poem['toast'] = 'honeydew'
=> "honeydew"
print poem
My honeydew has flown from my hand
And my toast has gone to the
moon.
But when I saw it on television,
Planting our flag on Cumslut's
comet,
More still did I want to eat it.
=> nil

Sophrinix commented 13 years ago

heh. yeah i had a nasty sesson issue.. fixed