Yes! As you saw in the title, this is a block that can generate random numbers without using block. It generates a list with raw random numbers that can be processed to make anything random. Here are some examples:
As you can see, it doesn't generate the same number...
You can generate more than one number!
Numbers will not be repeated.
Source
Copy and Import:
<blocks app="Snap! 7, https://snap.berkeley.edu" version="2"><block-definition s="new random with length %'length'" type="reporter" category="operators"><comment w="184" collapsed="false">Creates a list with raw random numbers.</comment><variables><list struct="atomic" id="3">data</list></variables><header></header><code></code><translations></translations><inputs><input type="%n">5</input></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="data"/><l><option>list</option></l></block></block><script><block s="doSetVar"><l>data</l><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block s="reportModulus"><block s="reportPower"><block s="reportQuotient"><block var="value"/><block var="index"/></block><l>10</l></block><block s="reportDate"><l><option>time in milliseconds</option></l></block></block></autolambda><list><l>value</l><l>index</l></list></block><block s="reportAtomicMap"><block s="reifyReporter"><autolambda><block s="reportDifference"><block s="reportVariadicProduct"><list><block s="reportVariadicSum"><list><block s="reportVariadicProduct"><list><block s="reportVariadicSum"><list><block s="reportVariadicProduct"><list><block s="reportVariadicSum"><list><block s="reportVariadicProduct"><list><block s="reportVariadicSum"><list><block s="reportVariadicProduct"><list><block s="reportVariadicSum"><list><block s="reportVariadicProduct"><list><block s="reportDate"><l><option>year</option></l></block><l>365</l></list></block><block s="reportDate"><l><option>month</option></l></block></list></block><l>30</l></list></block><block s="reportDate"><l><option>date</option></l></block></list></block><l>24</l></list></block><block s="reportDate"><l><option>hour</option></l></block></list></block><l>60</l></list></block><block s="reportDate"><l><option>minute</option></l></block></list></block><l>60</l></list></block><block s="reportDate"><l><option>second</option></l></block></list></block><l>1000</l></list></block><block s="reportDate"><l><option>time in milliseconds</option></l></block></block></autolambda><list></list></block><block s="reportNumbers"><l>1</l><l>1000</l></block></block></block></block></script><comment w="87" collapsed="false">This is the list that store candidates.</comment></block><block s="doDeclareVariables"><list><l>result</l></list></block><block s="doSetVar"><l>result</l><block s="reportNewList"><list></list></block></block><block s="doWarp"><script><block s="doRepeat"><block var="length"/><script><block s="doAddToList"><block s="reportListItem"><block s="reportVariadicSum"><list><block s="reportVariadicProduct"><list><block s="reportDifference"><block s="reportQuotient"><block s="reportDate"><l><option>time in milliseconds</option></l></block><l>1000</l></block><block s="reportMonadic"><l><option>floor</option></l><block s="reportQuotient"><block s="reportDate"><l><option>time in milliseconds</option></l></block><l>1000</l></block></block></block><l>1000</l></list></block><l>1</l></list></block><block var="data"/></block><block var="result"/><comment w="106" collapsed="false">Select a candidate and collects that number.</comment></block><block s="doSetVar"><l>data</l><block s="reportModulus"><block s="reportPower"><block s="reportVariadicSum"><list><block var="data"/><block s="reportListItem"><l><option>last</option></l><block var="result"/></block></list></block><l>10</l></block><block s="reportDate"><l><option>time in milliseconds</option></l></block></block><comment w="115" collapsed="false">Replace non-selected candidates to new ones.</comment></block></script></block></script></block><block s="doReport"><block var="result"/></block></script></block-definition></blocks>
(C) 2022 ScratchModification