Exercise 40

178 views
Skip to first unread message

robled...@gmail.com

unread,
Sep 3, 2015, 10:13:39 PM9/3/15
to mooc.fi
Hi,

I'm having problems with week 2 exercise 40.

My code gives me the correct visual results but fails the Triangle and Christmas tree tests. How should I modify my code?


Best regards


ljleppan

unread,
Sep 7, 2015, 9:40:41 AM9/7/15
to mooc.fi, robled...@gmail.com
Hi,

You are printing an empty line at the start of the triangle. This breaks the tests. Look at how you initialize your variables in the printTriangle() method.

As for your christmas tree, you are printing an extra whitespace at the start of each line.

If you fix those two issues, the tests should pass.

-L
Reply all
Reply to author
Forward
0 new messages