Development 03 Apr 2018
Completed setting up such that it does one time hint processing based on the difficulty level selected. Solved a bug where app freezes on difficulty level 100%.
Difficulty level 100 bug:
NumberOfBlankos = DifficultyLevel * TotalNumOfChars / 100 ;
Initially thought it's a division error , or something along that line. So I went ahead and try different ways to calculate NumberOfBlankos. Tried type casting (integer, float), Math.Round, Catching Lvl 100 case, but all scenario seemed to produce the same result of a Frozen App.
The main problem comes in where I have a implemented check in the form of while-loop somewhere lower down in my codes, that says check again if the generated position (in this case position 0) has already been generated before - to avoid generating e.g. 2 times blanks at the same location. However, position 0 is already inside, hence my App went into an Infinite-loop, freezing up and have to restart to continue testing.
Once problem is clearly identified... solution is almost not worth mentioning...
Back to Progress:
1. Integrate the blank codes (main game engine) - Done
2. Replace the original hint in background with the processed duplicate (the one with blanks)- Done
3. Hook up the page navigation system (verify all NEXTs and PREVs, add functionality to jump page - already done in Study Mode)
4. Create a new list of String to store input contents in pages (store the answer that user inputs for tabulation of score, reviewing of answer, and simply if user wants to jump from page to page before submitting his whole answer).
Difficulty level 100 bug:
NumberOfBlankos = DifficultyLevel * TotalNumOfChars / 100 ;
Initially thought it's a division error , or something along that line. So I went ahead and try different ways to calculate NumberOfBlankos. Tried type casting (integer, float), Math.Round, Catching Lvl 100 case, but all scenario seemed to produce the same result of a Frozen App.
Level 100 too hard for computer to process XD (Joking)
So I had to look somewhere else. This time really step into the debugger to trace individual values as and when they are populated. It's here that I realise that all values in my BlankoPositions[] (Integer Array) are by default 0s (it's how C# works, different from C++) . And that a 100% difficulty will have to use all positions, including position 0.The main problem comes in where I have a implemented check in the form of while-loop somewhere lower down in my codes, that says check again if the generated position (in this case position 0) has already been generated before - to avoid generating e.g. 2 times blanks at the same location. However, position 0 is already inside, hence my App went into an Infinite-loop, freezing up and have to restart to continue testing.
Once problem is clearly identified... solution is almost not worth mentioning...
Back to Progress:
1. Integrate the blank codes (main game engine) - Done
2. Replace the original hint in background with the processed duplicate (the one with blanks)- Done
3. Hook up the page navigation system (verify all NEXTs and PREVs, add functionality to jump page - already done in Study Mode)
4. Create a new list of String to store input contents in pages (store the answer that user inputs for tabulation of score, reviewing of answer, and simply if user wants to jump from page to page before submitting his whole answer).


Comments
Post a Comment