function [ C, R ] = triangulo(N)

C(N) = 0;
R(N) = 0;
% C = zeros(N,1);
C(1) = rand + 1i*rand;
R(1) = 0;
for i=1:(N-1)
    regra = rand;
    if regra<1/3
        C(i+1) = C(i)/2;
        R(i+1) = 1;
    elseif regra<2/3
        C(i+1) = C(i)/2 + 1;
        R(i+1) = 2;
    else
        C(i+1) = C(i)/2 + 0.5 + 1i;
        R(i+1) = 3;
    end
end
