フィルターのクリア

Use user input to change board

2 ビュー (過去 30 日間)
Krish Desai
Krish Desai 2015 年 11 月 22 日
I have a function that makes a board
function userboard=userboard(n)
userboard = cell(n+1,n+1);
% initialize the board
for u=1:n+1
for v=1:n+1
if u==1
if v<=n
userboard{u,v+1} = v;
userboard{v+1,u} = v;
end
elseif v==1
% do nothing
else
userboard{u,v} = 'x';
end
end
end
and I want to take the user inputs for x and y
x = input( 'Enter your x coordinate ' );
y = input( 'Enter your y coordinate ' );
and make those spots on the board a 0.
How do I do this?

回答 (0 件)

カテゴリ

Help Center および File ExchangeBoard games についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by