Ledger Nano X - The secure hardware wallet
SHARE
TWEET

04. time-to-walk

milengerov May 19th, 2020 870 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(steps, footprintLength, speed){
  2.     let distance = steps * footprintLength
  3.    
  4.    
  5.     let seconds = distance / (speed / 3.6) + Math.floor(distance / 500) *60;
  6.    
  7.     let minutes = Math.floor(seconds / 60);
  8.     seconds -= minutes * 60;
  9.     let hours = Math.floor(minutes / 60);
  10.     minutes -= hours * 60;
  11.  
  12.     console.log(`${String(hours).padStart(2, 0)}:${String(minutes).padStart(2, 0)}:${seconds.toFixed(0).padStart(2, 0)}`);
  13.    
  14.  
  15.    
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top