|
-
Mar 22nd, 2007, 12:37 AM
#1
Thread Starter
Member
[RESOLVED] help with algorthm plz
ok i need to write a function/s which when applied to the following numbers outputs these 2 corresponding results. (if more numbers are required then plz say, but i think atleast 3 sets should be sufficent to work out a pattern
number = 4 desired output 4 and 0
number = 18 desired output 2 and 1
number = 32 desired output 0 and 2
number = 34 desired output 2 and 2
number = 47 desired output 15 and 2
number = 50 desired output 2 and 2
number = 54 desired output 6 and 2
story behind the numbers
i am working on a 16x14 grid and well i'm trying to get the correct grid coordinates. so lets say i count along 15spaces(+1 extra space for the 0) i should get to the cord 15,0 , so if i was given the number 15 i need that cord to appear.
if i count along 18 spaces(+1 extra space for the 0) i should get to the cord 2,1 (x repeating its iteration and y iteration increasing)
and well if i was given the number 18 i need that cord (2,1) to appear.
*count from left to right
Some of the grid
Code:
'Grid
'0-0, 1-0, 2-0, 3-0, 4-0, 5-0, 6-0, 7-0, 8-0, 9-0, 10-0, 11-0, 12-0, 13-0, 14-0, 15-0
'0-1, 1-1, 2-1, 3-1, 4-1, 5-1, 6-1, 7-1, 8-1, 9-1, 10-1, 11-1, 12-1, 13-1, 14-1, 15-1
'0-2, 1-2, 2-2, 3-2, 4-2, 5-2, 6-2, 7-2, 8-2, 9-2, 10-2, 12-2, 12-2, 13-2, 14-2, 15-2
'0-3, 1-3, 2-3, 3-3, 4-3, 5-3, 6-3, 7-3, 8-3, 9-3, 10-3, 12-3, 12-3, 13-3, 14-3, 15-3
Last edited by alacn; Mar 22nd, 2007 at 12:59 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|