in case of having Dirction.opposit as a field insi...
# getting-started
z
in case of having Dirction.opposit as a field inside enum as Karel initialy suggested. However i like this most I would say
Copy code
enum class Direction {
    NONE,
    NORTH, 
    SOUTH, 
    EAST, 
    WEST, 
    START, 
    END;

    val opposit: Direction
            get() =
                    when(this){
                        SOUTH -> NORTH
                                ...
                        START, END, NONE -> NONE        
                    }
}