Code Golf

Given an a positive integer N>1:

Write a program that produces a triangle of size N in the fewest amount of bytes possible. The output for N<=1 is not defined (so it doesn't matter what output your program gives for integers less than 2), but for N>=2, your triangle should have N "_" characters, N "/" characters, and N "\" characters.

An example of the output your program should produce for N = 2, N = 3, and N = 4 is given below:

       /\     /  \
 /\   /  \   /    \
/__\ /____\ /______\

Please upload your solution to the #code-golf-solutions channel at

Make sure to include what language it was written in, and by what method it accepts input (e.g, command line arguement, prompt on running proram)

The solution with the fewest non-whitespace characters (defined any UTF-8 character except space and tab) wins.

The prize for winning is a Blue Yeti Microphone and a Logitech HD Pro Webcam C920. Submissions are due at 9:10 PM.

Back to prompts