Balanced brackets: Difference between revisions
m
→{{header|RPL}}: reformatting
(GDScript) |
m (→{{header|RPL}}: reformatting) |
||
Line 6,760:
=={{header|RPL}}==
{{works with|Halcyon Calc|4.2.7}}
≪
1 OVER SIZE
'''WHILE''' DUP2 * 0 > '''REPEAT'''
3 PICK OVER DUP SUB
'''IF''' "[]" SWAP POS '''THEN'''
LAST 2 * 3 - ROT + SWAP '''END'''
1 -
'''END''' DROP
1 SAME "" "Not " '''IFTE''' "OK" +▼
≫ ''''BALBKT'''' STO
▲ 1 SAME "" "Not " IFTE
≪ { "" "[]" "[][]" "[[][]]" "][" "][][" "[]][[]" } → ts
≪
1 ts SIZE '''FOR''' j
ts j GET '''BALBKT''' " → " SWAP + + '''NEXT'''▼
≫ ≫ ''''TASK'''' STO
▲ ts j GET BALBKT " → " SWAP + +
{{out}}
<pre>
" → OK"
"[] → OK"
|