Divide the word Dangerous into syllabes
(sounds like a school assignment to me) ;-)
-count (& save) the 3 characters (1st syllable).
-start at position 4 (3+1 chars) in the string.
-count (& save) the 3 characters (2nd syllable).
-start at position 7 (6+1 chars) in the string.
-count (& save) the 3 characters (3rd syllable).
Logic:
-Initialize syllable-counter (x) to 1, position-counter to 1 (z).
-Initialize syl(x) strings to Null, where x = 1 to 3.
-Assign "dangerous" to string variable.
z = 1
y = 1
x = 1
string = "DANGEROUS"
For x = 1 to 3 DO
*Comment. read 3 chars (in a loop), add them to Syl (x).
For y = 1 to 3 DO
read a char(y) from the string at position-counter(z)
syl(x) = syl(x) + char(y)
z = z + 1
END DO
END DO
NOTE: not 100%, but close.
×