TZinovieva

Spice Must Flow

Jan 21st, 2023
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function spiceMustFlow(yield) {
  2.     let days = 0;
  3.     let storage = 0;
  4.     while (yield >= 100) {
  5.         let extracted = yield - 26;
  6.         storage += extracted;
  7.         days++;
  8.         yield -= 10;
  9.         if (yield < 100) {
  10.             storage -= 26;
  11.         }
  12.     }
  13.     console.log(days)
  14.     console.log(storage)
  15. }
Advertisement
Add Comment
Please, Sign In to add comment