3.NeedForSpeed
https://pastebin.com/4YSLTVQr
70/100
I guess my mistake is at refuel, but still not sure
https://pastebin.com/4YSLTVQr
70/100
I guess my mistake is at refuel, but still not sure
Drive function !
;-)
case "Drive":
if (car.fuel >= p2) {
car.mileage += p1
car.fuel -= p2;
console.log(`${name} driven for ${p1} kilometers. ${p2} liters of fuel consumed.`);
if (car.mileage >= 100000) {
delete caroptions[name]
console.log(`Time to sell the ${name}!`);
}
} else if (car.fuel < p2) {
console.log("Not enough fuel to make that ride");
}
break;