with Io;
package body Square is
    -- definition of the actual 'checker-board'
    subtype Edge is Natural range 0 .. Size - 1;
    Board : array (Edge, Edge) of Natural := (others => (others => 0));
    -- position of the cursor
    X, Y : Edge := Size / 2;

    procedure Go_To_Center is
    begin
        X := Size / 2;
        Y := Size / 2;
    end Go_To_Center;

    procedure Go (Which_Direction : in Direction) is
    begin
        case Which_Direction is

            when North =>
                Y := (Y + 1) mod Size;
            when South =>
                Y := (Y - 1) mod Size;
            when East =>
                X := (X + 1) mod Size;
            when West =>
                X := (X - 1) mod Size;
            when North_East =>
                Go (North);
                Go (East);
            when South_East =>
                Go (South);
                Go (East);
            when North_West =>
                Go (North);
                Go (West);
            when South_West =>
                Go (South);
                Go (West);
        end case;
    end Go;
    function Is_Already_Occupied return Boolean is
    begin
        return Board (X, Y) > 0;
    end Is_Already_Occupied;

    procedure Deposit (Token : Positive) is
    begin
        Board (X, Y) := Token;
    end Deposit;

    procedure Display is
    begin
        for Y in reverse Edge loop
            for X in Edge loop
                Io.Put (Board (X, Y), Width => 3);
            end loop;  
            Io.New_Line;
        end loop;
    end Display;
    procedure Toto is
    begin
        null;
    end Toto;
end Square;