I've built 3x3 Tic Tac Toe, and there was slight problem with "if" lines. There are 8 winning lines where I need to check if there is a victory. But, there is more than 100 winning lines for 5x5, where 3 in a row - wins. Can anyone help me how to solve this? I could probably work it out how to solve it with two dimensional arrays, but it's 5x5 with buttons. So I've used so far something like:

if (button1.Text=button2.Text...)

Two dimensional arrays of objects for test, and connect them to my buttons maybe?

You could use:

Button[,] TwoDbuttonMatrix = new Button[5,5];

Don't forget to create a new button in this 2D array of buttons!
Succes!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.