NML Blog

Recent posts

The Box Challenge

Hello Programming People

We skipped a Coding Challenge last week. (Got a little busy with the business of starting awesome new projects with awesome new clients like Virgin Active and Pam Golding.) But we’re back, and hope you’ve had a good fortnight of practice.

If you enjoyed the Christmas Tree Coding Challenge, you might enjoy this follow-up…

Remember, you can tweet submissions to @newmedialabs, or email your file to us at info@newmedialabs.co.za.

Let’s code.

Coding Challenge Three: The Box The Christmas Tree Came In

Your code takes 2 values: “cols” and “rows” and outputs a box, like this:

**********
*        *
*        *
*        *
**********

In this example, cols = 9, rows = 5.

The minimum number of columns and rows is 1.

Let’s see who can do it:

1 with the fewest lines; and
2 in the most obscure, unreadable, unmaintainable manner possible.

Need a software development partner?

Get in touch