We’re rewarding the question askers & reputations are being recalculated! Read more.

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

Filter by
Sorted by
Tagged with
8
votes
3answers
2k views

Single Player Python Battleship Game

I made a battleship game for a programming class, where I only had about a week to get it done. Under this time crunch, and the fact that I don't know python very well, I made some of the code in very ...
11
votes
5answers
2k views

A Simple Battleship Game

I have just finished learning basic-intermediate Python subjects and wanted to test myself. This Battleship game is the third game i have written. ...
6
votes
3answers
130 views

Battleships OOP python

This is my first attempt at some basic OOP programming. A version of battleships played within the terminal. Any feedback would be great; especially in regards to readability and proper naming ...
5
votes
1answer
143 views

Ship placement verification function for Battleship game

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

Initial map modelling for Battleship game

The goal of the code below is limited to the creation of the initial map only and not to the whole game mechanics itself. The rules are that there are 4 ships of length {2,3,4,5} and no ship may be ...
3
votes
2answers
412 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
444 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
184 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
175 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
179 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 ...
0
votes
2answers
321 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
1answer
438 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 ...
6
votes
0answers
307 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: ...
10
votes
0answers
282 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
145 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
220 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 ...
7
votes
2answers
827 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 ...
7
votes
1answer
3k 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 ...
3
votes
3answers
91 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
2k 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
4k 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
864 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
1answer
661 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 ...
4
votes
2answers
2k 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 ...
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 ...
5
votes
2answers
7k 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"? ...
3
votes
1answer
423 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. ...
11
votes
1answer
320 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: ...
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 ...
4
votes
2answers
356 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 ...
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 ...
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 ...
5
votes
1answer
1k 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 ...