#ifndef _UPDOWN_HORSE
#define _UPDOWN_HORSE

#include "../shareddata.h"
#include "../horse.h"
#include "../random.h"

class UpDownHorse : public Horse
{
	int up, down;
	public:
		UpDownHorse() { 
			up = down = -1;
		}
		virtual int move(SharedData& sh)
		{
			if (up == -1)   up   = sh.n - 2;						
			if (down == -1) down = sh.n - 2;						
			if (up > 0) { up --;     return encode(0, -1); };
			if (down > 0) { down --; return encode(0, 1); };
			return 0;
		}
};

#endif
