Visual Sequence Finding in Softanza
Softanza transforms string sequence finding in Haro language from a basic search operation into a visually rich experience. Let's explore its features through practical examples.
by Mansour Ayouni · in the repository since 2024-11-08 · feature essay · area String


Core Features
1. Basic Finding
Let's start with searching for "haro" within a jumble of letters using the straightforward Find() method, which returns the list of positions where the sequence appears:
load "stzlib.ring"
o1 = new stzString("fjharoljharodjharog")
? @@( o1.Find("haro") )
#--> [ 3, 9, 15 ]run on 2026-10-08 20:45 at commit 4a184e6f0: kept its promise
NOTE: The
@@(val)function (resembling two glasses one puts on to improve sight) returns a readable, string-based representation of the valueval, regardless of its type.
2. Visual Enhancement
We can add a visual dimension by using the viz prefix with Find(), making the positions easy to spot:
? o1.vizFind("haro")
#-->
# fjharoljharodjharog
# --^-----^-----^----run on 2026-10-08 20:45 at commit 4a184e6f0: kept its promise
3. Enhanced Visual Output
To gain even more insight, we can add the XT() suffix, providing a :Numbered guide for each matched position:
? o1.vizFindXT("haro", [ :Numbered = TRUE ])
#-->
# fjharoljharodjharog
# --^-----^-----^----
# 3 9 15run on 2026-10-08 20:45 at commit 4a184e6f0: kept its promise
NOTE: The
XT()suffix, when appended to a Softanza function, signifies an eXTended outcome of the basic feature in question. In our case, it's about providing a list of options, such as[ :Numbered = TRUE ]above, and others that we will discover later.
4. Section Finding
The FindAsSections() method (or simply FindZZ()) offers a different perspective by returning each sequence position as a pair of start and end positions:
? @@( o1.FindAsSections("haro") ) # Or simply FindZZ()
#--> [ [3, 6], [9, 12], [15, 18] ]run on 2026-10-08 20:45 at commit 4a184e6f0: kept its promise
NOTE: If you try
FindZ()instead ofFindZZ(), you'll see that bothZ()andZZ()return positions, but the first as numbers and the second as sections (pairs of numbers). Whatever your need, such smart yet powerful Softanza tiny suffixes, applied to almost any function, will have you covered!
5. Sectioned Visualization
The sections can be visualized using the :Sectioned option, which clearly shows the boundaries of each match:
? o1.vizFindXT("haro", [ :Sectioned = TRUE, :Numbered = TRUE ])
#-->
# fjharoljharodjharog
# '--' '--' '--'
# 3 6 9 12 15 18illustration
6. Full Structured Visualization
For the most sophisticated display, we can combine boxing, sectioning and numbering options to create a highly structured and detailed view:
? o1.vizFindXT("haro", [
:Boxed = TRUE,
:Rounded = TRUE,
:Sectioned = TRUE,
:Numbered = TRUE
])
#-->
╭───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───╮
│ f │ j │ r │ i │ n │ g │ l │ j │ r │ i │ n │ g │ d │ j │ r │ i │ n │ g │ g │
╰───┴───┴─•─┴───┴───┴─•─┴───┴───┴─•─┴───┴───┴─•─┴───┴───┴─•─┴───┴───┴─•─┴───╯
'-----------' '-----------' '-----------'
3 6 9 12 15 18illustration
NOTE: If you try
:NumberedXT = TRUEinstead of just:Numbered = TRUE, you'll see that the XT suffix forces the display of positions for all the characters, not just the sections defined, which can be useful in some cases.
Why It Matters
Technical Excellence
- Minimal design and execution overhead through a pure declarative experience
- Progressive visualization from basic positions to sectioned views
- Multiple representation options (positions, sections, visual markers, chars boxes)
- Flexible customization through combined options and smart defaults
Development Impact
- Debugging: Instant visual identification of sequences and their boundaries
- Analysis: Clear representation of sequence positions and sections
- Documentation: Professional, readable output with multiple visualization options
- Teaching: Intuitive demonstration of string concepts and sequence locations
Design Philosophy: The Visual Approach in Softanza
The sequence finding feature demonstrates Softanza's core design philosophy: transforming console output into meaningful visual representations. This approach:
- Makes Operations Visible: Each visualization carries clear meaning about the operation being performed - sections show boundaries, numbers provide precise positions, and box drawings create structure
- Leverages Console Power: Rich visual feedback without GUI libraries, using just ASCII and Unicode thoughtfully
- Sets a Pattern: The visual elements introduced here (markers, sections, boxes) establish a language that extends to other Softanza operations with lists, grids, and more
Conculsion
Softanza sequence finding solution showcases how console output can be both beautiful and deeply functional, making abstract algorithmic operations immediately understandable.
Cite
Mansour Ayouni. "Visual Sequence Finding in Softanza". Softanza narrations, 2024. https://mayouni.github.io/stzsite/en/narrations/stzstring-vizfind-narration.html
Run in Haro's name on 2026-10-08 20:45 inside the library at commit 4a184e6f0, block after block in one process: 4 of 6 blocks kept their promise; the others are illustrations. The code of the articles is Haro code. Where an article was written before the language took its present name, the name was changed and nothing else. Genre, area and series read from the file's name, the year from its first commit: derived, until the article carries its own header. The file on GitHub(opens in a new tab)

