Jump to content

Balanced brackets: Difference between revisions

(L++)
Line 1,197:
#define system'routines.
#define extensions.
 
// --- RandomBrackets ---
 
#symbol randomBrackets = (:aLength)
Line 1,203 ⟶ 1,205:
? [ emptyLiteralValue ]
! [
#var aBrackets := arrayControl new &length:aLength &each: i[ CharValue new:91 ] + arrayControl new &length:aLength &each: i[ CharValue new:93 ].
new &length:aLength &each: i[ CharValue new:91 ] + arrayControl new &length:aLength &each: i[ CharValue new:93 ].
randomControl randomize:(aLength * 2) &array:aBrackets.
Line 1,219 ⟶ 1,222:
^ (0 == aCounter).
].
 
// --- Program ---
 
#symbol program =
Line 1,231 ⟶ 1,236:
 
console readChar.
].</lang>
</lang>
 
=={{header|Erlang}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.