function grayTransform (entry, direction, x, dim) { // :: Int -> Int -> Int -> Int
    return bitwise.rotateRight((x ^ entry), dim, 0, direction + 1)
}
function grayTransform (entry, direction, x, dim) { 
    return bitwise.rotateRight((x ^ entry), dim, 0, direction + 1)
}
function grayTransform ( entry , direction , x , dim ) { // :: Int -> Int -> Int -> Int return bitwise . rotateRight ( ( x ^ entry ) , dim , 0 , direction + 1 ) }
rotate to desired gray using entry sequence
rotate to desired gray using entry sequence