Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results for battleship
Search options not deleted
5 votes
1 answer
513 views

Python Battleship

I have implemented Battleship in Python by using lists. I have used threading to prevent KeyboardInterrupt, so the player can't cheat by using control-c and stuff. How can I simplify this code? … carrier_sunk = True elif battleship == 0 and battleship_sunk != True: print('You sunk the battleship!') …
cold10's user avatar
  • 559
7 votes
0 answers
351 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. … Download Web Battleship -The Unofficial Battleship UI Mathieu Guindon's original VBA Battleship file on GitHub …
TinMan's user avatar
  • 4,328
4 votes
1 answer
415 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. … ISerializable.cs namespace Battleship { public interface ISerializable { string Serialize(); } } GridSquare.cs using System; namespace Battleship { public enum SquareType …
T145's user avatar
  • 3,159
3 votes
1 answer
661 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. …
lol's user avatar
  • 243
5 votes
2 answers
12k views

Java Battleship game

I have been given a problem statement to create a Battleship game in java. … Constraints: 1 <= Width of Battle area (M) <= 9 A <= Height of Battle area (N) <= Z 1 <= Number of battleships <= M * N Type of ship = {‘P’, ‘Q’} 1 <= Width of battleship <= M A <= Height of battleship
ankidaemon's user avatar
5 votes
2 answers
13k 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"? … from pprint import pprint as pp import random Rows = 0 Columns = 0 turns = 0 Answer = "NaN" print("Welcome to battleship!") …
Mvpgman1425's user avatar
11 votes
2 answers
5k views

Making a Battleship game

battleship:")) else: print "That is not a valid input. … else: print "You missed my battleship!" …
Omar Eldahan's user avatar
4 votes
3 answers
4k views

Python Battleship Game

I have a 2-player game of Battleship written in Python, but I've reused a lot of code for the second player's decisions (particularly in the play_game function). … ': 4, 'Cruiser': 3, 'Submarine': 3, 'Destroyer': 2} #size of each ship P1_Ships = [['Carrier', 1], ['Battleship', 1], ['Cruiser', 1], ['Submarine', 1], ['Destroyer', 1]] #number of ships to place …
Perplexityy's user avatar
14 votes
5 answers
12k views

A Simple Battleship Game

This Battleship game is the third game i have written. … return print("Welcome to the Battleship game!" "\nYour main objective is to find and destroy all the hidden ships on map! …
Haliax's user avatar
  • 361
8 votes
2 answers
3k views

Battleship with Java

I recently whipped up a Battleship program with Java as part of my Basic OOP class in university. The class is done but all we get are grades. … cell's state - cheat mode public char revealedState(Grid[][] a, int i, int j) { return a[i][j].state; } } BattleshipDriver Class /** * This program simulates the game, Battleship
J. Ong's user avatar
  • 83
3 votes
1 answer
1k 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. … else: print("You missed my battleship!") …
zalidael's user avatar
  • 345
14 votes
2 answers
5k views

Battleship algorithm

Im looking to improve my search algorithm in my battleship game. Code is not perfect but would appreciate any suggestions or recommendations. … Lets play BattleShip\n\n" #displayMessage(msg) countryList=['China','Russia','SouthKorea','India','France','Mexico','Taiwan','Turkey','NorthKorea'] if numberOfPlayers==1: msg="Which …
Sam Sanchez's user avatar
1 vote
2 answers
1k views

Battleship game - preliminary version

I created preliminary version of battleship game. For now it works that: The computer generates a new a board and our task is to find all ships. I emphasize that I didn't focus on looks. … GitHub package battleship; import java.awt.EventQueue; import javax.swing.JFrame; public class GameCreator { public static void main (String[] args) { EventQueue.invokeLater(new Runnable …
Mitchu's user avatar
  • 11
3 votes
2 answers
4k 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. …
Koray Tugay's user avatar
  • 1,587
7 votes
1 answer
7k views

2-player Battleship game Python

I have been working on a 2-player battleship game in Python. … else: print("You missed my battleship!") …
zalidael's user avatar
  • 345

1
2 3 4 5
12
15 30 50 per page