Compare commits

..

No commits in common. "f09000a25abb695bfc0856fc9936ad922ec79700" and "c0b00356a713ca42fc7e7cdddc436a6b150a9332" have entirely different histories.

View File

@ -5,11 +5,11 @@ function states_to_call (prev, curr, call_stack) {
// console.log(curr) // console.log(curr)
let calls = [] let calls = []
if (prev.pendown && !eq_vect(prev.position, curr.position)) { if (prev.pendown && !eq_vect(prev.position, curr.position)) {
// console.log("headings", prev.heading, curr.heading) console.log("headings", prev.heading, curr.heading)
// console.log("forward?", curr.forward) console.log("forward?", curr.forward)
// console.log("#calls", call_stack.length) console.log("#calls", call_stack.length)
if (prev.heading == curr.heading && curr.forward && call_stack.length > 0) { if (prev.heading == curr.heading && curr.forward && call_stack.length > 0) {
// console.log("extending line!") console.log("extending line!")
const [x, y] = sub(curr.position, prev.position) const [x, y] = sub(curr.position, prev.position)
const last_call = call_stack.pop(); const last_call = call_stack.pop();
const new_call = ["line", last_call[1], last_call[2], x + last_call[3], y + last_call[4]] const new_call = ["line", last_call[1], last_call[2], x + last_call[3], y + last_call[4]]