Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Clear&Readable solution in Clear category for [old] Achilles and the Tortoise by SaintDron
"use strict";
function chase(a1Speed, t2Speed, advantage) {
return a1Speed * advantage / (a1Speed - t2Speed);
}
var assert = require('assert');
if (!global.is_checking) {
console.log('Example:')
console.log(chase(6, 3, 2))
// These "asserts" using only for self-checking and not necessary for auto-testing
function almost_equal(checked, correct, significantDigits) {
var precision = 0.1 ** significantDigits;
return correct - precision < checked && checked < correct + precision;
}
var first_test = almost_equal(chase(6, 3, 2), 4, 8)
var second_test = almost_equal(chase(10, 1, 10), 11.111111111, 8)
assert.equal(first_test, true);
assert.equal(second_test, true);
console.log("Coding complete? Click 'Check' to earn cool rewards!");
}
Aug. 14, 2018