https://github.com/muhamed-didovic/exercises
collections
https://github.com/muhamed-didovic/exercises
Last synced: about 2 months ago
JSON representation
collections
- Host: GitHub
- URL: https://github.com/muhamed-didovic/exercises
- Owner: muhamed-didovic
- Created: 2018-11-14T16:23:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-14T16:52:30.000Z (over 6 years ago)
- Last Synced: 2025-01-23T21:15:56.395Z (3 months ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Refactoring to Collections: The Exercises!
The exercises for the book are broken down into three categories:
1. Beginniner
These exercises focus on fundamentals. You'll get to practice reimplementing cornerstone collection operations like `map`, `filter`, and `reduce`, and practice using those operations to solve simple problems.
2. Intermediate
The intermediate exercises focus on learning how to apply multiple operations in sequence to solve a problem. Each one is a little trickier than the last, and you'll need to use operations beyond just `map`, `filter`, and `reduce`.
3. Pro
The pro exercises build on what you practiced in the intermediate exercises, but start to introduce longer pipelines and problems that require more creative solutions.## How to do the exercises
All of the exercises are organized into PHPUnit test cases. I've bundled any necessary vendor dependencies with the exercises, so you don't need to download anything extra to get started.
To start working on an exercise, open that exercise file and look for a comment block with instructions. Edit the exercise file directly to add your solution.
To run a test you are working on, run PHPUnit from the command line, passing the test file name as an argument.
For example, to run the first test in the `beginner` category, make sure you are in the directory where this README is located and run:
```
./vendor/bin/phpunit beginner/1-ReimplementMapTest.php
```I've included my solutions to the exercises in a separate folder for you to compare against when you come up with a solution. Don't cheat though, the best way to learn this stuff is to practice! Don't check the solutions unless you've already finished the exercise and want to compare your work with mine, or unless you are really stuck and can't figure out the solution.
Good luck!
– Adam