Dog training for Developers - The basics: Sit

11 out 2014

"Sit" is probably one of the easiest commands to teach your dog. But, how to accomplish it? Run the following method during a few days, twice a day.

Remember, be patient :)

Feij√£o

public void Sit()
{

    //Prepare yourself
    _teacher.Sit();

    for (int i = 0; i < 4; i++)
    {
        var snack = _teacher.GrabNewSnack();

        _teacher.LetDogSniff(snack);

        //Dog should follow your hand
        do
        {
            //Dog will try to reach the food
            _teacher.MoveHandUp();

        } while (!_dog.IsSeated);

        _teacher.Say("Sit!");

        _teacher.GiveToDog(snack);
    }

    for (int i = 0; i < 5; i++)
    {
        var snack = _teacher.GrabNewSnack();

        _teacher.Say("Sit!");

        do
        {
            _teacher.MoveHandUp();

        } while (!_dog.IsSeated);

        _teacher.GiveToDog(snack);
    }

    _teacher.GetUp();

    for(int i=0;i<3;i++)
    {
        //Leave 
        _teacher.Say("Sit!");

        do
        {
            _teacher.MoveHandUp(); //With empty hand
        } while (!_dog.IsSeated);

        _teacher.PlayWithDog(_dog);

    }

}
comments powered by Disqus