Giter Site home page Giter Site logo

hs_recipe_hash_lab's Introduction

##Cheesy Mac Attack Hash We're going to build a hash that stores a recipe for homemade mac and cheese.

This is a test driven lab so first fork and clone the lab or click Open in Nitrous. Then open recipe_hash.rb and follow the instructions in the file! Don't forget to run learn (from the main directory for this lab) as you work to make sure you are passing the tests.

More information about hashes can be found in the Ruby docs.

And as a reminder, a hash is a data structure, similar to an array, but instead of using numbered indexes to access data we linke each piece of data with a string (or symbol). Hashes looks like this:

student_ages = {
  :victoria => 25,
  :arel => 27,
  :carley => 25, 
  :al => 26
}

In this example, the hash is stored in the variable student_ages. Each age is stored in a key value pair: the name is the key and the value associated with it is the age. If you wanted to access the age of Arel, you would access it by calling student_ages[:arel]. Hashes are great because they allow us to store data with additional context. If we just stored everyone's ages in an array student_ages = [25, 27, 25, 26], we would have know idea which age belongs to whom!

More information about hashes can be found in the docs.

We're going to build a hash that stores the recipe of homemade mac and cheese. You're going to write your code in recipe_hash.rb. Open recipe_hash.rb and follow the instructions in the file!

View Cheesy Mac Attack Hash on Learn.co and start learning to code for free.

hs_recipe_hash_lab's People

Contributors

dfenjves avatar fislabstest avatar fs-lms-test-bot avatar juliataitz avatar stephaniecoleman avatar vanessadean avatar victhevenot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

twantkipp

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.