realbasic-games
[Top] [All Lists]

Re: Advice Wanted for Sudoku Analyzer

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Advice Wanted for Sudoku Analyzer
From: Barry Traver <rb at ix dot netcom dot com>
Date: Sun, 20 Nov 2005 08:12:25 -0500
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <20051119180036 dot 0CD67EB3AB6 at lists dot realsoftware dot com> <33cbfa100511191831h1812c21kc8c8bc2d33b89002 at mail dot gmail dot com> <4380101E dot 7070307 at ix dot netcom dot com> <438066E8 dot 3070706 at optonline dot net>
Daniel,

You could use a control array, but I think the easiest option is to "cheat" and use a canvas.
Use the keydown event to read the number they input.

Sounds like a great idea! Believe it or not, I've never worked with a canvas before. Let me think out loud for a moment.

I want someone to be able to click on a square and then type the number he wants in that particular square. Since I can get the location of the mouse-click, I can have the program calculate the coordinates of that square accordingly and then use the information from the number he or she types in order to know what number to print at that location. (When someone mouse-clicks at a certain location, I could even have the outline of the square "blink" - using a timer control - so that the user will have a visual clue as to where the number will be placed.)

I have a question, however. Whatever gets printed, I assume, stays printed unless erased. If there is already a "5" at a particular location and I then print an "8" at that location, the result, I think, would be an "8" printed on top of the "5" already there, making a mess, right? (After all, it's a piece of the canvas, not an EditField.) What would be a good way to _erase_ whatever number may already be written in a square at a particular location?

Barry Traver


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>