[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
print "What is your favorite color?" color = gets.chomp
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 11
Thread images: 2
File: 71vx9Poj60L._UY679_.jpg (22 KB, 307x679) Image search: [Google]
71vx9Poj60L._UY679_.jpg
22 KB, 307x679
print "What is your favorite color?"
color = gets.chomp
color.downcase

if color == "green" || "orange"
puts "{#color} is my favorite color too!"
elsif color == "blue"
puts "#{color} is ok"
else
puts "I do not know that color"
end


Why can't you use || on strings?
>>
>>53574889
I noticed my typo in the if section
>>
>>53574889
>if color == "green" || color == "orange"
>>
>>53574958
omfg thank you so much
im a noob
>>
That's some shit tier taste in colors you got there, bud.
>>
>>53575248
green master race
>>
File: 4L_tymwPrjy.jpg (76 KB, 594x456) Image search: [Google]
4L_tymwPrjy.jpg
76 KB, 594x456
>>53574889
>i hope you have a Code OfConduct for your ruby project anon
>i wouldn't want to have to report you as a rapist sex offender but i will if you are excluding womyn and black trans from participating in your project
>>
>>53574889
does color.downcase work? I think if you want to actually change color, you need to do
color = color.downcase
or
color.downcase!
>>
>>53574889
>two favorite colors
>green AND orange

sup pajeet
>>
>>53575896
Lmao
>>
>>53574966
Fuck you Karlie Kloss
Thread replies: 11
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.