Anonymous user
Balanced brackets: Difference between revisions
m
→{{header|VBScript}}
Line 7,970:
[[][[[[[]] is Not Balanced.</pre>
Antother version not using libraries. The generator works as intended (more difficult to do than the checking)
<lang vb>
option explicit
Line 7,978:
if bal then s="[":cnt=1 else s="":cnt=0
for i=1 to 20
next
do_brackets=s
end function
Line 7,993:
dim s1,i,cnt: cnt=0
for i=1 to len(s)
if cnt<0 then isbalanced=false:exit function
isbalanced=(cnt=0)
end function
Line 8,007:
for i=1 to 10
bal=(rnd>.5)
next
</lang>
|