exercism / euphoria

Exercism exercises in Euphoria.
https://exercism.org/tracks/euphoria
MIT License
3 stars 8 forks source link

reorder layout of tests #76

Closed axtens closed 5 months ago

axtens commented 6 months ago

working thru from last to first @glennj don't spend any time on this. I've got it figured out. Using R8 with

const output = [];
const lines = ClipboardService.GetText().split(/\r\n|\r|\n/g);
lines.forEach(line => {
    line = line.replace("{", "[");
    line = line.replace("}", "]");
    output.push(eval(line));
})
clip(output.join("\r\n"))

function test_equal(name, expecting, outcome) {
    return 'test_equal("' + name + '", ' + outcome + ', ' + expecting + ')';
}

function score(obj, name) {
    return 'score(' + (JSON.stringify(obj)).replace("]", "}").replace("[", "{") + ',"' + name + '")'
}

function is_scalene(obj) {
    return 'is_scalene(' + (JSON.stringify(obj)).replace("]", "}").replace("[", "{") + ')'
}

function is_isosceles(obj) {
    return ' is_isosceles(' + (JSON.stringify(obj)).replace("]", "}").replace("[", "{") + ')'
}

function is_equilateral(obj) {
    return 'is_equilateral(' + (JSON.stringify(obj)).replace("]", "}").replace("[", "{") + ')'
}

function two_fer(name) {
    return ' two_fer("' + name + '")'
}

As I change something, its function gets added.

axtens commented 5 months ago

All tested with run.ex