I try to programm BattleShips and need some hint

I try to programm BattleShips and need some hint
0

#1

Hello Coders, :smiley:

I need some help for my BattleShip Project…
In this project I try to use vanilla JS and Design Patterns, but I realized fast that it will be a long way.

My problems are performance and a infinite loop. Some times the do-while-loop in the displayShips-Function works fine, but often not.
Have some of you a hint and what can I do better?

Thanks to all of you!


#2

I found a mistake in the displayShips-Function:

I think, the function Playground.createMatrix doesn’t creates a new matrix in the displayShips-Function…


#3

ok! I found the mistake:
I wrote Playground.createMatrix instead of Playground.createMatrix() -.-

But if someone havesome tips how I can write better code pls let me know! :slight_smile:
Thanks