I am working on program that should make rectangle moves from top to bottom and then left to right once the rectangle crosses the borders of the frame it should reverse its motion from right to left and bottom to top. I managed to do the first part with a simple if statement but I didn’t know how to reverse
Tag: reverse
Reverse subset of ArrayList using multidimensional ArrayList in Java
I am trying to reverse a sublist in a List using the indices provided in a multidimensional List. I don’t have much experience using multidimensional lists/arrays. I don’t understand why this doesn’t work. The output of this code using [[0,1], [1, 3]] as the indecies is: but it should be: Can someone please help point me in the right direction?