Hi.
For my studies i am assigned to create Sudoku as a windows form application.
For the moment, im using 2d array for the input trough textboxes. I placed 81 textboxes and im giving all lof these boxes a place in the array. My problem is that i cant loop trough the "matrix" to compare for the same row and same column line. Any help would be appriciated. Heres the code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SudokuRubil
{
public partial class Form1 : Form
{
int[,] xy = new int[9, 9]; //2d array som behållare för alla värden i sudoku
public Form1()
{
InitializeComponent();
}
//tb00 betyder textbox, siffrorna visar vilken vertikal och horisontell värde.
private void tb00_TextChanged(object sender, EventArgs e)
{
xy[0,0] = int.Parse(tb00.Text);
}
private void tb10_TextChanged(object sender, EventArgs e)
{
xy[1, 0] = int.Parse(tb10.Text);
}
private void tb01_TextChanged(object sender, EventArgs e)
{
xy[0,1] = int.Parse(tb01.Text);
}
private void tb11_TextChanged(object sender, EventArgs e)
{
xy[1, 1] = int.Parse(tb11.Text);
}
private void tb21_TextChanged(object sender, EventArgs e)
{
xy[2, 1] = int.Parse(tb21.Text);
}
private void tb22_TextChanged(object sender, EventArgs e)
{
xy[2, 2] = int.Parse(tb22.Text);
}
private void tb12_TextChanged(object sender, EventArgs e)
{
xy[1, 2] = int.Parse(tb12.Text);
}
private void tb02_TextChanged(object sender, EventArgs e)
{
xy[0, 2] = int.Parse(tb02.Text);
}
private void tb20_TextChanged(object sender, EventArgs e)
{
xy[2, 0] = int.Parse(tb20.Text);
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}