INIT Section
DB_SingleLetter("A", 1);
DB_SingleLetter("B", 2);
DB_SingleLetter("C", 3);
DB_SingleLetter("D", 4);
DB_SingleLetter("E", 5);
DB_SingleLetter("F", 6);
DB_SingleLetter("G", 7);
DB_SingleLetter("H", 8);
DB_SingleLetter("I", 9);
DB_SingleLetter("J", 10);
DB_SingleLetter("K", 11);
DB_SingleLetter("L", 12);
DB_SingleLetter("M", 13);
DB_SingleLetter("N", 14);
DB_SingleLetter("O", 15);
DB_SingleLetter("P", 16);
DB_SingleLetter("Q", 17);
DB_SingleLetter("R", 18);
DB_SingleLetter("S", 19);
DB_SingleLetter("T", 20);
DB_SingleLetter("U", 21);
DB_SingleLetter("V", 22);
DB_SingleLetter("W", 23);
DB_SingleLetter("X", 24);
DB_SingleLetter("Y", 25);
DB_SingleLetter("Z", 26);
KB Section
//Function to be used elsewhere
PROC
PrintText(STRING_word)
THEN
DB_Forward(1);
DB_Backward(1);
CharacterSetVarString(CHARACTER_Player1, "DebugWord", "");
CharacterSetVarInteger(CHARACTER_Player1, "DebugLetterListIndex", 1);
Proc_FindFrequency(_word, 1);
Proc_GrowForward();
Proc_GrowBackward();
-----
//Find which letters the word contains, and then add to a temp database list
PROC
Proc_FindFrequency(STRING_word, INTEGER_index)
AND
DB_SingleLetter(_char, _index)
AND
IntegerSum(_index, 1, _nextIndex)
THEN
Proc_FindLetter(_word, _char);
Proc_FindFrequency(_word, _nextIndex);
PROC
Proc_FindLetter(STRING_word, STRING_char)
AND
StringContains(_word, _char, _output)
AND
_output > 0
THEN
Proc_AddToLetterList(_char);
PROC
Proc_AddToLetterList(STRING_char)
AND
CharacterGetVarInteger(CHARACTER_Player1, "DebugLetterListIndex", _index)
AND
IntegerSum(_index, 1, _nextIndex)
THEN
DB_TempLetterList(_char, _index);
CharacterSetVarInteger(CHARACTER_Player1, "DebugLetterListIndex", _nextIndex);
-------
//Concatenate letters with a growing word (going forward) and see if the word contains it.
PROC
Proc_GrowForward()
AND
DB_Forward(1)
THEN
NOT DB_Forward(1);
Proc_TestNextLetterForward(1);
Proc_GrowForward();
PROC
Proc_TestNextLetterForward(STRING_Word, INTEGER_index)
AND
NOT DB_Forward(1)
AND
IntegerSum(_index, 1, _nextIndex)
AND
CharacterGetVarString(CHARACTER_Player1, "DebugWord", _currentWord)
AND
DB_TempLetterList(_char, _index)
AND
StringConcatenate(_currentWord, _char, _testWord)
AND
StringContains(_Word, _testWord, _result)
AND
_result > 0
THEN
CharacterSetVarString(CHARACTER_Player1, "DebugWord", _testWord);
Proc_OutputLetter(_char, 1);
DB_Forward(1);
PROC
Proc_TestNextLetterForward(STRING_Word, INTEGER_index)
AND
IntegerSum(_index, 1, _nextIndex)
AND
DB_TempLetterList(_char, _index)
THEN
Proc_TestNextLetterForward(_Word, _nextIndex);
PROC
Proc_GrowBackward()
AND
DB_Backward(1)
THEN
NOT DB_Backward(1);
Proc_TestNextLetterBackward(1);
Proc_GrowBackward();
PROC
Proc_TestNextLetterBackward(STRING_Word, INTEGER_index)
AND
NOT DB_Forward(1)
AND
IntegerSum(_index, 1, _nextIndex)
AND
CharacterGetVarString(CHARACTER_Player1, "DebugWord", _currentWord)
AND
DB_TempLetterList(_char, _index)
AND
StringConcatenate(_char, _currentWord, _testWord)
AND
StringContains(_Word, _testWord, _result)
AND
_result > 0
THEN
CharacterSetVarString(CHARACTER_Player1, "DebugWord", _testWord);
Proc_OutputLetter(_char, 0);
DB_Backward(1);
PROC
Proc_TestNextLetterBackward(STRING_Word, INTEGER_index)
AND
IntegerSum(_index, 1, _nextIndex)
AND
DB_TempLetterList(_char, _index)
THEN
Proc_TestNextLetterBackward(_Word, _nextIndex);
------
PROC
Proc_OutputLetter(STRING_char, INTEGER_dir)
AND
_dir > 0
THEN
CharacterDisplayText(CHARACTER_Player1, _char);
PROC
Proc_OutputLetter(STRING_char, INTEGER_dir)
AND
_dir < 1
THEN
CharacterDisplayText(CHARACTER_Player1, _char);