SONAR Game
Directions

       The SONAR Game is an 8 x 8 grid. Four of these squares contain "boats" (chosen by the computer at random). If you fire an ultrasonic beam into the box from one of the 32 positions shown, there are a fixed number of rules as to what may occur. You fire the beam by clicking on one of the numbers.

Generally, the beam goes in, bounces around (see the rules), and either exits, or is absorbed by the boat. The screen will display the entry and exit (if there is an exit) locations.

The rules for the path your beam will follow are these:

[1] If the beam does not encounter any boats either ahead of, or adjacent to the path it is in, it will simply pass through and come out on the other side.

[2] If the beam finds a boat directly in front of it, it will be absorbed and will not exit from the grid.

(Those are the easy cases, now for the more complex scenarios)

[3] If the beam encounters two boats in front of it, one to the left and the other to the right, it is reflected back in the direction it came from. i.e.



        | | | | | | | | |
        +-+-+-+-+-+-+-+-+
        | | | |@*********<-Enters here
        +-+-+-+-+-+-+-+-+    (gets absorbed)
        | | | | | | | | |
Enters  +-+-+-+-+-+-+-+-+
  here->*****************-->Exits here
        +-+-+-+-+-+-+-+-+         
        | | | | | | | | |       
        +-+-+-+-+-+-+-+-+ 
        | | | | | | | | |
        +-+-+-+-+-+-+-+-+
        | | | | | | | | |
        +-+-+-+-+-+-+-+-+
        | | |@| |@| | | |
        +-+-+-+*+-+-+-+-+
        | | | |*| | | | |
        +-+-+-+*+-+-+-+-+
        | | | |*| | | | |
        +-+-+-+*+-+-+-+-+
               ^ Entry AND exit here	    

        | | | | | | | | |
        +-+-+-+-+-+-+-+-+
        | | | | | | | | |
        +-+-+-+-+-+-+-+-+
        | | | | | | | | |
        +-+-+-+-+-+-+-+-+
        | | | | | | | | |
        +-+-+-+-+-+-+-+-+
        | | |@| | | | | |
        +-+-+-+*+-+-+-+-+
               ^ Entry AND exit here	    
[4] If the beam encounters a boat in front of it, either to the left or to the right it will bounce off in the appropriate direction. (see the diagram below).


        | | | | | | | | |
        +-+-+-+-+-+-+-+-+
        | | | | | | | | |
        +-+-+-+-+-+-+-+-+
        | | |@| | | | | |
        +-+-+-+-+-+-+-+-+
        | | | |**********-->
        +-+-+-+*+-+-+-+-+  Exits here
        | | | |*| | | | |
        +-+-+-+*+-+-+-+-+
               ^
               Enters here
             | | | | | | | | |
             +-+-+-+-+-+-+-+-+
             | | | | |@| | | |
Exits here   +-+-+-+-+-+-+-+-+
          <--********| | | | |
             +-+-+-+*+-+-+-+-+
             | | | |*| | | | |
             +-+-+-+*+-+-+-+-+
             | | | |*| | | | |
             +-+-+-+*+-+-+-+-+
                    ^
               Enters here
Of course, once it bounces off one boat it could hit others, and bounce around and around before it finally exits or gets absorbed.

The idea is to figure it out in as few a number of firings into the grid as you can. One is added to your score each time you fire. To keep track of where you THINK a boat might be, you may click on a square and a "guess boat" will appear in the box. (Clicking again erases it). An arrow will appear showing the latest entry and exit points. Also, in the status line, you can see how many times your beam "bounced" off of a boat. When you think you know the solution, click "solve!" and if you got it right, your score will be compared against the current low score and will be remembered if it is lower.