Skip to main content
Commonmark migration
Source Link

###Explanation: Æ=Vg"|\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw // U = road size // V = direction Æ Ã // Loop X through [0...U] = ; // Set U to: "|\/" // "|/" Vg // [V] ² // Double U i1 ) // Insert at index 1: S+ // " " + X%2?S:U // X%2?" ":U i // + " " i // Insert at index 0: Sp // " " repeated this many times: [TZÊ-YY] // [0,U.length - X,X] gV // [V] w // Reverse output

Explanation:

Æ=Vg"|\\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw
                                            // U = road size
                                            // V = direction
Æ                                     Ã     // Loop X through [0...U]
 =        ;                                 //   Set U to:
    "|\\/"                                  //       "|\/"
  Vg                                        //            [V]
           ²                                //  Double U
            i1          )                   //  Insert at index 1:
              S+                            //    " " +
                 X%2?S:U                    //         X%2?" ":U
                i                           //                  + " "
                         i                  //  Insert at index 0:
                          Sp                //    " " repeated this many times:
                            [TZÊ-YY]        //      [0,U.length - X,X]
                                    gV      //                        [V]
                                        w   // Reverse output
      
  

###Explanation: Æ=Vg"|\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw // U = road size // V = direction Æ Ã // Loop X through [0...U] = ; // Set U to: "|\/" // "|/" Vg // [V] ² // Double U i1 ) // Insert at index 1: S+ // " " + X%2?S:U // X%2?" ":U i // + " " i // Insert at index 0: Sp // " " repeated this many times: [TZÊ-YY] // [0,U.length - X,X] gV // [V] w // Reverse output

Explanation:

Æ=Vg"|\\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw
                                            // U = road size
                                            // V = direction
Æ                                     Ã     // Loop X through [0...U]
 =        ;                                 //   Set U to:
    "|\\/"                                  //       "|\/"
  Vg                                        //            [V]
           ²                                //  Double U
            i1          )                   //  Insert at index 1:
              S+                            //    " " +
                 X%2?S:U                    //         X%2?" ":U
                i                           //                  + " "
                         i                  //  Insert at index 0:
                          Sp                //    " " repeated this many times:
                            [TZÊ-YY]        //      [0,U.length - X,X]
                                    gV      //                        [V]
                                        w   // Reverse output
      
  
added 15 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 18
  • 38

Japt -R, 40 bytes

Æ=Vg"|\\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw

Try it online!

###Explanation: Æ=Vg"|\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw U// U = road size V// V = direction Æ Ã // Loop X through [0...U] = ; // Set U to: "|\/" // "|/" Vg // IndexOf(V) [V] ² // Double U i1 ) // Insert at index 1: S+ // " " + X%2?S:U // X%2?" ":U i // + " " i // Insert at index 0: Sp // " " repeated this many times: [TZÊ-YY] // [0,U.length - X,X] gV // IndexOf(V) [V] w // Reverse output

Japt -R, 40 bytes

Æ=Vg"|\\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw

Try it online!

###Explanation: Æ=Vg"|\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw U = road size V = direction Æ Ã // Loop X through [0...U] = ; // Set U to: "|\/" // "|/" Vg // IndexOf(V) ² // Double U i1 ) // Insert at index 1: S+ // " " + X%2?S:U // X%2?" ":U i // + " " i // Insert at index 0: Sp // " " repeated this many times: [TZÊ-YY] // [0,U.length - X,X] gV // IndexOf(V) w // Reverse output

Japt -R, 40 bytes

Æ=Vg"|\\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw

Try it online!

###Explanation: Æ=Vg"|\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw // U = road size // V = direction Æ Ã // Loop X through [0...U] = ; // Set U to: "|\/" // "|/" Vg // [V] ² // Double U i1 ) // Insert at index 1: S+ // " " + X%2?S:U // X%2?" ":U i // + " " i // Insert at index 0: Sp // " " repeated this many times: [TZÊ-YY] // [0,U.length - X,X] gV // [V] w // Reverse output

added 1191 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 18
  • 38

Japt -R, 40 bytes

Æ=Vg"|\\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw

Try it online!

###Explanation: Æ=Vg"|\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw U = road size V = direction Æ Ã // Loop X through [0...U] = ; // Set U to: "|\/" // "|/" Vg // IndexOf(V) ² // Double U i1 ) // Insert at index 1: S+ // " " + X%2?S:U // X%2?" ":U i // + " " i // Insert at index 0: Sp // " " repeated this many times: [TZÊ-YY] // [0,U.length - X,X] gV // IndexOf(V) w // Reverse output

Japt -R, 40 bytes

Æ=Vg"|\\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw

Try it online!

Japt -R, 40 bytes

Æ=Vg"|\\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw

Try it online!

###Explanation: Æ=Vg"|\/";²i1S+iX%2?S:U)iSp[TZÊ-YY]gVÃw U = road size V = direction Æ Ã // Loop X through [0...U] = ; // Set U to: "|\/" // "|/" Vg // IndexOf(V) ² // Double U i1 ) // Insert at index 1: S+ // " " + X%2?S:U // X%2?" ":U i // + " " i // Insert at index 0: Sp // " " repeated this many times: [TZÊ-YY] // [0,U.length - X,X] gV // IndexOf(V) w // Reverse output

added 6 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 18
  • 38
Loading
Source Link
Oliver
  • 7.9k
  • 2
  • 18
  • 38
Loading