Skip to main content
Commonmark migration
Source Link

#Java, 204 205 204 203 bytes cracked!

Java, 204 205 204 203 bytes cracked!

Crack of one of Rohan Jhunjhunwala's submissions.

class y{public static void main(String[]b){int n=2,l=870119,i,f,j;i=new java.util.Scanner(System.in).nextInt();while(i>0){f=0;for(j=1;j<l;j++){if(n%j==0){f++;}}if(f==2){System.out.println(n);i--;}n++;}}}

The spec said it only needs to work up to the 2^16-1 = 65535th prime (821603).
We can remove the string x="z...z" and the loop to increment this value and set l to be a working value greater than or equal to 821603. In removing that we can also remove the initialisation of i, so we get ne numeric characters 0791819 to use. The smallest valid, working value for l is now 870119.

Test it on ideone

#Java, 204 205 204 203 bytes cracked!

Crack of one of Rohan Jhunjhunwala's submissions.

class y{public static void main(String[]b){int n=2,l=870119,i,f,j;i=new java.util.Scanner(System.in).nextInt();while(i>0){f=0;for(j=1;j<l;j++){if(n%j==0){f++;}}if(f==2){System.out.println(n);i--;}n++;}}}

The spec said it only needs to work up to the 2^16-1 = 65535th prime (821603).
We can remove the string x="z...z" and the loop to increment this value and set l to be a working value greater than or equal to 821603. In removing that we can also remove the initialisation of i, so we get ne numeric characters 0791819 to use. The smallest valid, working value for l is now 870119.

Test it on ideone

Java, 204 205 204 203 bytes cracked!

Crack of one of Rohan Jhunjhunwala's submissions.

class y{public static void main(String[]b){int n=2,l=870119,i,f,j;i=new java.util.Scanner(System.in).nextInt();while(i>0){f=0;for(j=1;j<l;j++){if(n%j==0){f++;}}if(f==2){System.out.println(n);i--;}n++;}}}

The spec said it only needs to work up to the 2^16-1 = 65535th prime (821603).
We can remove the string x="z...z" and the loop to increment this value and set l to be a working value greater than or equal to 821603. In removing that we can also remove the initialisation of i, so we get ne numeric characters 0791819 to use. The smallest valid, working value for l is now 870119.

Test it on ideone

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

#Java, 204 205 204 203 bytes cracked!cracked!

Crack of one of Rohan Jhunjhunwala's submissionRohan Jhunjhunwala's submissions.

class y{public static void main(String[]b){int n=2,l=870119,i,f,j;i=new java.util.Scanner(System.in).nextInt();while(i>0){f=0;for(j=1;j<l;j++){if(n%j==0){f++;}}if(f==2){System.out.println(n);i--;}n++;}}}

The spec said it only needs to work up to the 2^16-1 = 65535th prime (821603).
We can remove the string x="z...z" and the loop to increment this value and set l to be a working value greater than or equal to 821603. In removing that we can also remove the initialisation of i, so we get ne numeric characters 0791819 to use. The smallest valid, working value for l is now 870119.

Test it on ideone

#Java, 204 205 204 203 bytes cracked!

Crack of one of Rohan Jhunjhunwala's submissions.

class y{public static void main(String[]b){int n=2,l=870119,i,f,j;i=new java.util.Scanner(System.in).nextInt();while(i>0){f=0;for(j=1;j<l;j++){if(n%j==0){f++;}}if(f==2){System.out.println(n);i--;}n++;}}}

The spec said it only needs to work up to the 2^16-1 = 65535th prime (821603).
We can remove the string x="z...z" and the loop to increment this value and set l to be a working value greater than or equal to 821603. In removing that we can also remove the initialisation of i, so we get ne numeric characters 0791819 to use. The smallest valid, working value for l is now 870119.

Test it on ideone

#Java, 204 205 204 203 bytes cracked!

Crack of one of Rohan Jhunjhunwala's submissions.

class y{public static void main(String[]b){int n=2,l=870119,i,f,j;i=new java.util.Scanner(System.in).nextInt();while(i>0){f=0;for(j=1;j<l;j++){if(n%j==0){f++;}}if(f==2){System.out.println(n);i--;}n++;}}}

The spec said it only needs to work up to the 2^16-1 = 65535th prime (821603).
We can remove the string x="z...z" and the loop to increment this value and set l to be a working value greater than or equal to 821603. In removing that we can also remove the initialisation of i, so we get ne numeric characters 0791819 to use. The smallest valid, working value for l is now 870119.

Test it on ideone

added 74 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

#Java, 204 205 204 203 bytes cracked!

Crack of one of Rohan Jhunjhunwala's submissions.

class y{public static void main(String[]b){int n=2,l=870119,i,f,j;i=new java.util.Scanner(System.in).nextInt();while(i>0){f=0;for(j=1;j<l;j++){if(n%j==0){f++;}}if(f==2){System.out.println(n);i--;}n++;}}}

The spec said it only needs to work up to the 2^16-1 = 65535th prime (821603).
We can remove the string x="z...z" and the loop to increment this value and set l to be a working value greater than or equal to 821603. In removing that we can also remove the initialisation of i, so we get ne numeric characters 0791819 to use. The smallest valid, working value for l is now 870119.

Test it on ideone

#Java, 204 205 204 203 bytes

Crack of one of Rohan Jhunjhunwala's submissions.

class y{public static void main(String[]b){int n=2,l=870119,i,f,j;i=new java.util.Scanner(System.in).nextInt();while(i>0){f=0;for(j=1;j<l;j++){if(n%j==0){f++;}}if(f==2){System.out.println(n);i--;}n++;}}}

The spec said it only needs to work up to the 2^16-1 = 65535th prime (821603).
We can remove the string x="z...z" and the loop to increment this value and set l to be a working value greater than or equal to 821603. In removing that we can also remove the initialisation of i, so we get ne numeric characters 0791819 to use. The smallest valid, working value for l is now 870119.

Test it on ideone

#Java, 204 205 204 203 bytes cracked!

Crack of one of Rohan Jhunjhunwala's submissions.

class y{public static void main(String[]b){int n=2,l=870119,i,f,j;i=new java.util.Scanner(System.in).nextInt();while(i>0){f=0;for(j=1;j<l;j++){if(n%j==0){f++;}}if(f==2){System.out.println(n);i--;}n++;}}}

The spec said it only needs to work up to the 2^16-1 = 65535th prime (821603).
We can remove the string x="z...z" and the loop to increment this value and set l to be a working value greater than or equal to 821603. In removing that we can also remove the initialisation of i, so we get ne numeric characters 0791819 to use. The smallest valid, working value for l is now 870119.

Test it on ideone

added 3 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
added 83 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
added 98 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading