Skip to main content
deleted 246 characters in body
Source Link

Say I have 4 buttons. I want to have button 2 always swap out with another button, randomly. So, when the user taps button 2, it should swap with another button (randomly).

enter image description here

Now, button 2 is at the bottom right corner. So if the user taps button 2 again, it has the option to swap with the other three buttons. How can I achieve this?

enter image description here

I have already tried to make an array of the four values:

top_right, top_left, bottom_right, bottom_left

And maybe try and eliminate the value from teh array that the button is on whenever it is clicked. I have been racking my brain for hours nowsuccessfully had them swap, but can't figure it outwas very memory inefficient, and took a while.

Say I have 4 buttons. I want to have button 2 always swap out with another button, randomly. So, when the user taps button 2, it should swap with another button (randomly).

enter image description here

Now, button 2 is at the bottom right corner. So if the user taps button 2 again, it has the option to swap with the other three buttons. How can I achieve this?

enter image description here

I have already tried to make an array of the four values:

top_right, top_left, bottom_right, bottom_left

And maybe try and eliminate the value from teh array that the button is on whenever it is clicked. I have been racking my brain for hours now, but can't figure it out.

Say I have 4 buttons. I want to have button 2 always swap out with another button, randomly. So, when the user taps button 2, it should swap with another button (randomly).

Now, button 2 is at the bottom right corner. So if the user taps button 2 again, it has the option to swap with the other three buttons. How can I achieve this?

I have already tried to make an array of the four values:

top_right, top_left, bottom_right, bottom_left

And have successfully had them swap, but it was very memory inefficient, and took a while.

edited tags
Link
tags
Source Link
congusbongus
  • 14.9k
  • 59
  • 91
Loading
Source Link
Loading