kopia lustrzana https://github.com/backface/turtlestitch
1 wiersz
2.9 KiB
XML
1 wiersz
2.9 KiB
XML
<blocks app="Snap! 7, https://snap.berkeley.edu" version="2"><block-definition s="USE BIGNUMS %'bool'" type="command" category="operators"><comment w="303.3333333333333" collapsed="false">call with True to turn on the entire Scheme numeric tower, including infinite-precision integers, exact rationals, and complex numbers; call with False to restore native JavaScript arithmetic.</comment><header></header><code></code><translations>pt:altera utilização de aritmética do Scheme para _
ca:sistema numèric d'Scheme _
</translations><inputs><input type="%b"></input></inputs><script><block s="doApplyExtension"><l>src_load(url)</l><list><l>libraries/biginteger.js</l></list></block><block s="doApplyExtension"><l>src_load(url)</l><list><l>libraries/schemeNumber.js</l></list></block><block s="doApplyExtension"><l>src_load(url)</l><list><l>libraries/bignums.js</l></list></block><block s="doApplyExtension"><l>big_switch(bool)</l><list><block var="bool"/></list></block></script></block-definition><block-definition s="%'n' !" type="reporter" category="operators"><comment x="0" y="0" w="190.66666666666666" collapsed="false">The factorial function, to make very large numbers, to demo bignums.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportEquals"><block var="n"/><l>0</l></block><l>1</l><block s="reportProduct"><block var="n"/><custom-block s="%n !"><block s="reportDifference"><block var="n"/><l>1</l></block></custom-block></block></block></block></script></block-definition><block-definition s="%'x'" type="reporter" category="operators"><comment x="0" y="0" w="234.66666666666666" collapsed="false">The identity function: reports its input.
It's useful to get things like 3/4 or 5-2i into
numeric input slots.</comment><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doReport"><block var="x"/></block></script></block-definition><block-definition s="Scheme number %'function' of %'number'" type="reporter" category="operators"><comment w="300" collapsed="true">Provides Scheme arithmetic functions not in JavaScript</comment><header></header><code></code><translations>pt:_ de _
ca:Scheme _ de _
</translations><inputs><input type="%s" readonly="true"><options>number?
complex?
real?
rational?
integer?
exact?
inexact?
exact
inexact
finite?
infinite?
nan?
numerator
denominator
real-part
imag-part
magnitude
angle</options></input><input type="%s"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>big_scheme(fn, num)</l><list><block var="function"/><block var="number"/></list></block></block></script></block-definition></blocks> |