Results 1 to 1 of 1
- 05-06-2012, 12:26 PM #1
Member
- Join Date
- May 2012
- Posts
- 1
- Rep Power
- 0
All possible placements of n mirrors in a grid
Hello everyone,
For an assignment from school we have to build a grid and find a correct placement of mirrors in the grid
so that light would come in at one cel (of the grid) and leave at another cel.
Now my idea was to build a grid, place numbers around it for in and out,
and check for any set up of mirrors if it is correct.
If a set up is correct it is returned and the program terminates.
I did most of this, i.e. I can check for a given positioning of mirrors if it is correct given the in and out. But now I am stuck on how to generate all the possible positionings given a grid and n mirrors.
Can anyone give me tips on how to do this?
I was thinking of 2D arrays that store either -1, 0, or 1 in each array location
(-1 for / , 0 for nothing and 1 for \). The problem is finding a way to generate all possible combinations of
-1, 0 and 1 in such 2D array.
Greets,
LucatoLast edited by Lucato; 05-06-2012 at 12:29 PM.
Similar Threads
-
Open Grid Scheduler/Grid Engine
By java software in forum Java SoftwareReplies: 0Last Post: 03-27-2012, 07:00 PM -
2D grid
By ranss41 in forum New To JavaReplies: 0Last Post: 01-06-2012, 04:41 PM -
drawing a 3D hex-grid map
By samanyu in forum Java GamingReplies: 5Last Post: 07-14-2011, 01:54 AM -
how to get the grid values
By jazz2k8 in forum Advanced JavaReplies: 2Last Post: 11-06-2008, 02:11 PM -
mirrors in mirrors in JMenu
By willemjav in forum Java AppletsReplies: 5Last Post: 06-14-2008, 06:59 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks