smithers.twisty
Class SquareOneNotation

java.lang.Object
  extended by smithers.twisty.SquareOneNotation
All Implemented Interfaces:
PuzzleNotation<SquareOne>

public class SquareOneNotation
extends java.lang.Object
implements PuzzleNotation<SquareOne>

A notation for the Square One puzzle. Follows the notation described at http://www.jaapsch.net/puzzles/square1.htm#notation, with one addition, namely that a backslash '\' may be used to flip the opposite half of the puzzle.


Constructor Summary
SquareOneNotation()
           
 
Method Summary
 Twist[] getTwists(java.lang.String description, SquareOne puzzle)
          Gets the sequence of twists determined by the description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SquareOneNotation

public SquareOneNotation()
Method Detail

getTwists

public Twist[] getTwists(java.lang.String description,
                         SquareOne puzzle)
Gets the sequence of twists determined by the description. This should return an array of instances of classes which will be accepted (will not throw ClassCastException) by the implementation of TwistyPuzzle.twist(Twist) in the class P, although they may not be possible from all positions of the puzzle (or even the current position of the puzzle argument).

Specified by:
getTwists in interface PuzzleNotation<SquareOne>
Parameters:
description - the twists in this notation
puzzle - a prototype puzzle to use in case the puzzle type itself has parameters necessary for interpreting the notation
Returns:
the twists specified