Hi,
I am trying to create this in javascript, but am stuck with the loop, or maybe it should be a if/then? I can’t figure out where to place the true/false either.
let boxes = {
a1: 2,
b2: 1,
c3: 4,
d4: 4,
e5: 6,
f6: 5,
g7: 2,
h8: 12,
i9: 5,
j10: 19,
k11: 1,
l12: 0,
};
do {
let sum1 = (boxes.b2 + boxes.l12);
boxes.d4 = sum1;
let sum2 = (boxes.g7 * boxes.g7);
boxes.g7 = sum2;
let sum4 = (boxes.d4 + boxes.a1);
boxes.d4 = sum4;
let sum5 = (boxes.g7 - boxes.b2);
boxes.g7 = sum5
}
while (boxes.d4 !== boxes.i9);
//sum3 TRUE
let sum6 = (boxes.c3 + boxes.i9);
boxes.j10 = sum6;
let sum7 = (boxes.g7 - boxes.j10);
boxes.k11 = sum7
if (boxes.k11 == '55')
console.log('Correct')
// console.log(boxes)
Thanks