Open odv opened 4 years ago
function growingPlant(upSpeed, downSpeed, desiredHeight) { if(upSpeed >= desiredHeight) return 1; let output = 0; for (let i=0; i<=desiredHeight; i++) { let daily = 0; output += 1; daily += upSpeed; daily -= downSpeed; if(daily >= desiredHeight) {return output}; } return output }
function growingPlant(upSpeed, downSpeed, desiredHeight) { if(upSpeed >= desiredHeight) return 1; let output = 0; for (let i=0; i<=desiredHeight; i++) {
let daily = 0; output += 1; daily += upSpeed; daily -= downSpeed; if(daily >= desiredHeight) {return output}; } return output }