Coder Social home page Coder Social logo

assansav / programming-univbasics-4-building-nested-hashes-online-web-prework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-students/programming-univbasics-4-building-nested-hashes-online-web-prework

0.0 1.0 0.0 52 KB

License: Other

Ruby 100.00%

programming-univbasics-4-building-nested-hashes-online-web-prework's Introduction

Building Nested Hashes Lab

Learning Goals

  • Build a nested hash
  • Add key/value pairs in a nested hash
  • Update key/value pairs in a nested hash

Introduction

In this lab, we will practice constructing a deeply nested hash.

Instructions

You are tasked with building a nested hash one layer (or "level") at a time, in a similar way to how we built our epic_tragedy hash in the previous lesson. Read the test output very carefully; it will guide you through building the necessary methods. At the end of the exercise, your multidimensional monopoly hash should look like this:

monopoly =  {
  :railroads=>
  {
    :pieces=>4,
    :rent_in_dollars=>
    {
      :one_piece_owned=>25,
      :two_pieces_owned=>50,
      :three_pieces_owned=>100,
      :four_pieces_owned=>200
    },
    :names=>
    {
      :reading_railroad=>
      {
        "mortgage_value"=>"$100"
      },
      :pennsylvania_railroad=>
      {
        "mortgage_value"=>"$200"
      },
      :b_and_o_railroad=>
      {
        "mortgage_value"=>"$400"
      },
      :shortline=>
      {
        "mortgage_value"=>"$800"
      }
    }
  }
}

Resources

programming-univbasics-4-building-nested-hashes-online-web-prework's People

Contributors

ahimmelstoss avatar assansav avatar aviflombaum avatar deniznida avatar ehawk823 avatar fislabstest avatar fs-lms-test-bot avatar ga-be avatar markedwardmurray avatar maxwellbenton avatar msuzoagu avatar octosteve avatar pletcher avatar roseweixel avatar sarogers avatar sophiedebenedetto avatar victhevenot avatar

Watchers

 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.