Largest five adjacent number: Difference between revisions

Added Quackery.
(Added Quackery.)
Line 577:
Smallest 5-adjacent number found 35
</pre>
 
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery"> 9 random 1+
999 times [ 10 * 10 random + ]
dup 10 995 ** / swap
say "1000 digit number"
cr cr
dup echo
cr cr
[] swap 1000 times
[ 10 /mod
rot join swap ]
drop dup
0 0 rot witheach
[ swap 10 *
100000 mod +
tuck max swap ]
drop
say "largest 5 adjacent digits " echo
cr cr
5 split nip
dip dup witheach
[ swap 10 *
100000 mod +
tuck min swap ]
drop
say "smallest 5 adjacent digits "
number$
char 0 over size 5 swap - of
swap join echo$</syntaxhighlight>
 
{{out}}
 
<pre>1000 digit number
 
6840907174710710253578773992410923828010161316527489025709598588564725782830158923520744533291356763925463645174705745049218864529135157750600471363289558510223445011025163844199130052941524405130793922050669143532883592357897096269697903780509770222546659289832999639637730759831717125055857319129937934353617386529810429642261048827016148476352187592939822910964334104828550764225596939965675519243696921514153715258715961987394884393797714002723369560598384723111928648279375269590756880538160907807290640466592734345970439851284217252141914792365031610947925633607292897379320456985054219371373707477609843617810620097343420379245258762479642377134776965386535533204636182773979582543243782455626021964121509778973939346873293400502531060571761381532229278485105166678017234489439222625767334040651185482277484204647473910364297105035077787620562600454016296114868335345408156093266755340971022669397814048919735693462065796634326535292979494128432997646841467835174156471055078228524511787150409
 
largest 5 adjacent digits 99963
 
smallest 5 adjacent digits 00272</pre>
 
=={{header|Raku}}==
1,462

edits