added lochkartengenerator
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Generated by Verge3D Puzzles v.2.12.5
|
||||
* Sat Jun 08 2019 04:01:26 GMT+0200 (Mitteleuropäische Sommerzeit)
|
||||
* Sat Jun 08 2019 17:55:33 GMT+0200 (Mitteleuropäische Sommerzeit)
|
||||
* Do not edit this file - your changes may get overridden when Puzzles are saved.
|
||||
* Refer to https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html
|
||||
* for information on how to add your own JavaScript to Verge3D apps.
|
||||
@@ -170,7 +170,7 @@ initOptions = initOptions || {};
|
||||
if ('fadeAnnotations' in initOptions) {
|
||||
_pGlob.fadeAnnotations = initOptions.fadeAnnotations;
|
||||
}
|
||||
var distZ, r, g, b, distY, dragging, distX, inboundStepper, r_, maxDist, bitState, stepY, hue, g_, sat, b_, value;
|
||||
var distZ, r, g, b, distY, dragging, distX, inboundStepper, r_, maxDist, bitstate, recordqubitstate, recordbitstate, g_, stepY, hue, b_, sat, value;
|
||||
|
||||
|
||||
// utility function envoked by almost all V3D-specific puzzles
|
||||
@@ -733,6 +733,13 @@ function registerOnDrag(objNames, callback_start, callback_move, callback_drop,
|
||||
}
|
||||
|
||||
|
||||
function rs() {
|
||||
console.log('I\'m here!!!');
|
||||
getJSFunction('setDivWidth')(String(getDistanceBetweenObjects("div-left", "div-right")));
|
||||
}
|
||||
appInstance.ExternalInterface["rs"] = rs;
|
||||
|
||||
|
||||
|
||||
// getObjectMaterial puzzle
|
||||
function getObjectMaterial(objNames) {
|
||||
@@ -802,6 +809,13 @@ function registerOnClick(objNames, cbDo, cbIfMissedDo) {
|
||||
|
||||
|
||||
|
||||
// setInterval puzzle
|
||||
function registerInterval(timeout, callback) {
|
||||
window.setInterval(callback, 1000 * timeout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function matGetColors(matName) {
|
||||
|
||||
var mat = v3d.SceneUtils.getMaterialByName(appInstance, matName);
|
||||
@@ -932,7 +946,7 @@ function toNumber(num, prec) {
|
||||
* Describe this function...
|
||||
*/
|
||||
function printStates() {
|
||||
console.log(['Bit [',bitState,'] Qubit: [',toNumber(r_, 3),'] [',toNumber(g_, 3),'] [',toNumber(b_, 3),']'].join(''));
|
||||
console.log(['Bit [',bitstate,'] Qubit: [',toNumber(r_, 3),'] [',toNumber(g_, 3),'] [',toNumber(b_, 3),']'].join(''));
|
||||
}
|
||||
|
||||
|
||||
@@ -941,7 +955,7 @@ distY = getObjTransform("qubit", "position", "z") - getObjTransform("qubit_contr
|
||||
distX = getObjTransform("qubit", "position", "x") - getObjTransform("qubit_controller", "position", "x");
|
||||
maxDist = 2.3;
|
||||
stepY = 0.1;
|
||||
bitState = 0;
|
||||
bitstate = 0;
|
||||
r_ = 0;
|
||||
g_ = 0;
|
||||
b_ = 0;
|
||||
@@ -973,14 +987,47 @@ registerOnDrag(["GROUP", "qubit_grp"], function() {
|
||||
registerOnClick("bit", function() {
|
||||
if (getObjectMaterial("bit") == "white") {
|
||||
assignMat("bit", "black");
|
||||
bitState = 0;
|
||||
bitstate = 0;
|
||||
} else {
|
||||
assignMat("bit", "white");
|
||||
bitState = 1;
|
||||
bitstate = 1;
|
||||
}
|
||||
printStates();
|
||||
}, function() {});
|
||||
|
||||
registerOnClick("recordqubit", function() {
|
||||
if (getObjectMaterial("recordqubit") == "on") {
|
||||
assignMat("recordqubit", "black");
|
||||
recordqubitstate = 0;
|
||||
} else {
|
||||
assignMat("recordqubit", "on");
|
||||
recordqubitstate = 1;
|
||||
}
|
||||
}, function() {});
|
||||
|
||||
registerOnClick("recordbit", function() {
|
||||
if (getObjectMaterial("recordbit") == "on") {
|
||||
assignMat("recordbit", "black");
|
||||
recordbitstate = 0;
|
||||
} else {
|
||||
assignMat("recordbit", "on");
|
||||
recordbitstate = 1;
|
||||
}
|
||||
}, function() {});
|
||||
|
||||
registerInterval(1, function() {
|
||||
if (recordbitstate == 1) {
|
||||
getJSFunction('addBit')(bitstate);
|
||||
}
|
||||
if (recordqubitstate == 1) {
|
||||
getJSFunction('addQubit')(r_, g_, b_);
|
||||
}
|
||||
});
|
||||
|
||||
printStates();
|
||||
|
||||
printStates();
|
||||
|
||||
eventHTMLElem('wheel', ["DOCUMENT"], false, function(event) {
|
||||
if (getEventProperty('deltaY', event) < 0) {
|
||||
applyObjLocalTransform("qubit_controller", "position", 0, stepY, 0);
|
||||
|
||||
Reference in New Issue
Block a user