Rocky Smolin at Beach Access Software
rockysmolin at bchacc.com
Sun Mar 9 10:12:08 CDT 2008
A: We used arrays. I'll send you our mdb off-line - maybe give you some ideas - with the caveat that it's not working correctly at this point. Rocky -----Original Message----- From: dba-tech-bounces at databaseadvisors.com [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Sunday, March 09, 2008 7:28 AM To: Discussion of Hardware and Software issues Subject: Re: [dba-Tech] VS.NET equivalent of single-row form There's an intermediate table which I populate with a bunch of rows corresponding to the available numbers (unused) and a row-column designator. The number of rows manufactured for this table depends on the number of numbers supplied in the problem, obviously. From there, a series of elaborate joins to the Problem table's row eventually results in a solution. Arrays are obviously a much more efficient approach (one for each sub-square and a big one corresponding to my intermediate table), but I wanted to see if I could do it in TSQL alone. Now that I have proved that I can, I will eventually get around to doing it the "right" way. But I need to do a few more things to this program to make it presentable, first. When I've got the first version done, I'll post it, and then set to work on the array-version. A. On 3/9/08, Rocky Smolin at Beach Access Software <rockysmolin at bchacc.com> wrote: > > Interesting. I started writing one with Noah (my younger son) but > never finished it. We were using a brute force method of initializing > each of the squares with all nine numbers and eliminating > possibilities based on various rules. Got about half way there before > other stuff got in the way and we never finished it. > > What methods are you using to solve the puzzle? > > > Rocky > > > > > > > > > -----Original Message----- > From: dba-tech-bounces at databaseadvisors.com > > [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Arthur > Fuller > Sent: Sunday, March 09, 2008 6:53 AM > To: Discussion of Hardware and Software issues > Subject: Re: [dba-Tech] VS.NET equivalent of single-row form > > > I'm making big progress on this little toy! I'm writing a Sudoku > problem solver. Actually I have already written the solver code -- in > TSQL no less LOL), and I just need a test and display harness for it. > I've tracked down some allegedly difficult problems and the hardest > one I've found so far takes under 3 minutes to solve. No doubt the > code can be optimized significantly, but I wanted to see whether I > could do it in TSQL rather than simply using arrays, which would > obviously be way more efficient. > > Anyway, here's my current problem: I have a pair of forms, almost > identical. > One addresses the Problems table, the other the Solutions table. The > Problems table has an Identity key. The stored procedure that does all > the magic creates a row in the Solutions table having the FK pointing > to the problem it solves. > > I have a button on the Problems form that opens the Solutions form. I > need to pass it the ProblemID and have it do one of two things: > > 1. If the solution exists, open the form and display it. > 2. If the solution doesn't exist, solve the problem, then open the > form and display the solution. > > There is a potential wrinkle down the road, but I'm prepared to > postpone that part of the problem. (A given problem could have more > than one solution; this is generally considered bad form in posing the > problem in the first place, but that aside....) > > Actually, there is a second problem, too, which I have thus far > avoided because I'm taking my problems from web sites and newspapers, > so they all contain problems with solutions. But in theory, a problem > could be posed that obeys the setup rules but has no solution. So > eventually I will need a timer so I stop looking after a while. I > think. I'm not sure whether I can prove that problem X is unsolvable, > but that can wait for a while too. > > Anyway, I'm way ahead of myself here. I just need to open the Solution > form on the right solution (identified by ProblemID), and to detect > before I open the form whether there is a solution -- a simple SELECT > COUNT(*) but I'm not sure how to code that and obtain the result in a > variable for inspection so I can act accordingly. > > One more question: can I mix languages in a single module? e.g. write > one method in C# and another in VB and a third in Python? Not that I'd > want to, necessarily, it's more a theory question. > > TIA, > Arthur > > On 3/9/08, Arthur Fuller <fuller.artful at gmail.com> wrote: > > > > C# but I found it already. But I am going to do some parts of this > > thing in Python, if only for the exercise. I've been teaching myself > > Python, and have installed Iron Python, but haven't tried it out yet > > to explore the differences between it and classic Python. > > A. > > > > On 3/9/08, Rocky Smolin at Beach Access Software > > <rockysmolin at bchacc.com> > > wrote: > > > > > > Are you using VB.NET? ASP.NET? Something else? > > > > > > Rocky > > > > > > > > > _______________________________________________ > dba-Tech mailing list > dba-Tech at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-tech > Website: http://www.databaseadvisors.com > > No virus found in this incoming message. > Checked by AVG. > > Version: 7.5.518 / Virus Database: 269.21.7/1319 - Release Date: > 3/8/2008 > 10:14 AM > > > > _______________________________________________ > dba-Tech mailing list > dba-Tech at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-tech > Website: http://www.databaseadvisors.com > _______________________________________________ dba-Tech mailing list dba-Tech at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-tech Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG. Version: 7.5.518 / Virus Database: 269.21.7/1319 - Release Date: 3/8/2008 10:14 AM