Code for an adaptive physical activity intervention