Giter Site home page Giter Site logo

hs-hashketball's Introduction

Hashketball

Overview

Tomorrow, you'll be learning all about Application Programming Interfaces, or APIs. APIs are how applications communicate with each other over the iternet - it's why Yelp can have a Google Map showing restaurant locations and those restaurants can display all of the latest tweets about them on their page.

Many of the APIs we'll be working with send us data in the form of nested arrays and hashes. Being comfortable iterating through nested data structures will make your life WAY easier.

Instructions

We've gotten a bunch of data from the Yahoo Sports API. There is a nested hash in game_hash.rb that defines a game, with two teams, their players, and the players stats.

Using the power of Ruby, and the game hash in game_hash.rb, write methods to complete the following:

  1. Return the name of the home team and the away team. We've done this one for you to get started.

  2. Return a team's colors.

  3. Returns the array of players with all of their stats.

  4. Print out the points scored by each player on a team.

  5. Return all the stats for a player, given a player's team and name. Hint: The .find method will be helpful (it works a little like .each).

  6. Return a player's shoe size. Hint: try finding the player first (the same way you did with player_stats) then look for his shoe size.

  7. Return the number of slam dunks for a player.

  8. Return the number of slam dunks for the team player with the largest shoe size.

Bonus Questions:

Define methods to return the answer to the following questions:

  1. Which player scored the most points?

  2. Which team scored the most points?

  3. Which player has the longest name?

Super Bonus:

  1. Write a method that returns true if the player with the longest name had the most steals. Call the method long_name_steals_a_ton?.

Resources

View Hashketball on Learn.co and start learning to code for free.

hs-hashketball's People

Contributors

fislabstest avatar fs-lms-test-bot avatar ipc103 avatar vanessadean avatar victhevenot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.