Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [battleship]

A guessing game in which two players place ships on a grid, then take turns guessing the coordinates of the other player's ships

4
votes
0answers
58 views

Ship placement verification function for Battleship game

I wrote server-side Battleship game simulator in nodeJs/Javascript: A random player who begins is chosen. Both place their ships. Software recognizes if they are placed correctly. One of the players ...
3
votes
2answers
180 views

Battleship Game in Java

I wanted to make a very simply Battleship game in Java, any feedback is welcome. Nevermind the getters / setters. Just assume they are there. ...
3
votes
1answer
208 views

C++ Battleship player AI

Found this project online and looking for some guidance. I'm in the process of developing a Battleship AI that will play against different computer difficulties. The "barebones" part of the project ...
7
votes
0answers
145 views

Web Battleship -The Unofficial Battleship UI

I've written my own UI for Mathieu Guindon's VBA Battleship (Battleship UI: GameSheet) which uses a webpage in a WebBrowser control for the View. Webform: Userform ...
3
votes
1answer
137 views

Battleship Model - follow-up

This is the revised code from my prior question. Same requests as before! Something I'm doing new here is using the XmlEncoder extension methods to handle ...
3
votes
1answer
124 views

Battleship Model

The following is some code for a Battleship game I'm working on. The plan is to create a multiplayer game using Xamarin Forms. This is just the model code, i.e. what the GUI will be interacting with ...
-1
votes
2answers
171 views

Battleships “AI” function

I would like some advice on how I could shorten my function from my battleships game (below). Essentially what it does is it checks if a coordinate is a hit and if it is, then if checks adjacent ...
5
votes
0answers
213 views

Battleship MVC Architecture

The entry point is the Macros module, which - for now - includes only a single procedure, at a very high abstraction level - I'm quite happy with this: ...
5
votes
1answer
211 views

Java battle ship game

I am a beginner in the programming world. This is the first big project I tackle which is the battleships game. I implemented the game to run in the console. I was hoping if you guys can check my code ...
10
votes
0answers
193 views

BattleShip - Ships & Players

I'm making a full-blown OOP Battleship game in VBA (previous post: Battleship Grid), and I want this code to be as good as it gets - and better, if I can. I've refactored a few things, introduced a <...
1
vote
0answers
86 views

Battleship game in python3 and the unicurses libary (oop)

In order to learn Python and Curses programming I am in the process of creating a Battleship game for the console. At the moment I struggle more on object oriented programming and structuring the ...
10
votes
1answer
177 views

BattleShip Grid: Classes and Tests

In my ongoing quest to demonstrate how VBA code can absolutely be object-oriented, I've started implementing a game of Battleship in pure VBA. This is a rather large project, so I'll split the ...
3
votes
3answers
77 views

Program creates 3 consecutive values on a 7x7 grid; User has to guess the location

I'm learning Java with Head First Java. I've built a program that creates a 7x7 grid (A0 to G6) and places an object of 3 consecutive values inside it. The user has to guess the location and when ...
7
votes
1answer
1k views

Find the battleship

This is my first attempt at anything in C#. It's based on battleships, but there's only one player and only one ship. The gameplay is super simple: just try to find the ship... keep guessing until ...
5
votes
2answers
2k views

Java Battleship game

I have been given a problem statement to create a Battleship game in java. My working code (Spring Boot+Web) is placed here along with the problem statement. https://github.com/ankidaemon/BattleShip ...
7
votes
2answers
705 views

Simple Battleship written in Python

I would appreciate feedback on my first Battleship game written in Python for my intro to programming class. Here is the code, the only thing in here is that I use a clear screen function from one of ...
3
votes
2answers
2k views

Python battleship program (2 player or 1 player)

I recently started studying python with a much heavier study regimen, I wanted someone to review my code to see what they thought. I do have a to do list at the start of the code so any tips on how I ...
11
votes
1answer
236 views

Beginner Battleship game in Python/terminal

I am learning how to program and during the Python course on Codecademy I was encouraged to rewrite it all with new features (2 players, various ship sizes, etc.). In summary this works as follows: ...
4
votes
2answers
1k views

2-Player console-based modified Battleship game

I have written a simple Code using Array List, Scanner and String for Developing a Simple Console based 2- Player Battleship Game in Java The Complete Question can be found here Below is the ...
3
votes
1answer
481 views

2-player Game of Battleship (Python)

I have been working on a 2-player battleship game and have finally got it working, bug free. I'm posting this here to ask you what you think of it. Are there any changes that could be made to improve ...
7
votes
1answer
2k views

2-player Battleship game Python

I have been working on a 2-player battleship game in Python. The game asked you to guess a row and column from a 5x5 game board before checking those coordinates to see if you have correctly guessed ...
5
votes
2answers
319 views

Game of Battleship

I'm working on a 2-player battleships game in python, although the game is slightly buggy. It sometimes does not allow me to play another game once the first game has finished, and it does not change ...
3
votes
1answer
348 views

Battleship coordinate picker

I present to you... my battleship location picker! This will be part of a larger battleship program. The coordinates that are important are finalcoords. ...
7
votes
2answers
736 views

Battleship homework

It's a few weeks old homework, and it's already graded. How can I improve my code? Write function empty(n), which gets the board size as an argument, and returns ...
5
votes
1answer
910 views

Battleship Game

Inspired by this question, I went on with the following version. My goal was to focus on pure functions, to avoid mutable variables and to be strictly functional. I have ignored the computer player ...
5
votes
2answers
5k views

Python simple battleship game

I'm relatively new to Python, I decided to make a simple battleship game. Is there anything I should do to make it shorter, or in practice, "better"? ...
11
votes
2answers
4k views

Making a Battleship game

I'm making a Battleship game using python 2.7. However, how to make it is not currently my issue. The main aspect that I'm asking about is the style and method of making the code. Am I following ...
6
votes
2answers
4k views

Designing a simple Battleship game in Python

I am trying to code Battleship. It should be a text one-player game against computer where computer and human player take turns in shooting at opponent's ships. I decided to start implementation with ...
2
votes
1answer
6k views

Battleship in Python TKinter

I am very new to GUI programming, and I'm pretty sure I'm doing it wrong. Please take a look at my code, and suggest some changes. I feel it's way too complicated for what it's actually doing. For ...