void changeOrder(Button button){ if (button == UP){ temp = shapes[selectedShape]; for(int i = selectedShape; i < shapeCounter; ++i){ shapes[i] = shapes[i+1]; std::cout << i << std::endl; } shapes[shapeCounter - 1] = temp; selectedShape = shapeCounter - 1; } else if (button == DOWN){ temp = shapes[selectedShape]; for(int i = selectedShape; i > 0; --i){ shapes[i] = shapes[i-1]; } shapes[0] = temp; selectedShape = 0; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter