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 trial

Ruby Ruby Operators and Control Structures Ruby Operators Greater Than

Write 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

Yes, 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. :)

Thanks, that solved the issue! Thinking a little too far ahead apparently!

Hi 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

Hey 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
Tania Dimache
1,051 Points

Hey 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!

Hmmm, okay. Did you remove first line (current_score = 5 high_score = 10)? And then make sure high score should be like high_score.

this is what my code looks like:

current_score = 5
high_score = 10

current_score > high_score
Nick Vitsinsky
Nick Vitsinsky
7,246 Points

you only need

current_score > high_score

without

current_score = 5
high_score = 10

I am confused why does my challenge task text editor say shell with no .rb at the end can someone please help