add BoardContext.each_position function to simplify iterating over positions