Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialColeman Kelly
889 PointsWrite the Ruby code to check if the variable named current_score is greater than the variable named high_score.
I'm not sure I understand this problem. This challenge immediately follows a lesson where Jason uses irb to compare variables.
In irb, you could just write:
current_score = 5 high_score = 10
current_score > high score
And it would return false. That isn't working in the shell. I'm obviously doing something wrong, but what is it?
5 Answers
Salman Akram
Courses Plus Student 40,065 PointsYes, it looks perfect but that quiz question didn't ask to add extra codes like you did put first and second lines, only they need third lines. :)
Salman Akram
Courses Plus Student 40,065 PointsHi Coleman,
Great start, you may notice that your misspelling for high score without underscore in second line.
Only you can create comparison operator between two variables, see below.
current_score > high_score
Hope that helps.
-Salman
Coleman Kelly
889 PointsHey Salman,
Thanks for you response! In the actual challenge I have it spelled correctly and it still does not work. It tells me that I need to check the spelling of my variables, but they are spelled correctly. Any ideas?
Tania Dimache
1,051 PointsHey Salman,
I have a question: why I can't use double quotation marks in the shell? In irb this is how you compared the 2 variables "treehouse" > "tania"
Thanks!
Salman Akram
Courses Plus Student 40,065 PointsHmmm, okay. Did you remove first line (current_score = 5 high_score = 10)? And then make sure high score should be like high_score.
Coleman Kelly
889 Pointsthis is what my code looks like:
current_score = 5
high_score = 10
current_score > high_score
Nick Vitsinsky
7,246 Pointsyou only need
current_score > high_score
without
current_score = 5
high_score = 10
Ismael Soumahoro
6,410 PointsI am confused why does my challenge task text editor say shell with no .rb at the end can someone please help
Coleman Kelly
889 PointsColeman Kelly
889 PointsThanks, that solved the issue! Thinking a little too far ahead apparently!