>>10
That's not optimized. It might push the same code twice, causing the unpleasant effect of several words in a row having the same formatting. Please fix it by ensuring that two redundant codes can't exist in the stack at the same time.
Please avoid calling rand() multiple times until you find a suitable code. Moreover, don't call rand() if some overriding condition is met ((pushed == 0) and (pushed > 4) in your code).
That's not optimized. It might push the same code twice, causing the unpleasant effect of several words in a row having the same formatting. Please fix it by ensuring that two redundant codes can't exist in the stack at the same time.
how would you handle something like [m]a [aa]b [m]c[/m] d[/aa] e[/m]?
anyway, here's a better one: /* Copyright (c) 2008 Anonymous
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that you grant this
* same permission to anyone you distribute it to without any additional
* restrictions.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
>>10 >>13
These both suck some long Sussman'.
You really should implement a more probabilistic model rather than just using plain randomness for everything. (i.e.: nest depth of tags effects chance of escaping tags or increasing nest dept, && certain random patterns that have already occured should be more likely to reoccur.
You really should implement a more probabilistic model rather than just using plain randomness for everything. (i.e.: nest depth of tags effects chance of escaping tags or increasing nest dept, && certain random patterns that have already occured should be more likely to reoccur.
that's great if you want to get the same five patterns over and over again instead of coming up with new ones.
Name:
Anonymous2009-03-20 20:20
Haveyougeneratedyourrandom BBCode today?
Name:
Anonymous2009-03-20 20:27
Yes, indeed. I actually have. Was a great experience.
Name:
Anonymous2009-03-20 20:28
ITT: OPTIMIZING BBCODE GENERATORS THAT TAKE NANOSECONDS TO RUN.
Name:
Anonymous2009-03-20 20:29
I'm glad to hearthat. HAND.
Name:
Anonymous2009-03-20 20:33
>>15
...You don't undertand the word 'probabilistic' do you? It does not mean deterministic, it simply means weighted randomness. So you dont end up with shit like >>16