Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,27 @@
function CheckBrackets(string s) as bool
'=======================================
sys co, le=len s
byte b at strptr s
indexbase 0
for i=0 to <le
select b(i)
case "[" : co++
case "]" : co--
end select
if co<0 then return 0
next
if co=0 then return 1
end function
'TEST
'====
print CheckBrackets "" '1
print CheckBrackets "[" '0
print CheckBrackets "]" '0
print CheckBrackets "[]" '1
print CheckBrackets "[[]" '0
print CheckBrackets "[]]" '0
print CheckBrackets "[][]"'1
print CheckBrackets "][" '0