Share your repls and programming experiences

← Back to all posts
Multiplayer Battleship!


hello HELLo Helloooo replers, here i have....


made through my hard work for one WHOLE WEEK :o

made this when i was on vacation in India, so the wifi was really S L O W

what the frick even is battleship

ok ok calm down im getting there

Battleship is a 2player board game (actually played on paper but i guessthat still counts as a board game)

I recreated it using PHP and js

okaaayy but whats the point lmao:

the objective of battleship is to sink all of the opponents ships before they sink yours.

how do you get ships?

at the start of the game, each player will place 5 ships anywhere they want on the game board.

how do you sink ships?

once both players are done placing their ships, they will be able to guess points on the opponents board. if you hit a ship, you will see the point turn green. if you miss, the point turns into an asterick (*).

how do you know if the opponent hits your ship

the game is arranged into a side by side view. one is your board, where you can see your ships,and which points your enemy hit you, and the other is the enemies board, where you can see which points you have missed and which points you have hit.

ok i hope you get how to play

you can play with computer (which is really bad btw) or you can play with a real person

if you want to see game source code....

and also if you want to see a youtube video of the game, here it is:


go go go what are you waiting for play!!! :DDD


I have a suggestion. How about a public lobby where once 2 people join they are both put into a game. (For people who don't have a friend to play with but wanna play multiplayer)


Good idea, like a matchmaking queue so it finds an opponent for you. @TheDragonWiz


The AI is kinda bad... I won 5-0 by randomly clicking. It seemed to be just picking random positions on the board to click. Maybe make it so that when it hits a ship it hits both sides of the place where it hit the ship?


yeah, i should probably do that @TheDragonWiz


@CoderGautamYT Besides that its working pretty well. I'm surprised that no one else has upvoted this. Right now, I'm trying to make an MMORPG in python (yes I know bad idea) but I'm afraid no one will upvote it and it will die :/


Aw, wellgood luck with it and I will upvote :D @TheDragonWiz


@CoderGautamYT Thanks! It probably won't be out for another month though.


mkay, tell me when its done @TheDragonWiz


@CoderGautamYT So it's not done yet, but I thought I would publish it for anyone who wants to see progress. (right now there is a huge error that I have no idea how to fix so yeah. if you wanna see what error I ran into the stack overflow page is here:

Link to game:


huh, pretty cool, seems to be working [email protected]