フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

i have a some problem with the code i wrote for a while loop and cant't figure it out.can someone look at it and tell me where i went wrong?

1 回表示 (過去 30 日間)
roshan varkey
roshan varkey 2013 年 12 月 11 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
i have attached a file with the code in it,this is only a small bit of my batlleship game code. i this attached code,i have a matrix of 10x10 of zeros,and two ships: destroyer[2,2] and submarine[3,3,3](both randomly in either vertical or horizontal position].and now i want to prevent the intersection between these two.
i wrote the while loop checking if they intersect......if they do then i ask matlab to repeat the code until it doesnt.There is something wrong with the loop and i cant figure out what,as when i run this code multiple time to check if it works or not,whenever there is an intersection the it goes into an infinity loop. could some please help ?

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by