Skip to content

MarioPyramid

Derek Peacock edited this page Nov 11, 2022 · 7 revisions

Build a Pyramid

This example is based on a Super Mario game (1981) which involved a pyramid created from blocks.

Super Mario Bros

Requirements

  1. Prompt the user to enter the size of the pyramid between 1 and 8
  2. If the user enters a size less than 1 and greater than 8 ask the user again.
  3. Build a two sided pyramid of the required size as shown in the example below

Expected Output

Possible Help

This example is based on an exercise used by Harvard University in its CS50 Online Course.

Code Walkthrough - Simple Version
Code Walkthrough - Full Version

Greenfoot Pyramid Power Point

Clone this wiki locally