";
//$track_alphabet_array=array("a" => 0, "b" => 1);
$track_alphabet_array=str_split("abcdefghijklmnopqrstuvwxyz",1);
$track_alphabet=array();
foreach($track_alphabet_array as $alpha_value){
$track_alphabet[$alpha_value]='?'; //question mark null state out of I,G,P
}
$share_text_progress="";
if( is_a($select_attempts, 'SQLite3Result' ) ) {
$array_attempts = array();
while($arrayrow = $select_attempts->fetchArray(SQLITE3_ASSOC) ){
$array_attempts[]=$arrayrow;
}
//GPI class = G = correct_letter, I = incorrect_letter, P=possible_letter
foreach($array_attempts as $attempt_i) {
$attempt_chars = str_split($attempt_i['attempt_word'], 1);
$attempt_chars_state = str_split($attempt_i['character_state'], 1);
$string_letters = $string_letters."
";
//new line \n
$share_text_progress=$share_text_progress.$attempt_i['attempt_word']."%0A";
foreach($attempt_chars as $attempt_char_key => $attempt_char_value) {
$string_letters = $string_letters."".$attempt_char_value."";
if ($attempt_chars_state[$attempt_char_key] == 'G')
{
if( $track_alphabet[$attempt_char_value] !== 'G') {
$track_alphabet[$attempt_char_value]='G';
}
}
elseif ($attempt_chars_state[$attempt_char_key] == 'P')
{
if( $track_alphabet[$attempt_char_value] !== 'G') {
$track_alphabet[$attempt_char_value]='P';
}
}
elseif ($attempt_chars_state[$attempt_char_key] == 'I')
{
if( $track_alphabet[$attempt_char_value] !== 'G' || $track_alphabet[$attempt_char_value] !== 'P') {
$track_alphabet[$attempt_char_value]='I';
}
}
}
$string_letters = $string_letters."
";
}
}
$string_letters = $string_letters."
";
//draw BANNER
$string_letters = $string_letters."";
$break_counter=0;
foreach($track_alphabet as $key_alpha => $alpha_value){
$break_counter++;
$string_letters = $string_letters."".$key_alpha."";
//if($break_counter%6 == 0) {
//$string_letters = $string_letters."
";
//}
}
$string_letters = $string_letters."
";
//if correct
if($input_text_filtered == $correct_word) {
$string_letters = $string_letters."