Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: battleship gui needed

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default battleship gui needed

    hi i have an assignment please help.....

    Design and implement a GUI front end for a computerised version of Battleships.

    Code for implementing a simple computerised version of Battleships has been supplied. Examine the code ensuring that you understand it.

    The game is played against the computer.

    A number of ships (default is 6) are place randomly on a 4 x 4 grid. A ship occupies one square only. The player then guesses the position of a ship. If he/she guesses correctly the ship is HIT and sinks. If the guess is incorrect the player loses a life. The default number of lives is 7. If the location has been guessed already, no lives are lost.

    When the game starts, a 4 x 4 grid should be displayed.
    The user should be allowed to enter/select a cell location. If the selected cell contains a ship, the ship will be destroyed. If not the player loses a life. The cell should display an appropriate picture, icon or message informing the user of its current state.

    The number of lives and number of ships remaining should be displayed.

    When the game ends an appropriate message should be shown informing the player whether he/she has won or lost. The positions of the ships should also be shown.

    The purpose of this assignment is that students demonstrate an understanding of the Java Swing library and that he/she can navigate and use the API effectively.

    Your finished GUI should be both user-friendly and aesthetically pleasing.

    Ideally, the user should have the option to play another game, to quit or give up mid-game. You may also wish to include other options such as help, different levels of difficulty etc.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: battleship gui needed

    This, in technical terms, is what we call a 'homework dump', implying you wish someone to do this for you. If so, then you've come to the wrong place (and actually requesting such is against any academic policy you may be under). If you wish for help in your attempts, then I recommend posting what you've tried, and state exactly where you were stuck. Help is typically better received when one asks a specific question regarding their code.

Similar Threads

  1. Connect Four GUI Help needed
    By Hobbs in forum What's Wrong With My Code?
    Replies: 4
    Last Post: December 9th, 2012, 09:04 PM
  2. JAva GUI Help needed. Please Help
    By Mini83 in forum AWT / Java Swing
    Replies: 8
    Last Post: August 17th, 2011, 07:04 PM
  3. [SOLVED] Battleship GUI Program
    By javapenguin in forum What's Wrong With My Code?
    Replies: 85
    Last Post: June 7th, 2010, 08:59 AM
  4. [SOLVED] Still need help with Battleship GUI.
    By javapenguin in forum What's Wrong With My Code?
    Replies: 0
    Last Post: June 6th, 2010, 05:57 PM