Naval Clash Game With 16x16 NeoPixel Matrix WS1812B - Random Ships Arrangement

You could try to get rid of the strings and use C strings instead. It’s more code you would need to write but it should be more stable.