How do I display a battleship board game?

조회 수: 3 (최근 30일)
Aman Kumar
Aman Kumar 2022년 1월 8일
편집: Image Analyst 2022년 1월 9일
I'm designing a battleship game with two 6-by-6 game boards for the player and a computer, and each grid needs to have be numbered 1-36, so how can I do that please?
  댓글 수: 1
John D'Errico
John D'Errico 2022년 1월 8일
편집: Image Analyst 2022년 1월 9일
Surely, before you post multiple new questions about basic problems in this project, you should look at the dozens of questions posted by your classmates over the last few weeks about battleship. You might learn something from them. Click on the battleship tag on the right side of this page.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2022년 1월 8일
image([0.5 5.5], [0.5 5.5], ones(6,6,3));
xticks(0:6); xticklabels([]);
yticks(0:6); yticklabels([]);
grid on
[X,Y] = ndgrid(0.5:5.5, 0.5:5.5);
text(X(:), Y(:), string(1:36))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Strategy & Logic에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by