Skip to content

Commit

Permalink
added one more exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrigrabov committed Feb 5, 2018
1 parent 8b898d1 commit a8db13d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@
> * `merging` - Write a function which receives an array of objects. It should merge them into a single object. The objects with fewest values should take precedence over objects with fewer values. The input objects should remain unaffected, by the merge. For example input `[{a: 5}, {a: 3, b: 21, c:32}]` to `{a:5, b:21, c:32}`
> * `possibleValues` - Write a function which receives an array of objects. Your function should output an object which contains all the keys from input objects. The corresponding value of each key should be an array which contains a list of all values the corresponding key had in all input objects. Values should be unique. For example `[{a: 5}, {a: 3, b: 21, c:32}, {a: 3, c:32}]` to `{a:[5,3], b:[21], c:[32]}`
> * `isPrime` - Write a function which receives an integer an returns `true` if the input is a prime number, `false` otherwise
> * `walkabout` - write a constructor called Walker. It should receive one parameter, a string which is either 'N', 'S', 'E' or 'W' which indicates the direction the walker is facing. Walker's initial coordinates should be (0,0), where the first coordinate represents the x coordinate (horizontal) and the second coordinate represents y coordinate (vertical).
> * Add a `walk` method to `Walker` using its prototype which accepts a direction as a string and a number representing the number of steps to be taken. When called the walker should update its coordinates and add the move made to its journey history. The journey history should be stored using coordinates representing the location at the end of each move.
> * Add a `pathTaken` method to `Walker` using its prototype. It should output the journey taken taken as a list of coordinates

0 comments on commit a8db13d

Please sign in to comment.