export const name = "Hash";
export const L = 2;
export const E = 4;
export const V = 2;

export const init = function() {
    return this
        .point("P", -2, -0.4)
        .point("X", -0.2, 0.5)
        .point("Y", -1, 0)
        .point("Z", 0.2, -0.5)
        .line("l1", "X", "Y")
        .parallel("l2", "Z", "l1")
        .line("l3", "Y", "Z")
        .parallel("l4", "X", "l3")
        .hide("X", "Y", "Z");
};

export const snapshot = function() {
    return this.answer()
        .line("XZ", "X", "Z")
        .parallel("l", "P", "XZ")
        .hide("XZ");
};

export const solveL = function() {
    return this.initFinish()
        .intersection("A", "l1", "l4")
        .intersection("B", "l2", "l3")
        .line("AB", "A", "B")
        .nextStep()
        .parallel("l", "P", "AB")
        .answer()
        .clone("l-clone", "l");
};

export const solveE = function() {
    return this.initFinish()
        .intersection("A", "l1", "l4")
        .circle("circle-A", "A", "P")
        .nextStep()
        .intersection("B", "l2", "l3")
        .circle("circle-B", "B", "P")
        .nextStep()
        .intersection("Q", "circle-A", "circle-B", "P")
        .line("AQ", "A", "Q")
        .nextStep()
        .intersection("R", "AQ", "circle-A", "Q")
        .line("PR", "P", "R")
        .answer()
        .clone("l", "PR");
};
