Random Alphabet Maker
//package com.ou.android.game.common; import java.util.ArrayList; class RandomAlphabetMaker { private ArrayList<String> mList; int mCount; public RandomAlphabetMaker(int count) { mCount = count; init(); } private void init() { mList = new ArrayList<String>(); char a = 'A'; for (int i = 0; i < mCount; i++) { char item = (char) (a + i); String s = Character.toString(item); mList.add(s); } } public ArrayList<String> getRandomList() { ArrayList<String> ret = new ArrayList<String>(); if (mList.size() == 0) { init(); } while (mList.size() > 0) { int index = (int) (Math.random() * 100) % mList.size(); ret.add(mList.get(index)); mList.remove(index); } return ret; } }