Woah, I never knew you were over 13(I can guess how old someone is by their behavior on the forums.). But I guess I was wrong because you have a GitHub account.
Oh. I just looked at the ToS, and yeah.
Interrobang. Look it up.
I want to turn
[scratchblocks]
() + ()
() * ()
() max () :: operators reporter
() min () :: operators reporter
() - ()
() / ()
() ^ () :: operators reporter
() mod ()
[/scratchblocks]
into
[scratchblocks]
() [+ v] () @delInput @addInput :: operators reporter
() [* v] () @delInput @addInput :: operators reporter
() [max v] () @delInput @addInput :: operators reporter
() [min v] () @delInput @addInput :: operators reporter
() [- v] () :: operators reporter
() [/ v] () :: operators reporter
() [^ v] () :: operators reporter
() [mod v] () :: operators reporter
[/scratchblocks]
And I've made the middle input types, but I just can't figure out how to have the first input with an offset
of 0 and the second with an offset
of 1 in the "block migrations".
Wouldn't the [scratchblocks] () [+ v] ()@delInput@addInput :: operators :: reporter[/scratchblocks] be the same as the multiplication one because the [+ v] is a dropdown?
that doesn't seem to work...
[scratchblocks]
(() [+ v] () @delInput @addInput::operators)
[/scratchblocks]
[scratchblocks]
(() [+ v] () @delInput @</a>addInput::operators)
[/scratchblocks]
Thanks.
What's the motivation? Just to make the palette smaller? Because there's a bit of a discoverability cost.
They want it as a menu so it looks a little cleaner.
Huh, I was going to refer you to the FAQ about settings, but to my surprise there isn't one. So here's the answer:
Every setting has to be checked, repeatedly, throughout your session. So having a setting slows Snap! down whether you enable it or not. We try to avoid them.
Sometimes it doesn't look that way because Jens adds temporary settings while debugging some feature, then removes the setting eventually.
Do you want to create expresssion builder
[scratchblocks]
() [+ v] () [- v] () @delInput @addInput :: operators reporter
[/scratchblocks]
or just try to replace "relabel" with drop down menu?
do not forget the parentheses () if this is the case ...
No, it's a dropdown; they are the same block.
They want it as a menu so it looks a little cleaner.
Do you want to create expresssion builder
[scratchblocks]
() [+ v] () [- v] () @delInput @addInput :: operators reporter
[/scratchblocks]
or just try to replace "relabel" with drop down menu?
The latter, i.e.:
I can't seem to get the operator blocks to work in threads.js:
Process.prototype.reportCommutativeOperator = function (a, op, b) { // a is a number,
switch (op) { // op is an operator,
case '+': // b is a list of nums
return this.reportCombine(this.reportCONS(a, b), this.reportSum);
case '\u00D7':
return this.reportCombine(this.reportCONS(a, b), this.reportProduct);
case 'max':
return this.reportCombine(this.reportCONS(a, b), this.reportMax);
case 'min':
return this.reportCombine(this.reportCONS(a, b), this.reportMin);
};
};
Process.prototype.reportCommutativeOperator = function (a, op, b) {
switch (op) {
case '\u2212':
return this.reportDifference(a, b);
case '÷':
return this.reportQuotient(a, b);
case '^':
return this.reportPower(a, b);
case 'mod':
return this.reportModulus(a, b);
};
};
So you want to recreate the "Variadic reporters" library
But all commutative math operators in one block, and all commutative logic operators in another block.