Advertisement
Neri0817

Untitled

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