You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today's challenge is inspired by the video game Pong, which was released November 29, 1972.
5
+
6
+
Given a matrix (array of arrays) that includes the location of the ball (2), and the previous location of the ball (1), return the matrix indices for the next location of the ball.
7
+
8
+
The ball always moves in a straight line.
9
+
The movement direction is determined by how the ball moved from 1 to 2.
10
+
The edges of the matrix are considered walls. If the balls hits a:
11
+
top or bottom wall, it bounces by reversing its vertical direction.
12
+
left or right wall, it bounces by reversing its horizontal direction.
0 commit comments