dart_score - total = total+5; tally(3) = tally(3)+1; shots =

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function [total tally shots] = dart_score(n,fdart) f %Setting the initial conditions. array = fdart(n); total = 0; tally = zeros(1,4); shots = []; s for k = 1:n if sqrt((array(k,1))^2+(array(k,2)))^2 < 1 total = total+10; tally(4) = tally(4)+1; shots = [shots;array(k,:)];
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: total = total+5; tally(3) = tally(3)+1; shots = [shots;array(k,:)]; elseif sqrt((array(k,1))^2+(array(k,2))^2) < 10 total = total+1; tally(2) = tally(2)+1; shots = [shots;array(k,:)]; else tally(1) = tally(1)+1; shots = [shots;array(k,:)]; end end...
View Full Document

This note was uploaded on 02/18/2010 for the course ENGINEERIN 7 taught by Professor Patzek during the Spring '08 term at Berkeley.

Ask a homework question - tutors are online