Results 1 to 1 of 1
  1. #1
    Lucato is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Default 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,
    Lucato
    Last edited by Lucato; 05-06-2012 at 01:29 PM.

Similar Threads

  1. Open Grid Scheduler/Grid Engine
    By java software in forum Java Software
    Replies: 0
    Last Post: 03-27-2012, 08:00 PM
  2. 2D grid
    By ranss41 in forum New To Java
    Replies: 0
    Last Post: 01-06-2012, 05:41 PM
  3. drawing a 3D hex-grid map
    By samanyu in forum Java Gaming
    Replies: 5
    Last Post: 07-14-2011, 02:54 AM
  4. how to get the grid values
    By jazz2k8 in forum Advanced Java
    Replies: 2
    Last Post: 11-06-2008, 03:11 PM
  5. mirrors in mirrors in JMenu
    By willemjav in forum Java Applets
    Replies: 5
    Last Post: 06-14-2008, 07:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •