Over a million developers have joined DZone.

Code Golf: Word Jumble

DZone's Guide to

Code Golf: Word Jumble

· IoT Zone ·
Free Resource

Digi-Key Electronics’ Internet of Things (IoT) Resource Center Inspires the Future: Read More

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 aims to confuse - you must create a program that rearranges the characters of an input. The first and last letters of the input must stay in their original positions, but all other characters will be re-ordered. For instance:

INPUT: Ryan blogs about ponies.

OUTPUT: Rayn bogls auobt pnioes.

Fewest characters will win. You must submit by Tuesday, April 21st. The winner will be announced in next week's newsletter.

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

Happy coding!

Digi-Key’s IoT Component Selector is your one-stop-shop for the IoT


Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}