--- /dev/null
+qreg q[2];
+creg c[4];
+//======================================
+//Four oracles enclosed in comments
+// They are constant zero, constant one, balanced same, and balanced inverted.
+// The actual logic of the function as input (x)(y) and output (x)(y xor f(x))
+//======================================
+reset q[0];
+reset q[1];
+x q[1];
+h q[0];
+h q[1];
+//<constant-zero>
+//</constant-zero>
+h q[0];
+h q[1];
+measure q[0] -> c[0];
+//======================================
+reset q[0];
+reset q[1];
+x q[1];
+h q[0];
+h q[1];
+//<constant-one>
+x q[1];
+//</constant-one>
+h q[0];
+h q[1];
+measure q[0] -> c[1];
+//======================================
+reset q[0];
+reset q[1];
+x q[1];
+h q[0];
+h q[1];
+//<balanced-same>
+cx q[0], q[1];
+//</balanced-same>
+h q[0];
+h q[1];
+measure q[0] -> c[2];
+//======================================
+reset q[0];
+reset q[1];
+x q[1];
+h q[0];
+h q[1];
+//<balanced-invert>
+x q[0];
+cx q[0], q[1];
+x q[0];
+//</balanced-invert>
+h q[0];
+h q[1];
+measure q[0] -> c[3];
+//======================================
+sample c;
if (instr.includes("=1") || instr.includes("=0") || instr.includes("🔍"))
{
var a = parseInt(ProgramTrack.STATE[s[0]][s[1]].split("<sub>")[1]) - 1;
- a = (a + 1) % (ProgramTrack.STATE.length - 1);
+ a = (a + 1) % 14;
ProgramTrack.STATE[s[0]][s[1]] = instr + "<sub>" + (a + 1) + "</sub>";
}
ProgramTrack.draw();
if (str) {} else {str = ""};
if (str.includes(",") && (trackerElem.innerHTML == "..." || trackerElem.innerHTML == ""))
{
- ProgramTrack.DRAGELEM = trackerElem;
+ $(".program-instr")[0].style.display = "";
+ var w = Math.floor($(".program-instr")[0].getBoundingClientRect().width);
$(".program-instr")[0].style.display = "none";
+ ProgramTrack.DRAGELEM = trackerElem;
$(".program-instr")[0].className = $(".program-instr")[0].className.replace("menu-hidden", "").trim();
$(".program-instr")[0].className += " menu-reveal";
$(".program-instr")[0].style.position = "fixed";
$(".program-instr")[0].style.top = e.clientY + "px";
- $(".program-instr")[0].style.left = e.clientX + "px";
+ console.log(window.innerWidth + ", " + e.clientX + ", " + w);
+ if (window.innerWidth - e.clientX > w) $(".program-instr")[0].style.left = e.clientX + "px";
+ else $(".program-instr")[0].style.left = (window.innerWidth - w) + "px";
$(".program-instr")[0].style.animation = "animation-reveal 0.2s forwards";
$(".program-instr")[0].style.display = "";
}
$(".program-track")[0].cellSpacing,
$(".istina-linecounter")[0].style.height,
$(".istina-overlay")[0].style.height,
- $(".istina-basis")[0].style.height
+ $(".istina-basis")[0].style.height,
+ $(".program-track-container")[0].style.width,
+ resultsChart.canvas.getAttribute("style")
];
$(".program-track-container")[0].style.height = "100%";
+ $(".program-track-container")[0].style.width = "100%";
document.body.style.backgroundColor = "rgba(0, 0, 0, 0)";
$(".main-table tr")[0].style.display = "none";
$("istina-editor div")[0].style.backgroundColor = "rgba(0, 0, 0, 0)";
a.click();
a.remove();
$(".program-track-container")[0].style.height = backups[5];
+ $(".program-track-container")[0].style.width = backups[13];
$(".main-table")[0].border = 1;
document.body.style.backgroundColor = "";
$(".main-table tr")[0].style.display = "";
resultsChart.config.options.scales.y.ticks.color = backups[3];
resultsChart.config.options.scales.x.ticks.color = backups[4];
Chart.defaults.font.weight = null;
+ resultsChart.canvas.setAttribute("style", backups[14]);
resultsChart.update();
resultsChart.options.animation.duration = backups[2];
for (var i = 0; i < $(".program-track td").length; i++)