Code_Friday/Challenge 8: Code Golf: Zig-Zag

Zig-Zag

In this challenge, you are trying to create a "zig-zag" pattern generator (or a "triangle wave" generator) that will output a zig-zag pattern that repeats 5 times with an amplitude of 11 to the screen as shown below.

The real challenge is to do this with a few characters in your program as possible — the program whose code size is smallest (in terms of byte count) wins!

You may code in any language you like, but each language will only be in "competition" with entries from the same language. Since C++ is our "common language", that would be a good one to compete with.

Rules

Your program must follow the most current standard for whatever language you have written in, and must compile (or be interpreted) with no warnings even with maximum warning output enabled on the compiler (or interpretor). You must not use any 3rd party libraries (otherwise the size of those files must also be counted). No input is allowed from any source. Your program must run to successful completion. Other than that, anything goes! You do not have to follow "best practices" while writing your code (as long as your code is technically standards-compliant).

Required Output

Your output should match the following exactly:

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

Geometric Details: The shape is 11 columns wide at the peak (10 spaces followed by a '*'). Each "triangle" part consists of 10 rows, where the 11th row is the first row of the next triangle. One final row was required to "finish" the last triangle.

Parting Thoughts

Write the code in a readable format first, then carefully remove extra characters like whitespace. Remember, every character counts! Any trick you can use to reduce the number of characters in your source code is fair game (except those tricks disallowed by the limitations above).

Have fun!