Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this is fork of https://pastebin.com/raw/Npqqs1m4
- #include "MyStrategy.h"
- using namespace model;
- using namespace std;
- void MyStrategy::move(const Player& me, const World& world, const Game& game, Move& move) {
- if (world.getTickIndex() == 0) {
- move.setAction(ActionType::CLEAR_AND_SELECT);
- move.setRight(world.getWidth());
- move.setBottom(world.getHeight());
- return;
- }
- if (world.getTickIndex() == 1) {
- move.setAction(ActionType::ASSIGN);
- move.setGroup(42);
- return;
- }
- if (world.getTickIndex() == 2) {
- move.setAction(ActionType::ASSIGN);
- move.setGroup(34);
- return;
- }
- if(me.getRemainingActionCooldownTicks()||world.getTickIndex()%5!=0)return; // <--- bug fixed
- static int iter=0;iter++;auto k=iter%2?+1:-1;
- move.setAction(ActionType::MOVE);
- move.setX(k*world.getWidth() / 2.0);
- move.setY(k*world.getHeight() / 2.0);
- }
- MyStrategy::MyStrategy() { }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement