Extension 2.5: Mario

Authors:

Mario, created in 1981 by Nintendo, is a classic video game starring the fictional Italian character Mario. In the assignment, loops printing hashtags will be used to build the block mountains as seen in the picture.

../_images/Super-Mario-Bros.-3.jpg
  1. Mario runs from left to right. Create a mountain that he would have to climb, as shown in the example for a size 5 mountain.

    #
   ##
  ###
 ####
#####
  1. Create a mountain that he would descend, as shown below for a size 3 mountain.

#
##
###
  1. Make a mountain that resembles pattern 1, but flipped upside-down. Below is shown a size 7 mountain for this pattern.

#######
 ######
  #####
   ####
    ###
     ##
      #
  1. Make a mountain that resembles pattern 2, but flipped upside down. Below is shown a size 4 mountain for this pattern.

####
###
##
#

Try running your Mario class and test yourself using various sizes (say, 1 to 10) and patterns (always an integer from 1 to 4).

Note that this problem requires careful use of whitespace which are the characters like tab, space, and newlines that don’t show anything in the foreground color. On a white background whitespace characters don’t have a visible impact, but they do move the cursor to a new location. In particular:

You have attempted of activities on this page