Guest User

Untitled

a guest
Oct 28th, 2016
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function aMinerTask(input) {
  2.     let resource = new Map();
  3.     resource.set("gold", 0);
  4.     resource.set("silver", 0);
  5.     resource.set("coppr", 0);
  6.     for (let i = 1; i < input.length -1; i+=1) {
  7.         if (i % 2 === 0) {
  8.             for (var [key, value] of resource) {
  9.                 if (key === input[i]) {
  10.                     /*ToDo change Value of resource key...*/
  11.                 }
  12.             }
  13.         }
  14.     }
  15.     for (var [key, value] of resource) {
  16.         console.log(key + " -> " + value);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment