Talk:Dutch national flag problem: Difference between revisions
Content added Content deleted
(fix another problem) |
|||
Line 9: | Line 9: | ||
Please ensure that entries check for this too. (J language?). --[[User:Paddy3118|Paddy3118]] 22:01, 1 July 2012 (UTC) |
Please ensure that entries check for this too. (J language?). --[[User:Paddy3118|Paddy3118]] 22:01, 1 July 2012 (UTC) |
||
:That's a low probability event for any reasonably sized collection of balls, so I did it manually in the example. If you want it automatic, replacing ? with (3||.@ |
:That's a low probability event for any reasonably sized collection of balls, so I did it manually in the example. If you want it automatic, replacing ? with (3||.@/:)^:(-:/:~)@:? will work unless the user tries to generate a selection of only one random ball. --[[User:Rdm|Rdm]] 00:58, 2 July 2012 (UTC) |
Revision as of 01:09, 2 July 2012
Flag request
This task needs a picture of the Dutch national flag. --Paddy3118 09:34, 1 July 2012 (UTC)
Algorithms
I kinda ducked the issue of optimized algorithms in favour of giving an answer in keeping with how things would be done idiomatically in a language. This shouldn't stop those who want to give famous algorithms as well though. --Paddy3118 09:34, 1 July 2012 (UTC)
"ensuring that they are not in the order of the Dutch national flag"
Please ensure that entries check for this too. (J language?). --Paddy3118 22:01, 1 July 2012 (UTC)
- That's a low probability event for any reasonably sized collection of balls, so I did it manually in the example. If you want it automatic, replacing ? with (3||.@/:)^:(-:/:~)@:? will work unless the user tries to generate a selection of only one random ball. --Rdm 00:58, 2 July 2012 (UTC)