Adding an extra value to a 2D matrix using JAVA

Discussion in 'Software' started by Sasquat, Dec 24, 2005.

  1. Sasquat

    Sasquat Private E-2

    Hi all,

    I was wondering if anyone knows how I could attach an extra value to a 2x2 matrix without using a 3D matrix? Basically, what I am trying to do is write a Sudoku solver, one which needs to search the rows and columns of a 9x9 and search seperate 3x3 sub blocks. The searching and printing & routines are messy trying to use a 3D matrix ( so that it knows which block its in) an also using a 9x9. using the firt method is easy to search the sub blocks, but not so easy to tell it which blocks to use for row and column searches ( it can be hard coded but I am potentially looking to use a flexible size matrix, i.e. 16x16, 25x25. The second option is easy to search columns and rows, but again the sub block co-ords would have to be hard coded to know which block the mising value it is in.

    This alos see,s very messy and potentially inflexible for greater dimensions - what I would like to do is use an nxn (9x9 in this case) and possibly flag the spaces in some way so that they know which block that they are in - any ideas?

    Cheers
    Sarah
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds