Well, complex numbers trigonometry is now available to Super-Snap!, there are more mathematical constants, the integral block (not at all but works as my CASIO), adding the backpack and made the flag, the gear symbol and the globes symbols to be more beauty, (the flag looks like Scratch 2.0). :~)
This is my cooler CASIO calculator, I do a photo of that lil' thing in my house. The calc is sleeping. :~)
If you are interested in getting the cute symbols, just copy the code like an userscript. :~)
SymbolMorph.prototype.renderSymbolFlag = function (ctx, color) {
// draw a flag
var w = this.symbolWidth(),
h = this.size,
l = Math.max(w / 12, 1);
ctx.lineWidth = l;
ctx.strokeStyle = color.toString();
ctx.beginPath();
ctx.moveTo(l * 2, 0);
ctx.lineTo(0, h);
ctx.stroke();
ctx.lineWidth = h / 2;
ctx.beginPath();
ctx.moveTo(w / 8, h / 4);
ctx.bezierCurveTo(
w / 1.25,
h / 2,
w / 2,
h / 2,
w,
h / 2
);
ctx.stroke();
};
SymbolMorph.prototype.renderSymbolGears = function (ctx, color) {
// draw gears
var w = this.symbolWidth(),
r = w / 2,
e = w / 8;
ctx.strokeStyle = color.toString();
ctx.lineWidth = this.symbolWidth() / 4;
ctx.beginPath();
ctx.arc(r, r, w, 0, radians(360), true);
ctx.arc(r, r, e * 2, 0, radians(360), false);
ctx.closePath();
ctx.clip();
ctx.moveTo(0, r);
ctx.lineTo(w, r);
ctx.stroke();
ctx.moveTo(r, 0);
ctx.lineTo(r, w);
ctx.stroke();
ctx.moveTo(e, e);
ctx.lineTo(w - e, w - e);
ctx.stroke();
ctx.moveTo(w - e, e);
ctx.lineTo(e, w - e);
ctx.stroke();
};
SymbolMorph.prototype.renderSymbolGlobeBig = function (ctx, color) {
this.renderSymbolGlobe(ctx, color, true);
};
SymbolMorph.prototype.renderSymbolGlobe = function (ctx, color, detailed) {
// draw a stylized globe
var w = this.symbolWidth(),
l = Math.max(w / 30, 0.5);
ctx.strokeStyle = color.toString();
ctx.lineWidth = l * 2;
ctx.beginPath();
ctx.arc(w / 2, w / 2, w / 2 - l, 0, radians(360), false);
ctx.stroke();
if (detailed) {
ctx.moveTo(l * 4, w / 5);
ctx.lineTo(w - l * 4, w / 5);
ctx.stroke();
ctx.moveTo(w / 2, 0);
ctx.lineTo(w / 2, w);
ctx.stroke();
ctx.moveTo(l * 4, w * 4 / 5);
ctx.lineTo(w - l * 4, w * 4 / 5);
ctx.stroke();
};
// single line version, looks better when small:
ctx.beginPath();
ctx.moveTo(w / 2, l / 2);
ctx.arcTo(0, w / 2, w / 2, w, w * 2 / 3);
ctx.stroke();
ctx.beginPath();
ctx.moveTo(0, w / 2);
ctx.lineTo(w, w / 2);
ctx.stroke();
ctx.beginPath();
ctx.moveTo(w / 2, l / 2);
ctx.arcTo(w, w / 2, w / 2, w, w * 2 / 3);
ctx.stroke();
};
SymbolMorph.prototype.renderSymbolTick = function (ctx, color) {
// draw a check mark
var w = this.symbolWidth() / 3;
ctx.strokeStyle = color.toString();
ctx.lineWidth = Math.max(w / 20, 0.5) * 2;
ctx.lineCap = 'round';
ctx.lineJoin = 'miter';
ctx.beginPath();
ctx.moveTo(0.5 * w, 1.5 * w);
ctx.lineTo(1.5 * w, 2.5 * w);
ctx.lineTo(2.5 * w, 0.5 * w);
ctx.stroke();
};
For now, the integral's code is here to be in good hands. :~)
SpriteMorph.prototype.blocks.reportIntegral = {
type: 'reporter',
category: 'operators',
spec: '⌠ %n %br ⎮ \[ %n \( x ^ %n \) \] dx %br ⌡ %n'
};
Process.prototype.reportIntegral = function anonymous (a, b, c, d) {a = +a; b = +b; c = +c; d = +d; return Process.prototype.reportBasicQuotient(Process.prototype.reportBasicProduct(b, Process.prototype.reportBasicDifference(Process.prototype.reportBasicPower(a, Process.prototype.reportBasicSum(c, 1)), Process.prototype.reportBasicPower(
d, Process.prototype.reportBasicSum(c, 1)))), Process.prototype.reportBasicSum(c, 1));};
But if you want the integral as a custom block, just think to see its definition, here:
Or copy it as XML too:
<blocks app="Snap! 9.0, https://snap.berkeley.edu" version="2"><block-definition s="⌠ %'a' $nl ⎮ [ %'b' ( x ^ %'c' ) ] dx $nl ⌡ %'d'" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportQuotient"><block s="reportVariadicProduct"><list><block var="b"/><block s="reportDifference"><block s="reportPower"><block var="a"/><block s="reportVariadicSum"><list><block var="c"/><l>1</l></list></block></block><block s="reportPower"><block var="d"/><block s="reportVariadicSum"><list><block var="c"/><l>1</l></list></block></block></block></list></block><block s="reportVariadicSum"><list><block var="c"/><l>1</l></list></block></block></block></script></block-definition></blocks>