Kotlinlearncs.online LogoJava
Return to List

Solve: Mario Bricks

Imported By: Geoffrey Challen
/ Version: 2022.7.0

Let's complete our own version of the classic Mario Bricks assignment from CS50!

Write a method named makeBricks that accepts a single int and returns a String containing a Mario pyramid of # characters. For example, given the input 4, that would look like this:

   #
  ##
 ###
####

You can find more examples and some hints here. The int passed to makeBricks will be positive. And note that your result should end with a newline character.

Related Lessons

Stuck? You may find these lessons helpful: