Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Complex java project(for me)

  • 23-09-2010 02:32PM
    #1
    Closed Accounts Posts: 11


    So i have a java project on Battleship to work on and this time i'm supposed to use only loops and if statements. My biggest problem is the design. Rough sketch of what i have so far:

    // initialize arrays and variables for the two players

    // initialize grids

    // ask username, ask PvP or PvC, place pieces(print to grids)

    // print grids to move

    // get move
    get coordinates, shoot(on board or not)
    hit or miss(points?)

    // switch players
    // computer turn
    generates coord, shoots, hit or miss(randomize)

    // switch players
    loop to (print grids to move)

    So far, this is what i've ben able to design. Again, i'll appreciate any and all assistance that is given.


Advertisement