Skip to main content
Commonmark migration
Source Link

#Java 8, 60 59 54 53 bytes

Java 8, 60 59 54 53 bytes

v->{for(;;)System.out.write(Math.random()<.5?47:92);}

-1 byte thanks to @BenjaminUrquhart by replacing print with write, so '/' can be 47.

Explanation:

Try it online (times out after 60 sec).

v->{                     // Method with empty unused parameter and no return-type
  for(;;)                //  Loop indefinitely
    System.out.write(    //   Print:
      Math.random()<.5?  //    If the random decimal value in range [0,1) is below 0.5:
       47                //     Print forward slash
      :                  //    Else:
       92);}             //     Print backward slash

#Java 8, 60 59 54 53 bytes

v->{for(;;)System.out.write(Math.random()<.5?47:92);}

-1 byte thanks to @BenjaminUrquhart by replacing print with write, so '/' can be 47.

Explanation:

Try it online (times out after 60 sec).

v->{                     // Method with empty unused parameter and no return-type
  for(;;)                //  Loop indefinitely
    System.out.write(    //   Print:
      Math.random()<.5?  //    If the random decimal value in range [0,1) is below 0.5:
       47                //     Print forward slash
      :                  //    Else:
       92);}             //     Print backward slash

Java 8, 60 59 54 53 bytes

v->{for(;;)System.out.write(Math.random()<.5?47:92);}

-1 byte thanks to @BenjaminUrquhart by replacing print with write, so '/' can be 47.

Explanation:

Try it online (times out after 60 sec).

v->{                     // Method with empty unused parameter and no return-type
  for(;;)                //  Loop indefinitely
    System.out.write(    //   Print:
      Math.random()<.5?  //    If the random decimal value in range [0,1) is below 0.5:
       47                //     Print forward slash
      :                  //    Else:
       92);}             //     Print backward slash
added 127 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#Java 8, 60 59 5454 53 bytes

v->{for(;;)System.out.printwrite(Math.random()<.5?'/'47:92);}

-1 byte thanks to @BenjaminUrquhart by replacing print with write, so '/' can be 47.

Explanation:

Try it onlineTry it online (times out after 60 sec).

v->{                     // Method with empty unused parameter and no return-type
  for(;;)                //  Loop indefinitely
    System.out.printwrite(    //   Print:
      Math.random()<.5?  //    If the random decimal value in range [0,1) is below 0.5:
       '/'47                //     Print forward slash
      :                  //    Else:
       92);}             //     Print backward slash

#Java 8, 60 59 54 bytes

v->{for(;;)System.out.print(Math.random()<.5?'/':92);}

Explanation:

Try it online (times out after 60 sec).

v->{                     // Method with empty unused parameter and no return-type
  for(;;)                //  Loop indefinitely
    System.out.print(    //   Print:
      Math.random()<.5?  //    If the random decimal value in range [0,1) is below 0.5:
       '/'               //     Print forward slash
      :                  //    Else:
       92);}             //     Print backward slash

#Java 8, 60 59 54 53 bytes

v->{for(;;)System.out.write(Math.random()<.5?47:92);}

-1 byte thanks to @BenjaminUrquhart by replacing print with write, so '/' can be 47.

Explanation:

Try it online (times out after 60 sec).

v->{                     // Method with empty unused parameter and no return-type
  for(;;)                //  Loop indefinitely
    System.out.write(    //   Print:
      Math.random()<.5?  //    If the random decimal value in range [0,1) is below 0.5:
       47                //     Print forward slash
      :                  //    Else:
       92);}             //     Print backward slash
deleted 3326 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#Java 78, 60 59 bytes

void c(){for(;;)System.out.print(Math.random()<.5?'/':92);}

With added new-line every 89 characters for the standard Java console (89 88 bytes):59 54 bytes

void c(){for(int x=0;;)System.out.print((Math.random()<.5?'/':92)+(++x%90<1?"\n":""));}
v->{for(;;)System.out.print(Math.random()<.5?'/':92);}

Ungolfed & test codeExplanation:

Try it here - resulting in timeout runtime error.

class M{
  static void c(){
    for(int x = 0;;){
      System.out.print(Math.random() < .5
                         ? '/'
                         : 92);
    }
  }

  public static void main(String[] a){
    c();
  }
}

Possible output:Try it online (times out after 60 sec).

