Package pdp.scrabble.utility

Examples of pdp.scrabble.utility.Anagram


    private static List<AnagramLength> anagrams = null;

    /** Build anagram length list. */
    public static void initAnagrams() {
  anagrams = new ArrayList<AnagramLength>(Rack.MAX_RACK_LETTERS);
  Anagram anagram = new Anagram("0123456");

  for (int i = 0; i < Rack.MAX_RACK_LETTERS; i++) {
      anagrams.add(new AnagramLength());
  }

  Iterator<String> itr = anagram.get();
  while (itr.hasNext()) {
      String s = itr.next();
      int i = s.length() - 1;
      if (i > -1) {
    anagrams.get(i).add(s);
View Full Code Here


    @Override
    public String showPossibilities(String letters) {

  // Create all possible combinaison with letters
  Anagram ana = new Anagram(this.game, letters);

  // Show result
  Object[] str = ana.toArray();
  String selected = null;
  if (str.length > 0) {
      Object result = JOptionPane.showInputDialog(
        null, getGameLang("Choice"), letters,
        JOptionPane.INFORMATION_MESSAGE, null, str, str[0]);

      if (result != null) {
    selected = (String) result;
      }
      else {
    selected = null;
      }
  }
  else {
      Display.information("Show possibilities", "No available word !");
  }

  ana.clear();

  return selected;
    }
View Full Code Here

TOP

Related Classes of pdp.scrabble.utility.Anagram

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.