draw triangle function

draw triangle function - % drawTriangle(0) -> % %...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 % drawTriangle(number) -> triangle of asterisks % Description: % This function will take a given number and produce a right-angled triangle with a % decreasing number of asterisks in each row. % Examples:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % drawTriangle(0) -> % % drawTriangle(3) -> % *** % ** % * % drawTriangle(2) -> % ** % * function = drawTriangle(number) if number <= 0 fprintf('\n') else lineOfStars(number) drawTriangle(number-1) end...
View Full Document

This note was uploaded on 10/23/2009 for the course CISC 106 taught by Professor Mcgeary during the Fall '08 term at University of Delaware.

Ask a homework question - tutors are online