Talk:Balanced brackets: Difference between revisions

Content added Content deleted
(→‎Extension?: Not sure it would make it better?)
Line 9: Line 9:


:The requirement for an even number of opening and closing brackets seems to be an attempt to make the random generator more likely to produce a string of balanced brackets. The algorithms used tend to end with a check that their are no un-closed brackets when you reach the end of the string so a change would not affect them. --[[User:Paddy3118|Paddy3118]] 06:35, 21 February 2011 (UTC)
:The requirement for an even number of opening and closing brackets seems to be an attempt to make the random generator more likely to produce a string of balanced brackets. The algorithms used tend to end with a check that their are no un-closed brackets when you reach the end of the string so a change would not affect them. --[[User:Paddy3118|Paddy3118]] 06:35, 21 February 2011 (UTC)

::Except the J implementation does not include the second test, since it was not asked for. (And, its an extra half dozen characters and people already sometimes complain that J is too complicated.) --[[User:Rdm|Rdm]] 13:41, 21 February 2011 (UTC)