Code Monkey home page Code Monkey logo

kwk-l1-recipe-hash-teachers-l1's Introduction

Baking with Klossy - Hashes Lab

We're going to build a hash that stores the recipe of Karlie Kloss' Perfect 10 Cookie. Think of the Perfect 10 cookie as an oatmeal cookie meeting an energy bar! It's made with gluten-free oats, almonds, mini chocolate chips and sweetened with agave. Each purchase of a Perfect 10 provides ten school lunches to hungry children around the world.

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,
  :jordan => 28, 
  :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.

This is a test driven lab so open the lab in the Learn IDE. 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.

You're going to write your code in recipe_hash.rb. Open recipe_hash.rb and follow the instructions in the file!

Here's a version of this Perfect 10 Cookie recipe so you can make some on your own! (Recipe makes 12 cookies).

Ingredients

2 cups almond flour
1 cup gluten freewhole oats
½ tsp. kosher salt
½ tsp. baking powder
¼ tsp. baking soda
½ tsp. Xanthan Gum
¼ cup slivered almonds, lightly toasted
¾ cup mini dark chocolate chips
½ cup olive oil
¼ cup agave

Directions

Heat the oven to 325º.

Mix the dry ingredients together in a bowl (you can use a mixer if you prefer). Add the liquid ingredients and paddle until well combined.

Scoop cookies firmly with a 2¼-inch ice cream scoop onto a parchment-lined sheet pan. Flatten each mound of cookie dough fully with the palm of your hand into a 3-inch round.

Bake cookies for 10-12 minutes or until golden brown. Cool completely on the pan. Store in an airtight container in the fridge, or eat right away.

KWK-L1 Baking with Klossy - Hashes Lab

kwk-l1-recipe-hash-teachers-l1's People

Contributors

victhevenot avatar dfenjves avatar vanessadean avatar danielseehausen avatar stephaniecoleman avatar sammarcus avatar aviflombaum avatar juliataitz avatar fs-lms-test-bot avatar fislabstest avatar jordanbudi avatar

Watchers

James Cloos 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.