- /
-
Piet Blocks
on 29 Oct 2021
- 6
- 19
- 1
- 0
- 278
%Piet color Circle Blocks
g=.7
figure('Color',[g g g])
hold
y=1;x=0;
c=['k','b','r','y'];c=[c c];
axis equal off
v=[1 1];
for n=1:9
%F=randi(5);
v(n+2)=v(n)+v(n+1);
a=v(n+2);
switch mod(n,5)
case 1
y=y-v(n);
x=x-a;
case 2
y=y-a;
case 3
x=x+v(n+1);
case 4
x=x-v(n);
y=y+v(n+2)%
end
%
rectangle(Pos=[x y a a],Curv=[.5 .5],FaceC=c(n),EdgeC='w',LineW=3);
end