Sudoku input control for vb

0 views
Skip to first unread message

Sean

unread,
Jul 1, 2007, 4:45:19 AM7/1/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Im building a sudoku solver. Im using c# for defining the class and
various functions. The numbers grid for sudoku is stored in the form
of int[3,3,3,3]

the application form i'l build by using vb. What form control should i
use to get initial values from the user?
also how can i allow the user to enter only a number from 1 to 9

Jamie Fraser

unread,
Jul 1, 2007, 5:04:46 AM7/1/07
to DotNetDe...@googlegroups.com
Should int[3,3,3,3] not be int[9,9]?

Cerebrus

unread,
Jul 1, 2007, 7:37:40 AM7/1/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Never played Sudoku (notwithstanding the current craze), so I can only
guess. How about using a textbox with input validation ? Or if you
want only numbers, you can use a NumericUpDown control and set your
max/min values.

Sean

unread,
Jul 1, 2007, 12:30:19 PM7/1/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
i would need 81 textboxes to map to my int[3,3,3,3]. that is very
tedious.

> > also how can i allow the user to enter only a number from 1 to 9- Hide quoted text -
>
> - Show quoted text -

Jamie Fraser

unread,
Jul 2, 2007, 3:53:34 AM7/2/07
to DotNetDe...@googlegroups.com
You certainly don't need to add 81 controls at design time, that would
be somewhat ridiculous.

You can dynamically create and add controls at run time, and using
something like a flowlayoutpanel or tablelayoutpanel you could get the
desired layout.

On 01/07/07, Sean <romil...@gmail.com> wrote:
>

Sean

unread,
Jul 2, 2007, 7:59:22 AM7/2/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
in vb
Dim tb(2, 2, 2, 2) As MaskedTextBox

and in c# i also hav
private int[, , ,] s = new int[3, 3, 3, 3];

i need code to dynamically add these 81 maskedtextbaxes in a
flowlayoutpanel.

what is the 'tag' property? can i use it to link a particular text box
to an array item???

On Jul 2, 12:53 pm, "Jamie Fraser" <jamie.fra...@gmail.com> wrote:
> You certainly don't need to add 81 controls at design time, that would
> be somewhat ridiculous.
>
> You can dynamically create and add controls at run time, and using
> something like a flowlayoutpanel or tablelayoutpanel you could get the
> desired layout.
>

> On 01/07/07, Sean <romil.ku...@gmail.com> wrote:
>
>
>
>
>
> > i would need 81 textboxes to map to my int[3,3,3,3]. that is very
> > tedious.
>
> > On Jul 1, 4:37 pm, Cerebrus <zorg...@sify.com> wrote:
> > > Never played Sudoku (notwithstanding the current craze), so I can only
> > > guess. How about using a textbox with input validation ? Or if you
> > > want only numbers, you can use a NumericUpDown control and set your
> > > max/min values.
>
> > > On Jul 1, 1:45 pm, Sean <romil.ku...@gmail.com> wrote:
>
> > > > Im building a sudoku solver. Im using c# for defining the class and
> > > > various functions. The numbers grid for sudoku is stored in the form
> > > > of int[3,3,3,3]
>
> > > > the application form i'l build by using vb. What form control should i
> > > > use to get initial values from the user?
> > > > also how can i allow the user to enter only a number from 1 to 9- Hide quoted text -
>

> > > - Show quoted text -- Hide quoted text -

Cerebrus

unread,
Jul 2, 2007, 8:34:17 AM7/2/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I'm sure you can have a multi-dimensional control array in .NET,
though I've never needed to create one.

The tag property lets you add any custom data to a control. Yes, you
could add an index no. from the array to the tag property, to maintain
linking.

Charles A. Lopez

unread,
Jul 2, 2007, 8:41:53 AM7/2/07
to DotNetDe...@googlegroups.com
in almost plain english
 
....1 code here
....2 code here
....3 Accept input from user
....4 Evaluate Input
....5    if input is not valid GOTO 3  // if input is not from 1..9
 
that is A correct algorithm.
I haven't answered how to accept input from the user
 
  

 
charle...@gmail.com

Is your ARM out of control? Let me FIX it for you! (e-mail charle...@gmail.com for the BEST RATES - Mention Code - ARMFIX - WSMB). - WSMB

Enterprise Managed Desktop Computing - By Charles A. Lopez (e-mail charle...@gmail.com - Mention CODE DEWEYADAMS)

Project Management - Professional Software Development - Feasibility Studies as low as $199 USD (email charle...@gmail.com mention CODE MANPOWER7)

DEVELOPERS WANTED - EMAIL WITHIN

shend...@gmail.com

unread,
Jul 4, 2007, 6:01:14 PM7/4/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
If you want to try out something new in sudoku, try shendoku, using
the sudoku rules but playing two people, one against the other, like
battleshipps. They have a free version to download at http://www.shendoku.com/sample.pdf
. Anything else they are bringing out or they are working on you can
find at www.shendoku.com or at they´r blog www.shendoku.blogspot.com .
Have fun, I am. I specially like one slogan I heard about Shendoku:
SUDOKU is like masturbation (one person).... SHENDOKU is like sex (it
takes two).

Reply all
Reply to author
Forward
0 new messages