An orange becomes rotten if it is adjacent to a rotten orange either vertically or horizontally (up, down, left, or right). Diagonal adjacent oranges do not affect the rotting process.