Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Code Golf: What (RGB) Color is the Dress?

DZone's Guide to

Code Golf: What (RGB) Color is the Dress?

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

Editor's Note: The dress is clearly Black (0, 0, 0) and Blue (0, 0, 255)

When it comes to ingenuity, Code Golf is my absolute favorite thing in the developer space. Code Golf, like the game of golf, is an exercise in brevity - the fewest lines of code and the smaller the file size, the better. It requires creativity, knowledge of your craft, and perseverance.

So in order to showcase the brightest members of our community, DZone will be holding a weekly Code Golf competition.

What's in it for you? The winner every week will receive some awesome DZone swag!

In order to submit your entry, you'll need to leave a comment with your code (using the code feature), as well as what language you used. Your code must be completely self-contained (don't reference code external to your own!).

So, let's get started!

This week's challenge:

You'll need to create a program that can take 3 numerical inputs (between 0-255) and output the RGB color. Your output should look something like this:

INPUT:
0   255   0

OUTPUT:
Green

or

INPUT:
128   0   128

OUTPUT:
Purple

The code with the fewest characters (excluding whitespace) will be the winner! You must submit your code by Tuesday, March 10th. The winner will be announced in our Newsletter!

Sound like something you can handle? We'd like to see you try.

Happy coding!


Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}