Best shuffle: Difference between revisions

Content added Content deleted
No edit summary
m (BaCon and BBC BASIC moved to the BASIC section.)
Line 491: Line 491:


The output might change if the <tt>for (c in set)</tt> loop iterates the array in a different order.
The output might change if the <tt>for (c in set)</tt> loop iterates the array in a different order.

=={{header|BaCon}}==
=={{header|BASIC}}==
==={{header|BaCon}}===
<syntaxhighlight lang="bacon">DECLARE case$[] = { "tree", "abracadabra", "seesaw", "elk", "grrrrrr", "up", "a" }
<syntaxhighlight lang="bacon">DECLARE case$[] = { "tree", "abracadabra", "seesaw", "elk", "grrrrrr", "up", "a" }


Line 520: Line 522:
a:1
a:1
</pre>
</pre>

=={{header|BBC BASIC}}==
==={{header|BBC BASIC}}===
{{works with|BBC BASIC for Windows}}
{{works with|BBC BASIC for Windows}}
<syntaxhighlight lang="bbcbasic"> a$ = "abracadabra" : b$ = FNshuffle(a$) : PRINT a$ " -> " b$ FNsame(a$,b$)
<syntaxhighlight lang="bbcbasic"> a$ = "abracadabra" : b$ = FNshuffle(a$) : PRINT a$ " -> " b$ FNsame(a$,b$)
Line 552: Line 555:
NEXT
NEXT
= " (" + STR$(n%) + ")"</syntaxhighlight>
= " (" + STR$(n%) + ")"</syntaxhighlight>
Output (varies between runs):
{{out}} Varies between runs.
<pre>
<pre>
abracadabra -> daaracababr (0)
abracadabra -> daaracababr (0)