detecting repetition in last 7 elements of Arraylist
in
Programming Questions
•
7 months ago
Hi, i have a function that generate values. Im adding a value to an Arraylist each frame.
I would like to detect when the last items in my arraylist begins to repeat.
How can i do this?
Usually it repeats the last 7 elements (values) in my arraylist.
something like this:
[ 1.92244 , ……………………………
1.9592291, 1.9729414, 1.9554538, 1.9625572, 1.9517543, 1.9695913, 1.963067,
1.9592291, 1.9729414, 1.9554538, 1.9625572, 1.9517543, 1.9695913, 1.963067,
1.9592291, 1.9729414, 1.9554538, 1.9625572, 1.9517543, 1.9695913, 1.963067,
1.9592291, 1.9729414, 1.9554538, 1.9625572, 1.9517543, 1.9695913, 1.963067,
1.9592291, 1.9729414, 1.9554538, 1.9625572, 1.9517543, 1.9695913, 1.963067,
1.9592291, 1.9729414, 1.9554538, 1.9625572, 1.9517543, 1.9695913, 1.963067 ]
How can i detect the repetition of my last 7 elements of an ArrayList?
thanks in advance
T.
1