Skip to content

Instantly share code, notes, and snippets.

@r1ckhenry
Created January 17, 2017 14:50
Show Gist options
  • Save r1ckhenry/7f59b113421f4d5fe95f71c0b7c4d89b to your computer and use it in GitHub Desktop.
Save r1ckhenry/7f59b113421f4d5fe95f71c0b7c4d89b to your computer and use it in GitHub Desktop.
Bears, River, Fish

Bears, River, Fish

We are going to build a small ecosystem! We want to create an ecosystem made up of 3 parts: bears, river and fish. You will need a class for each of these. From this you can make instances and build your ecosystem.

How our ecosystem works

  • A river should have a name e.g. "Amazon"

  • A river should hold many fish

  • A fish should have a name

  • A bear should have a name e.g. "Yogi"

  • A bear should have an empty stomach ( maybe an array )

  • A bear should be able to take a fish from the river

  • A river should lose a fish when a bear takes a fish

Extensions

  • A bear could have a roar method
  • A bear could have a food_count method
  • A river could have a fish_count method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment