Git Product home page Git Product logo

upperline-hs-mario-stretch-lab-upperline-trevor-062016's Introduction

##Itsa Mario*

This is a group lab, so make sure you are working in a group of 2-4 students

Toward the beginning of World 1-1 in Nintendo’s Super Mario Brothers, Mario must hop over two "half-pyramids" of blocks as he heads toward a flag pole. Below is a screenshot.

mario

Your mission is to recreate these blocks using Ruby.

Part I: The Boring Pyramid

Create a program that will print the following pyramid:

   #  #
  ##  ##
 ###  ###
####  ####

(The height and the width of the half-pyramids pictured above are 4 with a gap of size 2 separating them.)

Part II: User Specified Height

Add a new feature to your program that asks a user how tall they would like to make the pyramid. This should be a non-negative integer no greater than 23 (this is the tallest that a pyramid can be in Mario land).

Part III: Chained pyramids

Modify your code to prompt the user for the number of pyramids they want. Using this number, stack the pyramids on top of each other in a chain. This would be an example of a pyramid with height of 4 and chain length of 3:

   #  #
  ##  ##
 ###  ###
####  ####
   #  #
  ##  ##
 ###  ###
####  ####
   #  #
  ##  ##
 ###  ###
####  ####

Part IV: Every-Other-Upside-Down Pyramid

Modify your code to make every other pyramid inverted. Example:

   #  #
  ##  ##
 ###  ###
####  ####
####  ####
 ###  ###
  ##  ##
   #  #
   #  #
  ##  ##
 ###  ###
####  ####

Part V: Rainbow Magic

Find a ruby gem that allows you to give your pyramids color. Print out a pyramid that covers the colors of the rainbow.

*Inspiration for this lab comes from one of the labs in Harvard's CS50 class (Intro to Computer Science)

Optional Practice with Git!

To make things a little more interesting, and give you some practice using Git and Github, you'll be working in a group of 3-4 students.

Choose one representative from your group to fork this lab. Everyone in your group should clone from that fork. You'll be combining all of your code at the end and submitting a group pull request from this fork.

Now break up your team in half. Half of you will work on creating the left side of the pyramid and half of you will work on creating the right side of the pyramid.

Everyone should write their code in the pyramid.rb file, but each team should create their own git branch to work off of. To share your code you'll need to push up your branch to the shared repository (the one you forked from). Then nominate someone on the team to pull down the code and work together as a team to combine the code for left and right sides. You may want to do some refactoring and you will probably have merge conflicts that you will need to resolve.

Use the git pull command to pull down the code from Github. You'll also need to use git merge to merge each branch into the master branch and combine your changes.

Danny made a cheat sheet if you need some help remembering how to use git commands.

View Itsa Mario* on Learn.co and start learning to code for free.

upperline-hs-mario-stretch-lab-upperline-trevor-062016's People

Contributors

dfenjves avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.