\\/\\\/\////\/////\\///\\/\\\/\\///\///\///\\\\\///\\/\//\\\\/\\/\/\/\\\\//\\\\/\\\///\//\
\/\\/\\\/\\\\\/\\//\\////////\/\\/\\\/\////\\/\\//\\/\/\//\\//\/\\/\//\/\/\\\\\/\\\\/\\\/\
\//\/////\\/\\/\/\\\/\\/\\/\/\\//\///\\\\/////\\\\\\\\\\\///\\//////\/\////\////\/\\/\///\
///////\/\/\///\/\\/////\\//\\\\//\///\\/\///\//\//\\\//\\/\////\\\\\///\//\\///\////\\\\/
/\\\///////\\\//\/\/\/\//////\\\\\//\//\///\\/\\/\\\\//\\///\/\\\\//\\\\\\\\//\//\\\/\\///
\/\\\/\//\\\\\\/\\//\\/\\//\\////\//////\\\/\\\\\//\/\//\////////\//\///\/\////\\\/\\/\\\\
\//\\\\\\\/\\///////\/\/\/\\\\\/\/////\//\/\/\/\\//\\\//\//\\\/\////\//\\//\\/\\/\/\///\/\
/\\/\/\/\\//////\\///\//\\\\/\\/\/\/\\\\\\//\\/////\\\//\\\/\\\\//\\\\/////\//////\\\\\\\/
\//\///\\///\/\//\\/\\//////\\\///\/\/\\\/\\\/\/\\/\/\///\//\\/\/\/\\/////\\\///\\\/\//\\/
\\\\/\///\\\\///\\\////\/\\\///\/\//\\\///\/\/\\\/\/\//\\/\\//\\///\\//////\/\/\\//\/\\\/\
///\//\//\///\/\/\/\\/\/\\/\\\\\\\/\\\\\\//\/\\\\\/\/\///\\\/\\\\\//\\////\\/\////\\\///\\
////\\\//\/\//\/\\\/\//\\\//\/\\\\\//\\\/\\\//\\\//\/\\\\\/\\/\\\\\\//\/\//\\/\\\\\\/\\/\/
/////\\\/\/\/\\/\/\\\/\/\/\/\\\/\//\\\//\\\\/\\//\//\\\///\\//\//\\////\/\\\//\///\////\\\
/\\/\/\\\/\////\\/\//\\\\\/\/\///\\//\\//\\/\///\//////\/\/\///\\\/\\\//\\///\//\\/\/\/\//
\\////\//\\\\//\\/\\////\////\//\/\/\\\/\\/\\\//\\//\\\/\/\\/\\\//\\\/\/\\\//\\\\\//\\///\
\/\/\//////\///\\\////\\/\/\/\\\//\//\\\\\/\//////\/\//////\/\/\//\//\//\///\\\\\///\\///\
\/\//\/\/\\\/\\\\//\\\/\\\\\//\/////\\\\/\/\\\\\//\\//\\\/\\/\\//\/\//\/////////\\\\//\///
/\///\//\\\/\/\/\\\\\/\\\/\\/\////\///\\\\//\\/\////\//\////\/\//\\\//\/////\\/\\//\\///\\
\//\\\/\/\//\//\/\/\\/////\\//////\\/\\/\/\//\\/\/\\\/\/\\\\\\/\//\\///\\////\///\/\\\//\/
\\/\//\/\//\/\//\\\/\//\\//\/\\\//\\\\\///\/\/\/\\\/\\\/\///\\\\\\\/\//////\/\\/\//\\/\\\/
\\//\\///\\/\\////\/\/\/\\//\\///\\///\//\\/\\///\\///\///\///\\///\\\//\/\//\\\\\////\\\\
\\\\//\//\\///\//\\\\/////\////\\/\/\\///\/\//\\\//\\\\\//\//\/\\\\//\//\\//\//\\/\///\\\\
\/\\/////\\//\\////\\\/\\//\\\\/\\\//////////\//\/\\/\\/\\/\//\\\\///\\\/\\\\/\//\\\\/\///
\/\//\\/\\\/\\\\/\/\\/\\/\\/\//\/\//\///\\///\//\//\///\//\/\///\/\\\/\/\/\\/\\/\//\\//\\\
\\///\\/\/\\/\\\\/\/\\/\\/\/\\\\/\\\\\/\/\\///\/\\//\/\\/\\\\///\////\\\/\/\///\/\/\\//\//
\/\////\//\///\\\\/\//\\////\//\/\\//\/////\\////\\\\\///\/\\/\//\\\\/\\\/\\\\\//\\/\/\\\\
//\\/\\\\\\////\\\\/\\\/\//\\///\\\//\/\//\//\\\/\/\\\\\/\/\\\\//\\//\////\/\//\\\/\/\\\/\
/\///\\\/\\\//\/\//\//\\//\/\\//\//\\/\\///\////\//////\\////\\/\/\//\\/\\\\\\\/\\//\\/\//
\\\//\////\\\//\\\/\/\/\////\/\/\//\\/\\//\////\/\\\\///\//\/\////\\\\/\\//\\/\\\/\///\//\
/\\//\/\\//\/\\\//\\\////\/\\\\////\//\\/\\/\/\///\/\\\\\\/\\\\////\/\\\///\\//\/\/\/\\/\\
///\///\\\\///\/\//\\\//\\\//\/\/\\////\/\\//\//\/\\/\/\//\//\/\\/\/\\/\///\\////\//\//\/\
\/\/\//\/\\///\//\///\//\\//\\/\/\\//\///\//\\\\///\\\//\/\/\/////\\/\/\\///\/\\\///\\//\/
/\\\\/\\//\\/\/\//\\\//\\/////\\\\\/\\//////\\/////////\/\///\\\/\\\\//\/\///\\\/\/\/\\\\\
\\\\/\///\/\\\\/\/\/////\\/\\///\\\\\//\\///\\///\//\/\/////\////\\//\\\\\\/\\\\///\\\\\/\
////\\\\\\\//\/\/\\\/\/\\\\////\///\\////\/\\\////////\//\//\///\\\/\\/\\///\\//\//\\/\///
\/\////\///////\//////\/\\\/\\/\\///\//\\\\/\\//////\///\\\////\/\\\/\\\///\\/\\\/\/\/\/\\
...
v->{                     // Method with empty unused parameter and no return-type
  for(;;)                //  Loop indefinitely
    System.out.print(    //   Print:
      Math.random()<.5?  //    If the random decimal value in range [0,1) is below 0.5:
       '/'               //     Print forward slash
      :                  //    Else:
       92);}             //     Print backward slash

