col=number % nb_rows ;
row=(number / nb_cols) + 1; // provided that number and nb_cols are both int

Vince
-----Original Message-----
From: Khan, Manuchehar A (ACF) [mailto:mkhan@;acf.hhs.gov]
Sent: Monday, October 28, 2002 9:30 AM
To: 'Struts Users Mailing List'
Subject: RE: Trivial Q


Java

-----Original Message-----
From: Vincent PROSPER [mailto:Vincent.Prosper@;Alkinos.com]
Sent: Monday, October 28, 2002 3:29 AM
To: Struts Users Mailing List
Subject: RE: Trivial Q


if number=10 (for instance) for an array nb_cols x nb_rows then

col=number mod nb_rows       (should be 2)
row=(number div nb_cols) + 1 (should be 3)

dont know the language you're looking for ;-)

Vince

-----Original Message-----
From: Khan, Manuchehar A (ACF) [mailto:mkhan@;acf.hhs.gov]
Sent: Monday, October 28, 2002 9:20 AM
To: 'Struts Users Mailing List'
Subject: Trivial Q


This q is irrelevant to strusts but somebody can solve this easy puzzle that
I am stuck with....
I have an multidimentional array rows*columns....Can someone figureout code
to get the x, y poisition in this multidimentional array if i know the
number....

For example I have number 10.....Its position in array for size (4X4) will
be 3rd row and 2nd column...
What will be the code to get number when size of array of number change
dynamically...

Thanks

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>





--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to