Skip to content

Commit

Permalink
feat: bring back Randomizer
Browse files Browse the repository at this point in the history
  • Loading branch information
LapisBerry committed May 24, 2024
1 parent dd1f2e5 commit 66b8eb6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/java/com/lapisberry/utils/Randomizer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.lapisberry.utils;

import java.util.ArrayList;
import java.util.Collections;

/**
* The {@code Randomizer} class
* <p>
* This class provides static methods for randomizing things.
* <p>
* Like shuffling an {@code ArrayList} or getting a random integer.
*/
public final class Randomizer {
public static int getRandomInt(int bound) {
return (int) (Math.random() * bound);
}

public static void shuffleArrayList(ArrayList<?> list) {
Collections.shuffle(list);
}
}

0 comments on commit 66b8eb6

Please sign in to comment.