Programming Puzzle

J

Jatinder

Hi all,
I m puzzled with a problem where I have to fill a 9x9 matrix in such a
way that one digit from 1 to 9 can be used only once per row/column.
It can be repeated along diagonal. I had tried some algo but in vain.
Please help me by providing the algo or souce code.
 
O

osmium

Jatinder said:
I m puzzled with a problem where I have to fill a 9x9 matrix in such a
way that one digit from 1 to 9 can be used only once per row/column.
It can be repeated along diagonal. I had tried some algo but in vain.
Please help me by providing the algo or souce code.

How about this: 123456789, 912345678, 891234567, ....

Algorithmic questions such as this properly belong in comp.programming.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top