ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > N.A.N.Y. 2012

NANY 2012 Release: Kyrathaba's Hangman

<< < (17/28) > >>

kyrathaba:
Tonight I will save the phrases in Latin vs UTF8, and will do an update.

kyrathaba:
Welcome to djwillie, our 46th competitor to join the NANY 2012 Hangman Highscore Contest.

Only a small fraction of the competitors appear to be DonationCoder members. Remember, only members can win prize money.

steeladept:
Finally downloaded and started to play my first game and got an error right off the bat...

Don't know if it will help, but this is the error details (error screenshot attached at bottom):

DetailsSee the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at Kyrathasoft.Hangman.hangman.setRegularThemedPuzzle()
   at Kyrathasoft.Hangman.hangman.randomlySetSelectedPuzzle()
   at Kyrathasoft.Hangman.hangman.setSelectedPuzzleForIndividualWord()
   at Kyrathasoft.Hangman.hangman.selectIndividualWordOrPhraseAsPuzzle()
   at Kyrathasoft.Hangman.hangman.startNewGame()
   at KyrHangman.Form1.instantiateAndRunGame()
   at KyrHangman.Form1.gameStartAttempt()
   at KyrHangman.Form1.toolStripMenuPlay_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.MenuStrip.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.235 (RTMGDR.030319-2300)
    CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
KyrHangman
    Assembly Version: 1.0.4.0
    Win32 Version: 1.0.4.0
    CodeBase: file:///C:/Program%20Files/Kyrathasoft/KyrHangman/KyrHangman.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.235 built by: RTMGDR
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.232 built by: RTMGDR
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
kyr
    Assembly Version: 1.0.2.3
    Win32 Version: 1.0.2.3
    CodeBase: file:///C:/Program%20Files/Kyrathasoft/KyrHangman/kyr.DLL
----------------------------------------
KyrHangmanLib
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/Kyrathasoft/KyrHangman/KyrHangmanLib.DLL
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.




EDIT - I continued and after the second game ended the third game came up with the same error (perhaps it is the particular puzzle chosen?).  Anyway, I got the error and when I hit continue, it let me try continue with the game, but it didn't clear the old solution to present the new puzzle.  However, when I tried the answer for the old puzzle, it failed, so it at least loaded a new one, just isn't displaying it. Wrong - just noticed it is the old puzzle.  All the letters are already gone, but it is asking for the new ones.  Enter a blank and it is a bad guess just like a wrong letter.

steeladept:
Another bug I am finding is not all letters show from puzzle to puzzle.  They are not selected, but they are not listed if you are a mouse user.  And if you type the letter in the box (or highlight the carrot and type it in) then the letter works and shows in the right places, but the letter shows twice in the guess box.  Not an issue in processing (it works right), just an observation.

Another observation - especially during timed games - keyboard input is MUCH Better! :P

Perhaps in a future revision you can consider tracking if input was via mouse or keyboard to differentiate high scores?  I am not a mouse person in general, but when checking stuff out like this I find that is where most things break (at least in my programs). 

kyrathaba:
@steeladept:

Thanks for downloading and playing!  I'm sorry that it messed up for you, and thank you so much for the bug report!

the third game came up with the same error (perhaps it is the particular puzzle chosen?).
--- End quote ---


I am thinking that, because the game works without this error for many puzzles, it must be that some particularly long puzzles are causing this.  I've changed the maximum phrase length from 300 to 400, and I'm adding some error-catching to suspect methods:


--- ---public const int MaxPhraseLength = 400;

--- ---            } catch (Exception loadHangFileException) {
                MessageBox.Show("Error in method loadHangmanFile()", loadHangFileException.Message);
            }


--- ---            } catch (Exception instantAndRunEx) {
                MessageBox.Show("Error in method instantiateAndRunGame()", instantAndRunEx.Message);
            }


but the letter shows twice in the guess box
--- End quote ---

I've updated the guess-handling code to check and see if the correct or wrong guess is already shown (this should prevent duplicates; let me know if any continue to happen):


--- ---        private void addWrongGuess(string wrongGuess) {
            if (!WrongGuesses.Contains(wrongGuess)) {
                _wrongGuesses += wrongGuess;
            }
        }

        private void addUsedGuess(string usedGuess) {
            if (!UsedGuesses.Contains(usedGuess)) {
                _usedGuesses += usedGuess;
            }
        }


Another bug I am finding is not all letters show from puzzle to puzzle.  They are not selected, but they are not listed if you are a mouse user.
--- End quote ---

I think this is a control-repainting issue.  When this happens, try scrolling the vertical scrollbar the entire extent of the combobox and see if the letters don't seem to magically reappear.  I'm working on a fix for this.

Perhaps in a future revision you can consider tracking if input was via mouse or keyboard to differentiate high scores?
--- End quote ---


I've noted the suggestion for a possible future version, and thanks!

 I am not a mouse person in general, but when checking stuff out like this I find that is where most things break (at least in my programs).
--- End quote ---

+1.


Summary: hopefully, the 100-character increase in maxPhraseLength will fix the most glaring error.  However, I've added error-handlers to a couple of highly suspect methods, which will pop up a much more info-rich messagebox and help me track down the bug, if it persists.  Hopefully, the extra checking I've added to the missed versus correct guesses will solve that annoying bug too.  Thanks again for taking the time to post, steeladept, and please let me know the results if you update to v1.0.4.1.  You can update to the new version from within the program: "About"->"Update".

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version