% Script PaintBall
% Draws a unit black square with lower left corner at (0,0).
% Repeatedly draws disks whose centers are randomly placed in the square.
% Each disks has radius .03 and if it is entirely located in the square,
% it is colored magenta, yellow, or cyan with equal probability.
% Otherwise, it is drawn white.
% The process continues until 50 white disks are drawn.
close all
figure
axis equal off
hold on
%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
% Initializations...
r = .03;
EdgeHits = 0;
% Draw the square...
DrawRect(0,0,1,1,'k')
% Draw random disks...
while EdgeHits < 50
% Locate a random disk and see if it is inside the square
x = rand(1); y = rand(1);
if 0