Jump to content

Make X


Recommended Posts

Posted (edited)

I've seen in quite a few scripts that for Make X people use random(28, 1000)

or something similar... (I'm guilty of this), So I made one that is a decent bit more inconspicuous.

	public String makeX() {
		int num = random(1, 9);
		int length = random(2, 4);
		String finishednum = "";
		if (num < 3) {
			length = random(3, 4);
		}
		for (int i = 0; i < length; i++) {
			finishednum += "" + random(num - 1, num > 8 ? num : num + 1);
		}
		if (Integer.parseInt(finishednum) < 28) {
			return makeX();
		}
		return finishednum;
	}

By default if it makes less than 28, it will loop back into the function.

You'll get results like 122, 988, 77, 34, 343, ect.

Instead of results like 294, 984, 349, 28, 69, 77.

Random isn't a horrible result, but it looks like you smash your number pad. But in real life, we generally do numbers that are close to each other, hence + 1, - 1;

TLDR; Small anti-ban.

It's pretty simple, but I figured someone could use it.

Edited by Iwin
  • Like 2
  • 1 month later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...