Details solution.docx

This preview shows page 1 - 3 out of 7 pages.

Fragmatic Programmer O C C A S I O N A L A D V E N T U R E S I N P R O G R A M M I N G S E A R C H Home About Subscribe Contact HOME ABOUT ME CONTACT SUBSCRIBE TO RSS // you're reading... J AVA Boggle Solver POSTED BY ANDY ⋅ JULY 2, 2012 ⋅ 1 COMMENT FILED UNDER BOGGLE , DOJO , JAVA Boggle is a game where the aim is to find words from within grids of letters. In a standard game of Boggle the letters are arranged in a 4×4 grid and words can be formed by joining adjacent letters (this includes horizontally, vertically & diagonally) but each grid element can only be visited once per word. The aim of the game is to find as many words of 3 letters or more as possible within a time limit and points are awarded based on the length & number of words that have been found. For more information see Boggle Solving the Problem This problem can be divided into several smaller elements: A Dictionary that contains all of the acceptable words A Grid which allows the generation of random arrangement of letters. This can be extended to use a simulation of the dice that are used in the physical game of Boggle so that an appropriate frequency of vowels & consonants are presented. An algorithm that traverses the grid to find the words that are contained within it’s arrangement of letters. Dictionary.java Let’s start with the Dictionary. Rather than attempt to emulate Samuel Johnson and build the dictionary from scratch, we will start with a text file which contains all of the allowed words. Each word S earch
Image of page 1

Subscribe to view the full document.

will be read from the file and stored it as an element in a Collection, I opted to use a NavigableSet as all the elements are sorted and it provides a very elegant way to retrieve subsets of the collection which will come in very useful. We will be using this NavigableSet as if it was a Trie .
Image of page 2
Image of page 3
You've reached the end of this preview.
  • Winter '18
  • Dr Sibt
  • Dice, Boggle

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern