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.

ArrayList Problem

  • 13-04-2012 04:04PM
    #1
    Registered Users, Registered Users 2 Posts: 28


    import java.util.*;
    import java.io.* ;

    public class WordSearchPuzzle
    {
    private char[][] puzzle ;
    private ArrayList<String> puzzleWords ;

    public WordSearchPuzzle(String[] args)
    {
    // puzzle generation using user specified words
    // The user passes in a list of words to be used
    // for generating the word search grid.
    }


    Hello im having great difficulty with this. I am finding it hard to figure out how to store a list of user defined words so i can later use to put into a 2d grid for a word Search
    Any Help would be appreciated
    Tagged:


Comments

  • Registered Users, Registered Users 2 Posts: 130 ✭✭irishfeller


    Dmeaney92 wrote: »
    import java.util.*;
    import java.io.* ;

    public class WordSearchPuzzle
    {
    private char[][] puzzle ;
    private ArrayList<String> puzzleWords ;

    public WordSearchPuzzle(String[] args)
    {
    // puzzle generation using user specified words
    // The user passes in a list of words to be used
    // for generating the word search grid.
    }


    Hello im having great difficulty with this. I am finding it hard to figure out how to store a list of user defined words so i can later use to put into a 2d grid for a word Search
    Any Help would be appreciated


    What bit are you stuck on? Is your list of words supplied in the arraylist and you have to populate a 2d array?


  • Registered Users, Registered Users 2 Posts: 28 Dmeaney92


    When we run the program the user has to enter in X number of Strings and they should be stored so they can be used in a later method to find the longest word entered in and be multiplied it by whatever number to make the 2d grid to ensure the words fit into the grid


  • Registered Users, Registered Users 2 Posts: 130 ✭✭irishfeller


    Hey there is already a thread on this exact question in this forum:

    http://www.boards.ie/vbulletin/showthread.php?t=2056594368

    Must be one of the classmates eh.


  • Registered Users, Registered Users 2 Posts: 28 Dmeaney92


    public WordSearchPuzzle(ArrayList<String> userSpecifiedWords)

    Sorry i got the header wrong it should be the one above me.
    Thanks for the link and yes it is haha we are just trying to see if i can get the question around. We just cant get the right solution


Advertisement