##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: September, 2016 # Modified: 2016-10-03/22:38-0400 ##+ # # bal.icn, demonstrate the string scanning bal() function # procedure main() L := list() s := "(1 + 2) * ((3 + 4) * 5) - 6" carets := repl(" ", *s) # simple write("scanning: ", image(s), " with bal()") s ? every write(bal()) # nicely formatted for visual effect s ? every carets[bal()] := "^" write() write(s) write(carets) end