Click here to Skip to main content
15,938,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Program Definition :: Print Numbers in Cyclical (Maze) Format
Explaination:
Here numbers are to be printed in cyclical format i.e. suppose i enter 4 as input then the output should be of 4*4 in this format

1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7

You could see that the numbers are in cyclical format..
i.e
1) from 1-4 in x axis
2) from 4-7 in y axis
3) from 7-10 in x axis
4) from 10-12 in y axis
5) from 12-14 in x axis
6) from 14-15 in y axis
6) from 15-16 in x axis

Please help out me , i am really stucked with this program...

Regards,
Krunal Panchal
Posted

1 solution

Search for Ulam's spiral. That should give you a starting point.
 
Share this answer
 
Comments
[no name] 19-Nov-10 1:11am    
Thanks for your helpfull reply,but i searched a lot and i could'nt find any answer in C language all those i found were in c# where there was a way to go to particular location (co-ordinate).
Please help me out..

Regards,
Krunal Panchal
Bassam Abdul-Baki 19-Nov-10 6:23am    
Sorry, but you're going to have to convert it to whatever language you want yourself. Most of the code is rudimentary. Just try to understand the rotation part. It's not that complex.
[no name] 20-Nov-10 3:39am    
Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900