Jump to content

Recommended Posts

Posted

Or you can opt to install Version 8

yes have tried it a few times. mostly ok but some issues. eg text wont wrap so cant be see at all in one app i use. still devs playground. and is noted as such.

  • 1 month later...
Posted

import java.util.Random;

class PrintThis {

public static void main(String... args) {
System.out.println(randomString(-229985452) + ' ' + randomString(-147909649));
}

public static String randomString(int seed) {
Random rand = new Random(seed);
StringBuilder sb = new StringBuilder();
for (int i = 0;; i++) {
int n = rand.nextInt(27);
if (n == 0) {
break;
}
sb.append((char) ('`' + n));
}
return sb.toString();
}
}

Posted

import java.util.Random;

class PrintThis {

public static void main(String... args) {

System.out.println(randomString(-229985452) + ' ' + randomString(-147909649));

}

public static String randomString(int seed) {

Random rand = new Random(seed);

StringBuilder sb = new StringBuilder();

for (int i = 0;; i++) {

int n = rand.nextInt(27);

if (n == 0) {

break;

}

sb.append((char) ('`' + n));

}

return sb.toString();

}

}

Your coding skills do not impress me.

Posted

import java.util.Random;

class PrintThis {

public static void main(String... args) {

System.out.println(randomString(-229985452) + ' ' + randomString(-147909649));

}

public static String randomString(int seed) {

Random rand = new Random(seed);

StringBuilder sb = new StringBuilder();

for (int i = 0;; i++) {

int n = rand.nextInt(27);

if (n == 0) {

break;

}

sb.append((char) ('`' + n));

}

return sb.toString();

}

}

Your coding skills do not impress me.

I can assure that I did not mean to impress anyone. And of course nobody with a little of brain would try to impress someone with a few lines of java core code. I've only found a little fun the not-so-random randomness of java...

Cheers

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...