Function Divvy
switch($jcode) { case (1) : // Show next character, no more. This is like a hint function. echo "








"; if ($last_line == "") { echo "ZZZ"; $last_line = 1; $last_word = 1; $last_char = 1; } else { if ($last_char == "") // Previous Jump was NOT letter-by-letter, so go to next word and show 1-2-3 letters. { echo "XXX"; get_next_word(&$last_line, &$last_word, $ltot, $vtots); $last_char = 1; } else // Previous Jump WAS letter-by-letter, so show next 1-2-3 letters, which may or may not mean a new word. { echo "YYY"; get_next_letter(&$last_line, &$last_word, &$last_char, $ltot, $texts, $vtots, $vlens); } } break; case (2) : // Advance to next syllable. Still to be coded. case (3) : // Advance to next word. get_next_word(&$last_line, &$last_word, $ltot, $vtots); break; case (4) : // Show rest of this line of verse. Advance to end of line. (Should this be a clausula in prose?!?) if ($last_word == $vtots[$last_line]) ++$last_line; $last_word = $vtots[$last_line]; // This will be 1 higher if previous 'if' was TRUE. break; case (5) : // Show rest of this clause, or whole next one. Advance to next , ; : . ? ! case (6) : // Show rest of this sentence, or whole next one. Advance to next . ? ! $foundit = FALSE; while (!$foundit && $last_line < $ltot) { get_next_word(&$last_line, &$last_word, $ltot, $vtots); $sl = strlen($texts[$last_line]) - 1; if ($last_word == $vtots[$last_line]) { if ($texts[$last_line][$sl] == '.' || $texts[$last_line][$sl] == '?' || $texts[$last_line][$sl] == '!') $foundit = TRUE; if ($jcode == 5 && ($texts[$last_line][$sl] == ',' || $texts[$last_line][$sl] == ';' || $texts[$last_line][$sl] == ':')) $foundit = TRUE; } else { $ch = strnpos($texts[$last_line], ' ', $last_word) - 1; // Need to look at the character before the space. if ($texts[$last_line][$ch] == '.' || $texts[$last_line][$ch] == '?' || $texts[$last_line][$ch] == '!') $foundit = TRUE; if ($jcode == 5 && ($texts[$last_line][$ch] == ',' || $texts[$last_line][$ch] == ';' || $texts[$last_line][$ch] == ':')) $foundit = TRUE; } } if (!$foundit) // Go to end of poem - which should have some punctuation, so isn't this redundant? No! A slice of (e.g.) Lucan may end mid-sebtence. { $last_line = $ltot; $last_word = $vtots[$ltot]; } break; case (7) : // Show rest of this paragraph or stanza, or whole next one. Advance to next + or (for Horace) next line numbered 4n + 1. ++$last_line; while ($last_line % 4 != 0) ++$last_line; $last_word = $vtots[$last_line]; break; }

I: Select an Author

Author: