learn-co-curriculum / countdown-to-midnight Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
The tests in the hello_spec.rb file for this lesson do not match the content of the lesson itself.
Specifically, the lesson says this:
But the hello_spec.rb file that is used to test the lesson contains 3 different tests that do not appear to be mentioned anywhere in the lesson:
Another student was able to share the hello_spec.rb file that was included when he did the lesson and updating mine to match that one was enough to get the lesson to pass, but I believe either the lesson or the test file should be updated.
I noticed on several occasions to get help it mentions to use google or in this case sends you to stack overflow. That's how I usually would find out my answers as well but I wouldn't always remember or actually learn it. I think many newbies (myself included) don't know how to read the documentation and if they did, they would be able to learn how to find it and learn it without relying on someone elses answers. For example in this case the "Hint" could take them to: http://ruby-doc.org/core-1.8.7/Kernel.html#method-i-sleep
Or maybe add a section at the beginning of RUBY on how to read the docs to find what your looking for. As newbies, the documentation always seems intimidating. Just my 2 cents.
Loving the course and appreciate it very much!
This lab was useful as a practice in a countdown/subtraction scenario as well as an introduction to the sleep
method.
However I don't think that making us create the new method countdown_with_sleep
that accepts an argument of at least 5 seconds was the best way of achieving this. I passed the learn
test with the following code:
def countdown_with_sleep(x)
sleep x
end
def countdown(number)
while number > 0
puts "#{number} SECOND(S)!"
number -= 1
end
return "HAPPY NEW YEAR!"
end
I think that students should have been instructed to code as follows:
def countdown(number)
while number > 0
puts "#{number} SECOND(S)!"
number -= 1
sleep 1
end
return "HAPPY NEW YEAR!"
end
While it may be confusing at first for students who are just being introduced to Ruby I think that this approach, doing away with an extra method and inserting the sleep program into the countdown(number)
method itself, is more in keeping with the overarching point of readability and near intuitive nature of reading Ruby code. We've already been introduced to gets.chomp
this cool extra function, sleep
doesn't seem like too much of a burden content-wise this unit.
Furthermore it achieves the true spirit of the instruction that reads (in #4):
"Our Ruby program executes so quickly that is doesn't actually count down at the speed of one per second per number. See if you can make the loop pause for one second each trip around(hint)"
Mac OS 10.12.6, I installed everything according to flatiron schools 'manual setup', but when I start the terminal, I get an error of 'Could not source '/Users/robertpeck/.rvm/scripts/version' as file does not exist. RVM will likely not work as expected.'
Plus, when I create files from the terminal ('touch math.rb', 'atom math.rb', the entire program, written in the Learn IDE is 'puts 1 + 2'), typing 'ruby math.rb' in the terminal outputs nothing.
I'm sure its a simple fix, but I don't know how to fix it. Help!
remove tags, add obejctives
make instructions more explicity
add subheadings
Note from student
These tests don't really exercise what the code should be doing. We can do better by looking at standard out for certain messages.
You can pass these tests with
def countdown(count)
"0 left. HAPPY NEW YEAR!"
end
the instructions say to countdown to 0. But the Learn test wants you to stop at 1.
Hi! I defined in my file method countdown(number) and method has a loop inside. I"m trying to debug it with irb and it gives me a flowing error.
2.3.1 :001 > help
Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.
countdown(7)
Nothing known about .countdown(7)
This lesson was confusing, and felt like an unnecessary trick question. It doesn't make sense to count down to "Happy New Year", but then NOT output "Happy New Year!" Everything in my codes was working except "return" instead of "puts", and I spent an hour trying to get them to pass the test.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.