# Intend to replace the original Step
import re


MOVE_RE = re.compile("([ULFRBD]w?|[MSEulfrbdxyz])(\'|i|2|2\'|)")

CLOCKWISE = 0
COUNTER = 1
HALFTURN = 2


class Move(object):

    __slots__ = ()

    def __new__(cls, representation):
        self = super().__new__(cls)
        if isinstance(representation, Move):
            symbol = representation.symbol
            sign = representation.sign
        else:
            match = MOVE_RE.match(representation.strip())
            if match is None:
                raise ValueError("Invalid move: {}".format(representation))
            symbol, sign = match
            if "w" in symbol:
                symbol = symbol[0].lower()
            if sign == "2'":
                sign = "2"

        self.symbol = symbol
        self.sign = ["", "'", "2"].index(sign)

        return self

    def __repr__(self):
        return self.symbol + ["", "'", "2"][self.sign]

    def __hash__(self):
        return hash(str(self))

@@ -124,20 +124,8 @@
 SE =
- 0%0ACOUNTER =
  1%0AH
@@ -136,16 +136,28 @@
 URN = 2%0A
+COUNTER = 3%0A
 %0A%0Aclass 
@@ -265,16 +265,17 @@
 __(cls)%0A
+%0A
         
@@ -393,16 +393,17 @@
 on.sign%0A
+%0A
         
@@ -404,18 +404,316 @@
       el
-se
+if isinstance(representation, tuple) and len(representation) == 2:%0A            symbol, sign = representation%0A            assert symbol in %22ULFRBDMSEulfrbdxyz%22 and sign in (1, 2, 3),%0A                %22Invalid Move initialisation: %7B%7D%22.format(representation)%0A%0A        elif isinstance(representation, str)
 :%0A      
@@ -1033,16 +1033,109 @@
  = %222%22%0A%0A
+        else:%0A            raise ValueError(%22Can only accept Move, str, or 2-element tuple%22)%0A%0A
         
@@ -1176,27 +1176,33 @@
 sign = %5B
+None, 
 %22%22, %22
-'
+2
 %22, %22
-2
+'
 %22%5D.index
@@ -1288,19 +1288,25 @@
  + %5B
+None, 
 %22%22, %22
-'
+2
 %22, %22
-2
+'
 %22%5D%5Bs
@@ -1371,8 +1371,834 @@
 (self))%0A
+%0A    def __eq__(self, move):%0A        if not isinstance(move, Move):%0A            move = Move(move)%0A        return self.symbol == move.symbol and self.sign == move.sign%0A%0A    def __ne__(self, move):%0A        return not self.__eq__(move)%0A%0A    def __add__(self, move):%0A        if not isinstance(move, Move):%0A            move = Move(move)%0A        assert self.symbol == move.symbol, %22Can't operate addition on two %22%0A                                           %22Moves with different symbols%22%0A        sign = (self.sign + move.sign) %25 4%0A        if sign == 0:%0A            return 0%0A        return Move((self.symbol, sign))%0A%0A    def __mul__(self, i):%0A        assert isinstance(i, int), %22Can only multiply with an integer%22%0A        sign = (self.sign * i) %25 4%0A        if sign == 0:%0A            return 0%0A        return Move((self.symbol, sign))%0A

Add addition, multiplication and equality comparison methods to Move