필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

for a battleship program:how to place a ship of given unit length randomly on a matrix of 10x10?

조회 수: 1 (최근 30일)
i g=have to make a battleship game in matlab using matrices. i made a grid using play_space=zeros(10) i made a ship destroyer=[2,2] i want to place this on he matrix randomly by replacing two of the zeros in the matrix with twos. how do i do it? i am a beginner at this.only started like three weeks ago.so,please explain the answer too...please!thankyou!

답변 (1개)

Image Analyst
Image Analyst 2013년 11월 26일
Basically the same process as in my answer to your near-duplicate question http://www.mathworks.com/matlabcentral/answers/107679#answer_116445 which you already accepted (thanks though). Was there something you didn't understand about it? If so, ask back there in that question.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by