Results 1 to 7 of 7
Like Tree1Likes
  • 1 Post By KevinWorkman

Thread: Java Battleship Program

  1. #1
    zizou001 is offline Member
    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0

    Default Java Battleship Program

    Hi, I would really appreciate it if someone helps me create a battleship program in Java? It is a board of 10 rows x 10 columns and it includes classes:
    ship
    ship part
    board

    I am struggling to start it off! Also I would need a 2D array in the program to initialize the actual board game

    The game will be based on plotting the right co ordinates to sink the ships! It will be user vs computer.

    Would really appreciate it if someone can help with this?

    I use BlueJ for the program but any java code will help.

    Thanks
    Zizou

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,864
    Rep Power
    8

    Default Re: Java Battleship Program

    Which part of this is giving you trouble? What do you have so far? What exactly are you stuck on?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    zizou001 is offline Member
    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0

    Default Re: Java Battleship Program

    Ive got 3 classes but I'm struggling to even start this off! I need a concept of what kind of implementation I would need to construct the 2d array but im having difficulties understanding how to do this.

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,864
    Rep Power
    8

    Default Re: Java Battleship Program

    Start off with a single class that simply displays a 2D grid of booleans. True means they're filled, false means they aren't. From there, you can add ships that take up specific coordinates, then from there you can get into user interaction and placement.

    Breaking it up into individual steps also makes it easier for us to help you. If you get stuck displaying the grid, put together an SSCCE that demonstrates only that part, and we'll go from there.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    zizou001 is offline Member
    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0

    Default Re: Java Battleship Program

    I really need someone to do this for me! As I know I cant do this on my own! At-least if someone starts it off with the right methods and classes and I will finish it off!

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,864
    Rep Power
    8

    Default Re: Java Battleship Program

    That isn't how this works. We aren't a codemill or a homework service. We'll be happy to help you, but you have to show some initiative first. Up to you.
    quad64bit likes this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Java Battleship Program

    zizou001 is banned for 1 month for misbehaving. See Battleship Program

    db

    THREAD CLOSED
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Battleship Program
    By zizou001 in forum New To Java
    Replies: 6
    Last Post: 11-15-2012, 08:21 AM
  2. Help with Revised Battleship program
    By Lucid15 in forum New To Java
    Replies: 1
    Last Post: 04-19-2012, 07:18 AM
  3. Having trouble, Battleship program
    By Corrrrr in forum New To Java
    Replies: 15
    Last Post: 03-09-2012, 03:08 AM
  4. Help with Battleship program! 2D arrays
    By tylerkung in forum New To Java
    Replies: 3
    Last Post: 09-23-2011, 01:45 PM
  5. Battleship 2D Array Program
    By AaronHopkins in forum New To Java
    Replies: 6
    Last Post: 04-05-2011, 04:38 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •