Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


HELP NEEDED IN SUDOKU !!! in C #


HELP NEEDED IN SUDOKU !!! in C #

Author
Message
juve10
juve10
Forum God
Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)

Group: Forum Members
Posts: 2, Visits: 37
I'm stucked

this is what I've done until now...

can anyone help

using System;public class Sud {   public static void Main() 
{      int[,] sudoku = new int[9,9];            Console.WriteLine("Enter the 9x9 Sudoku solution: ");
      string line;      char[] delims = {' '};      for (int i = 0; i < 9; i++) {         line = Console.ReadLine();         string[] tokens = line.Split(delims);         for (int j = 0; j < 9; j++) {            if (tokens[j] == "_") {               sudoku[i,j] = 0;            }            else {               sudoku[i,j] = Convert.ToInt32(tokens[j]);            }         }      }      Console.WriteLine();            
Guys,
 
the sudoku array holds the beginning puzzle      an entry is 0 if it is blank, otherwise it has a 1-9 value             Now, I want to print the available "moves" for each blank spot      
 

juve10
juve10
Forum God
Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)Forum God (782 reputation)

Group: Forum Members
Posts: 2, Visits: 37
this looks nicer
using System;
 
public class sud 
public static void Main(){
 
 int[,] sudoku = new int[9,9];
 
Console.WriteLine("give the 9x9 solution: ");
 
string line;
 
char[] delims = {' '};for (int i = 0; i < 9; i++) {line = Console.ReadLine();string[] tokens = line.Split(delims);
 
for (int j = 0; j < 9; j++) {if (tokens[j] == "_") {sudoku[i,j] = 0;}
 
else {sudoku[i,j] = Convert.ToInt32(tokens[j]);
}}}Console.WriteLine();
 
 

GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search