TryRuby icon indicating copy to clipboard operation
TryRuby copied to clipboard

Example code is incorrect in lesson 40

Open skylarmacdonald opened this issue 5 years ago • 1 comments

https://github.com/ruby/TryRuby/blob/84ec432786e9f38dc27477f974583d6a7710be30/source/try_ruby_en.json#L41

The text in this lesson is asking the user to find the number of plays Shakespeare wrote in 1591 using the count_plays method, but in the example code, count_plays is called with a year value of 0. As a result the code errors if not modified.

The last line of the example code should read as follows:

puts count_plays(1591)

If nobody else beats me to it, I'll gladly open a PR for this when I have a bit more time.

skylarmacdonald avatar Jul 22 '20 03:07 skylarmacdonald

Thanks for your remark. The example code shows a zero on purpose, so the user has to do a bit of typing him- or herself. Most of the lessons do indeed have example code that works straight away. Some lessons the user has to change a few lines of code. This is meant to keep tryruby (absolute) beginner friendly.

easydatawarehousing avatar Jul 22 '20 07:07 easydatawarehousing