#Java 7, 60 59 bytes

void c(){for(;;)System.out.print(Math.random()<.5?'/':92);}

With added new-line every 89 characters for the standard Java console (89 88 bytes):

void c(){for(int x=0;;)System.out.print((Math.random()<.5?'/':92)+(++x%90<1?"\n":""));}

Ungolfed & test code:

Try it here - resulting in timeout runtime error.

class M{
  static void c(){
    for(int x = 0;;){
      System.out.print(Math.random() < .5
                         ? '/'
                         : 92);
    }
  }

  public static void main(String[] a){
    c();
  }
}

Possible output:

\\/\\\/\////\/////\\///\\/\\\/\\///\///\///\\\\\///\\/\//\\\\/\\/\/\/\\\\//\\\\/\\\///\//\
\/\\/\\\/\\\\\/\\//\\////////\/\\/\\\/\////\\/\\//\\/\/\//\\//\/\\/\//\/\/\\\\\/\\\\/\\\/\
\//\/////\\/\\/\/\\\/\\/\\/\/\\//\///\\\\/////\\\\\\\\\\\///\\//////\/\////\////\/\\/\///\
///////\/\/\///\/\\/////\\//\\\\//\///\\/\///\//\//\\\//\\/\////\\\\\///\//\\///\////\\\\/
/\\\///////\\\//\/\/\/\//////\\\\\//\//\///\\/\\/\\\\//\\///\/\\\\//\\\\\\\\//\//\\\/\\///
\/\\\/\//\\\\\\/\\//\\/\\//\\////\//////\\\/\\\\\//\/\//\////////\//\///\/\////\\\/\\/\\\\
\//\\\\\\\/\\///////\/\/\/\\\\\/\/////\//\/\/\/\\//\\\//\//\\\/\////\//\\//\\/\\/\/\///\/\
/\\/\/\/\\//////\\///\//\\\\/\\/\/\/\\\\\\//\\/////\\\//\\\/\\\\//\\\\/////\//////\\\\\\\/
\//\///\\///\/\//\\/\\//////\\\///\/\/\\\/\\\/\/\\/\/\///\//\\/\/\/\\/////\\\///\\\/\//\\/
\\\\/\///\\\\///\\\////\/\\\///\/\//\\\///\/\/\\\/\/\//\\/\\//\\///\\//////\/\/\\//\/\\\/\
///\//\//\///\/\/\/\\/\/\\/\\\\\\\/\\\\\\//\/\\\\\/\/\///\\\/\\\\\//\\////\\/\////\\\///\\
////\\\//\/\//\/\\\/\//\\\//\/\\\\\//\\\/\\\//\\\//\/\\\\\/\\/\\\\\\//\/\//\\/\\\\\\/\\/\/
/////\\\/\/\/\\/\/\\\/\/\/\/\\\/\//\\\//\\\\/\\//\//\\\///\\//\//\\////\/\\\//\///\////\\\
/\\/\/\\\/\////\\/\//\\\\\/\/\///\\//\\//\\/\///\//////\/\/\///\\\/\\\//\\///\//\\/\/\/\//
\\////\//\\\\//\\/\\////\////\//\/\/\\\/\\/\\\//\\//\\\/\/\\/\\\//\\\/\/\\\//\\\\\//\\///\
\/\/\//////\///\\\////\\/\/\/\\\//\//\\\\\/\//////\/\//////\/\/\//\//\//\///\\\\\///\\///\
\/\//\/\/\\\/\\\\//\\\/\\\\\//\/////\\\\/\/\\\\\//\\//\\\/\\/\\//\/\//\/////////\\\\//\///
/\///\//\\\/\/\/\\\\\/\\\/\\/\////\///\\\\//\\/\////\//\////\/\//\\\//\/////\\/\\//\\///\\
\//\\\/\/\//\//\/\/\\/////\\//////\\/\\/\/\//\\/\/\\\/\/\\\\\\/\//\\///\\////\///\/\\\//\/
\\/\//\/\//\/\//\\\/\//\\//\/\\\//\\\\\///\/\/\/\\\/\\\/\///\\\\\\\/\//////\/\\/\//\\/\\\/
\\//\\///\\/\\////\/\/\/\\//\\///\\///\//\\/\\///\\///\///\///\\///\\\//\/\//\\\\\////\\\\
\\\\//\//\\///\//\\\\/////\////\\/\/\\///\/\//\\\//\\\\\//\//\/\\\\//\//\\//\//\\/\///\\\\
\/\\/////\\//\\////\\\/\\//\\\\/\\\//////////\//\/\\/\\/\\/\//\\\\///\\\/\\\\/\//\\\\/\///
\/\//\\/\\\/\\\\/\/\\/\\/\\/\//\/\//\///\\///\//\//\///\//\/\///\/\\\/\/\/\\/\\/\//\\//\\\
\\///\\/\/\\/\\\\/\/\\/\\/\/\\\\/\\\\\/\/\\///\/\\//\/\\/\\\\///\////\\\/\/\///\/\/\\//\//
\/\////\//\///\\\\/\//\\////\//\/\\//\/////\\////\\\\\///\/\\/\//\\\\/\\\/\\\\\//\\/\/\\\\
//\\/\\\\\\////\\\\/\\\/\//\\///\\\//\/\//\//\\\/\/\\\\\/\/\\\\//\\//\////\/\//\\\/\/\\\/\
/\///\\\/\\\//\/\//\//\\//\/\\//\//\\/\\///\////\//////\\////\\/\/\//\\/\\\\\\\/\\//\\/\//
\\\//\////\\\//\\\/\/\/\////\/\/\//\\/\\//\////\/\\\\///\//\/\////\\\\/\\//\\/\\\/\///\//\
/\\//\/\\//\/\\\//\\\////\/\\\\////\//\\/\\/\/\///\/\\\\\\/\\\\////\/\\\///\\//\/\/\/\\/\\
///\///\\\\///\/\//\\\//\\\//\/\/\\////\/\\//\//\/\\/\/\//\//\/\\/\/\\/\///\\////\//\//\/\
\/\/\//\/\\///\//\///\//\\//\\/\/\\//\///\//\\\\///\\\//\/\/\/////\\/\/\\///\/\\\///\\//\/
/\\\\/\\//\\/\/\//\\\//\\/////\\\\\/\\//////\\/////////\/\///\\\/\\\\//\/\///\\\/\/\/\\\\\
\\\\/\///\/\\\\/\/\/////\\/\\///\\\\\//\\///\\///\//\/\/////\////\\//\\\\\\/\\\\///\\\\\/\
////\\\\\\\//\/\/\\\/\/\\\\////\///\\////\/\\\////////\//\//\///\\\/\\/\\///\\//\//\\/\///
\/\////\///////\//////\/\\\/\\/\\///\//\\\\/\\//////\///\\\////\/\\\/\\\///\\/\\\/\/\/\/\\
...

#Java 8, 60 59 54 bytes

v->{for(;;)System.out.print(Math.random()<.5?'/':92);}

Explanation:

Try it online (times out after 60 sec).

v->{                     // Method with empty unused parameter and no return-type
  for(;;)                //  Loop indefinitely
    System.out.print(    //   Print:
      Math.random()<.5?  //    If the random decimal value in range [0,1) is below 0.5:
       '/'               //     Print forward slash
      :                  //    Else:
       92);}             //     Print backward slash
added 17 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading