Sudoku Programmers Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in          Games  Calendar

Log in to check your private messagesLog in to check your private messages   

Possible numbers in Java

 
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Solving sudoku
View previous topic :: View next topic  
Author Message
andyp1983

Joined: 26 Feb 2010
Posts: 2
:

Items
PostPosted: Fri Feb 26, 2010 11:36 am    Post subject: Possible numbers in Java Reply with quote

Is it possible to have 2 int arrays

int [][] grid = new int [9][9]
int [][][] possible = new int [9][9][10]

set the possible numbers in the possible array to 1-9 and then compare the two arrays and delete the numbers in the possible array which appear in the grid array?
Back to top
View user's profile Send private message
humble_programmer

Joined: 27 Jun 2006
Posts: 69
:
Location: Colorado Springs, USA

Items
PostPosted: Fri Feb 26, 2010 2:46 pm    Post subject: Reply with quote

Possible...yes. Easy...not really. You'll have to traverse the arrays element by element, and remove the numbers one-by-one. I recommend that you investigate bit-level flags, which can be much more efficient.
_________________
Cheers!
Humble Programmer
,,,^..^,,,
www.humble-programmer.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Solving sudoku All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Sudoku Programmers topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group

Igloo Theme Version 1.0 :: Created By: Andrew Charron