←back to thread

483 points mraniki | 2 comments | | HN request time: 0.559s | source
1. thicTurtlLverXX ◴[] No.43534725[source]
In the Rubic's cube example, to solve the cube gemini2.5 just uses the memorized scrambling sequence:

// --- Solve Function ---

function solveCube() { if (isAnimating || scrambleSequence.length === 0) return;

  // Reverse the scramble sequence
  const solveSequence = scrambleSequence
    .slice()
    .reverse()
    .map((move) => {
      if (move.endsWith("'")) return move.slice(0, 1); // U' -> U
      if (move.endsWith("2")) return move; // U2 -> U2
      return move + "'"; // U -> U'
    });

  let promiseChain = Promise.resolve();
  solveSequence.forEach((move) => {
    promiseChain = promiseChain.then(() => applyMove(move));
  });

  // Clear scramble sequence and disable solve button after solving
  promiseChain.then(() => {
    scrambleSequence = []; // Cube is now solved (theoretically)
    solveBtn.disabled = true;
    console.log("Solve complete.");
  });
}
replies(1): >>43539743 #
2. afro88 ◴[] No.43539743[source]
Thank you. This is the insidious thing about black box LLM coding.