Inventory sequence: Difference between revisions

(Added Quackery.)
 
Line 624:
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery"> [ 0 unrot witheach
[ over 0 unrot=
rot [ dip 1+ ]swap ]
witheach
drop join ] is countemoccurs ( [ n [ --> [n )
[ over = if
[ dip 1+ ] ]
drop join ] is countem ( [ n --> [ )
 
0[ temp2dup putoccurs
tuck join
[]
dip [ 0 != tuck * + ] ] is additem ( n [ --> n [ )
4000 times
 
[ temp share countem
0 [] 100 times additem
dup -1 peek 0 >
temp over iff
tally else replace ]
temp release
witheach
[ dup 10 < if sp
echo sp
i^ 4010 mod 399 = if cr ]
drop
cr
0 temp put[]
[] additem
dup -1 peek 0999 >
[ temp share countem
dupuntil -1 peek 0 >]
temp over iff
tally else replace
dup -1 peek 999 > until ]
temp release
say "Element #"
dup size 1 - echo
say " is "
-1 peek 1 - echo
say "."</syntaxhighlight> cr
drop</syntaxhighlight>
 
{{out}}
Line 672 ⟶ 665:
 
Element #24255 is 1001.</pre>
 
 
=={{header|Raku}}==
1,496

edits