Skip to content

Commit

Permalink
reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Fronx committed Oct 31, 2011
1 parent 1c6b09a commit 540cd9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions bingoscript.m
@@ -1,6 +1,6 @@
%Monte Carlo simulation of Bingo games
%Response to http://programmingpraxis.com/2009/02/19/bingo/
%Output is :
% Monte Carlo simulation of Bingo games
% Response to http://programmingpraxis.com/2009/02/19/bingo/
% Output is :
%{
averagefor1card =
Expand All @@ -14,12 +14,12 @@
Elapsed time is 219.205069 seconds.
%}
%Of course, since it's stochastic, answer will vary slightly every time
%Also, elapsed time will depend on the speed of your computer and will also
%vary from run to run.
% Of course, since it's stochastic, answer will vary slightly every time
% Also, elapsed time will depend on the speed of your computer and will also
% vary from run to run.
tic;
averagefor1card=bingoprob(1)
averagefor1card = bingoprob(1)
toc
tic;
averagefor500cards=bingoprob(500)
toc
averagefor500cards = bingoprob(500)
toc
4 changes: 2 additions & 2 deletions checkbingocard.m
@@ -1,4 +1,4 @@
function won=checkbingocard(card)
function won = checkbingocard(card)

won=any(all(card==0)) || any(all(card'==0)) || ...
won = any(all(card==0)) || any(all(card'==0)) || ...
all(diag(card)==0) || all (diag(card(:,size(card,2):-1:1))==0);

0 comments on commit 540cd9a

Please sign in to comment.