Пример #1
0
        @Override
        public void run() {
          final int N = getChildCount();

          final int K = 1; // irand(1,3);
          for (int i = 0; i < K; i++) {
            final View child = getChildAt((int) (Math.random() * N));
            place(child, true);
          }

          fillFreeList();

          if (mStarted) {
            mHandler.postDelayed(mJuggle, DELAY);
          }
        }
Пример #2
0
 static float frand() {
   return (float) (Math.random());
 }
Пример #3
0
 <T> T pick(SparseArray<T> sa) {
   return sa.valueAt((int) (Math.random() * sa.size()));
 }
Пример #4
0
 <T> T pick(T[] a) {
   return a[(int) (Math.random() * a.length)];
 }
Пример #5
0
 int pick(int[] a) {
   return a[(int) (Math.random() * a.length)];
 }