[Question]
  [
Given two positive integers, \$A\$ and \$B\$, illustrate their [least common multiple](https://en.wikipedia.org/wiki/Least_common_multiple) by outputting two lines of dashes (`-`) with length [\$\text{lcm}\$](https://en.wikipedia.org/wiki/Least_common_multiple)\$(A, B)\$ after replacing every \$A\$th dash in the first line and every \$B\$th dash in the second line with vertical bars (`|`).
In this way, the end of each line will be the only place two `|`'s line up.
> 
> For example, if \$A = 6\$ and \$B = 4\$, \$\text{lcm}(6, 4) = 12\$, so:
> 
> 
> 
> ```
> two lines of 12 dashes:
> ------------
> ------------
> 
> replace every 6th dash in the first line with a vertical bar:
> -----|-----|
> ------------
> 
> replace every 4th dash in the second line with a vertical bar:
> -----|-----|
> ---|---|---|
> 
> ```
> 
> Thus the final output would be
> 
> 
> 
> ```
> -----|-----|
> ---|---|---|
> 
> ```
> 
> 
The order of the input numbers should correspond to the order of the lines.
**The shortest code in bytes wins.**
# Testcases
```
A B
line for A
line for B
1 1
|
|
1 2
||
-|
2 1
-|
||
2 2
-|
-|
6 4
-----|-----|
---|---|---|
4 6
---|---|---|
-----|-----|
2 3
-|-|-|
--|--|
3 2
--|--|
-|-|-|
3 6
--|--|
-----|
2 5
-|-|-|-|-|
----|----|
4 3
---|---|---|
--|--|--|--|
10 10
---------|
---------|
10 5
---------|
----|----|
10 6
---------|---------|---------|
-----|-----|-----|-----|-----|
24 8
-----------------------|
-------|-------|-------|
7 8
------|------|------|------|------|------|------|------|
-------|-------|-------|-------|-------|-------|-------|
6 8
-----|-----|-----|-----|
-------|-------|-------|
13 11
------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|
----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|
```
  
[Answer]
# Python 3, 80 bytes
Saved 1 byte thanks to Halvard Hummel and 1 byte thanks to Jonathan Allan.
```
import math
def f(*l):
 for k in 0,1:print(l[~k]//math.gcd(*l)*(~-l[k]*"-"+"|"))
```
[Test it online!](https://tio.run/##FcoxCoAgFADQvVN8nNQyi6Khq4hDZJZoKuIShFc3evOLT76Cn2o1dwwpw73lq1GHBo2pI2sDOiSwYDwM3bjGZHzGThQrOf9rf@7qjxQX5oSVFDHUohcRUjWeu4XUDw "Python 3 – Try It Online")
```
lambda*l:"\n".join(l[0]*l[1]//math.gcd(*l)//k*(~-k*"-"+"|")for k in l)
import math
```
[Test it online!](https://tio.run/##FcqxDsIgEADQ3a8gN92hLRpNBxO/pO2ANljkOAhhMTH9dRrf/PK3rkmuzT2mxjY@F6v5DpNA/0lekMfzrHm8zMZEW9f@/VpQMxkTNG5d0NDBEX5ALhUVlBfFdPAxp1LV/7dcvFR0OJxuRG0H "Python 3 – Try It Online") (82 bytes - initial answer)
This is the best I could do in Python 2 (81 bytes). It seems like I cannot comment on that answer, I'll just post this here instead:
```
from fractions import*
l=a,b=input()
for k in l:print a*b/gcd(*l)/k*(~-k*"-"+"|")
```
[Test it online!](https://tio.run/##K6gsycjPM/r/P60oP1chrSgxuSQzP69YITO3IL@oRIsrxzZRJ8k2M6@gtERDkystv0ghWyEzTyHHqqAoM69EIVErST89OUVDK0dTP1tLo043W0tJV0lbqUZJ8///aDMdk1gA "Python 2 – Try It Online")
*First attempt here, probably sub-optimal!*
[Answer]
# [Haskell](https://www.haskell.org/), 57 bytes
```
x%y=unlines[["-|"!!(0^mod a b)|a<-[1..lcm x y]]|b<-[x,y]]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/v0K10rY0LyczL7U4OlpJt0ZJUVHDIC43P0UhUSFJsybRRjfaUE8vJzlXoUKhMja2JgkoUKEDZP3PTczMU7BVKCgtCS4pUlBRMFE1/Q8A "Haskell – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 bytes
```
Ṭ€ị⁾|-ṁ€æl/Y
```
[Try it online!](https://tio.run/##y0rNyan8///hzjWPmtY83N39qHFfje7DnY1A3uFlOfqR////jzbTUTCJBQA "Jelly – Try It Online")
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~16~~ 15 bytes
```
'-|'!i&Zm:G\go)
```
Input is a column vector with the two numbers. [**Try it online!**](https://tio.run/##y00syfn/X123Rl0xUy0q18o9Jj1f8///aDNrBYtYAA)
As a bonus, the input can contain *more than two numbers*. [**Try it online!**](https://tio.run/##y00syfn/X123Rl0xUy0q18o9Jj1f8///aGNrBRNrBQtrBbNYAA)
### Explanation
```
'-|'   % Push this string
!      % Transpose. This is needed because of input [1; 1]
i      % Input column vector of 2 (or N) numbers
&Zm    % LCM of the 2 (or N) numbers, say L
:      % Range
G      % Push input again
\      % Modulus, element-wise with broadcast. Gives a 2×L (or N×L) matrix
g      % Convert to logical: gives false for zeros, true for nonzeros
o      % Convert to double: gives 0 for false, 1 for true
)      % Index into string (modular, 1-based). Implicitly display
```
[Answer]
# [R](https://www.r-project.org/), ~~109~~ 105 bytes
```
function(a,b){q=1:a*b
l=min(q[!q%%a])
x=rep("-",l*2)
x[c(seq(0,l,a),l+seq(0,l,b))]="|"
write(x,"",l,,"")}
```
[Try it online!](https://tio.run/##K/qfbqP7P600L7kkMz9PI1EnSbO60NbQKlEriSvHNjczT6MwWrFQVTUxVpOrwrYotUBDSVdJJ0fLCMiNTtYoTi3UMNDJ0UnU1MnRhnGSNDVjbZVqlLjKizJLUjUqdJSAOnSApGbt/3QNMx0Tzf8A "R – Try It Online")
Anonymous function. Computes `l=lcm(a,b)`, then generates a range from `0` to `l` by `a`, then from `l` to `2*l` by `b`, setting the indices to `|` and printing as a matrix with `l` columns.
[Answer]
# [Python 2](https://docs.python.org/2/), 66 bytes
```
l=a,b=input()
while a%b:a+=l[0]
for x in l:print a/x*('-'*~-x+'|')
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P8c2USfJNjOvoLREQ5OrPCMzJ1UhUTXJKlHbNifaIJYrLb9IoUIhM08hx6qgKDOvRCFRv0JLQ11XXatOt0JbvUZd8/9/Cx0zAA "Python 2 – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), 12 bytes
```
†?'-'|TUṪ`%N
```
[Try it online!](https://tio.run/##yygtzv7//1HDAnt1XfWakNCHO1clqPr9//8/2kTHLBYA "Husk – Try It Online")
Yeah, there is a lcm builtin in Husk. No, I don't need it.
Bonus: works with any number of input values
### Explanation
```
†?'-'|TUṪ`%N    input:[2,3]
        Ṫ`%N    table of all remainders of positive naturals divided by
                input numbers:
                             [[1,1],[0,2],[1,0],[0,1],[1,2],[0,0],[1,1],[0,2],...
       U        get all elements before the first repeated one:
                             [[1,1],[0,2],[1,0],[0,1],[1,2],[0,0]]
      T         transpose:   
                             [[1,0,1,0,1,0],[1,2,0,1,2,0]]
†?'-'|          replace all truthy elements with '-' and all falsy elements
                with '|': 
                             ["-|-|-|","--|--|"]
                implicit: since this is a full program, join the resulting array
                of strings with newlines, and print to stdout
```
[Answer]
# C, 72 bytes
```
i;f(x,y){for(i=1;i%y|i%x;)putchar(i++%x?45:124);puts("|");y>0&&f(y,-x);}
```
[Answer]
# Mathematica, 63 bytes
```
(s=LCM@##;Print[""<>If[i~Mod~#<1,"|","-"]~Table~{i,s}]&/@{##})&
```
[Try it online!](https://tio.run/##y00sychMLv6fZvtfo9jWx9nXQVnZOqAoM68kWknJxs4zLTqzzjc/pU7ZxlBHqUZJR0lXKbYuJDEpJ7WuOlOnuDZWTd@hWlm5VlPtf1q0mY5F7H8A "Mathics – Try It Online")
and another version which user202729 really, really, really wants to see posted
# Mathematica, 59 bytes
```
(s=LCM@##;Print[""<>If[#∣i,"|","-"]~Table~{i,s}]&/@{##})&  
```
this one uses special character `\[Divides]` `∣`
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 13 bytes
```
ʒ<'-×'|«¹.¿∍,
```
Uses the **05AB1E** encoding. [Try it online!](https://tio.run/##ASQA2/8wNWFiMWX//8qSPCctw5cnfMKrwrkuwr/iiI0s//9bMywgMl0 "05AB1E – Try It Online")
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 22 bytes
Assumes `⎕IO←0`. Takes A,B as right argument. **Bonus:** handles input list of any length!
```
{'|-'[⌽×⍵∘.|⍳∧/⍵]}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/32cfYF0tXqNrnr0o569h6c/6t36qGOGXs2j3s2POpbrA7mxtf9ByhSMFEy5QLSJgjGYNjQAIhjLFMYwAzOMTBQswAxzKG0GpQ2NFQwNIUoUjBVMAQ "APL (Dyalog Unicode) – Try It Online")
`{`…`}` anonymous lambda where `⍵` represents the right argument
 `'|-'[`…`]` index the string with:
  `∧/` LCM across the input
  `⍳` first that many **ɩ**ntegers (0 through N-1)
  `⍵∘.|` division remainder table with the input vertically and that horizontally
  `×` signum
  `⌽` flip horizontally
[Answer]
# [Octave](https://www.gnu.org/software/octave/), ~~46~~ 38 bytes
*-8 bytes thanks to several suggestions by Luis Mendo*
```
@(a,b)'-|'.'(~mod(1:lcm(a,b),[a;b])+1)
```
[Try it online!](https://tio.run/##y08uSSxL/Z@mYKugp6f330EjUSdJU123Rl1PXaMuNz9Fw9AqJzkXLKoTnWidFKupbaj5P03DUAdIAQA "Octave – Try It Online")
[Answer]
# JavaScript (ES6), 69 bytes
```
f=(a,b,S,A=1)=>(A%a?'-':'|')+(A%a|A%b?f(a,b,S,A+1):S?'':`
`+f(b,a,1))
```
Recursively runs until `A` is divisible by both `a` and `b` – outputting a dash or pipe based on `a`'s divisibility by `A`.
The function then calls itself, swapping `a` and `b`.
The `S` variable prevents the function from calling itself infinitely.
**Test Cases:**
```
f=(a,b,S,A=1)=>(A%a?'-':'|')+(A%a|A%b?f(a,b,S,A+1):S?'':`
`+f(b,a,1))
console.log(f(1,1));
console.log(f(1,2));
console.log(f(2,1));
console.log(f(2,2));
console.log(f(6,4));
console.log(f(4,6));
console.log(f(2,3));
console.log(f(3,2));
console.log(f(10,10));
console.log(f(3, 6));
console.log(f(2, 5));
console.log(f(4, 3));
console.log(f(10, 10));
console.log(f(10, 5));
console.log(f(10, 6));
console.log(f(24, 8));
console.log(f(7, 8));
console.log(f(6, 8));
console.log(f(13, 11));
```
---
Previous answers:
# JavaScript (ES8), 91 bytes
```
f=(a,b,i=2,g=(c,d)=>d?g(d,c%d):c)=>i?'|'.padStart(a,'-').repeat(b/g(a,b))+`
`+f(b,a,i-1):''
```
Uses the algorithms:
```
lcm(a, b) = ab / gcd(a, b)
gcd(c, d) = d ? gcd(d, c%d) : c
```
Recursively calls itself just once to output the second line.
**Test Cases:**
```
f=(a,b,i=2,g=(c,d)=>d?g(d,c%d):c)=>i?'|'.padStart(a,'-').repeat(b/g(a,b))+`
`+f(b,a,i-1):''
console.log(f(1,1));
console.log(f(1,2));
console.log(f(2,1));
console.log(f(2,2));
console.log(f(6,4));
console.log(f(4,6));
console.log(f(2,3));
console.log(f(3,2));
console.log(f(10,10));
console.log(f(3, 6));
console.log(f(2, 5));
console.log(f(4, 3));
console.log(f(10, 10));
console.log(f(10, 5));
console.log(f(10, 6));
console.log(f(24, 8));
console.log(f(7, 8));
console.log(f(6, 8));
console.log(f(13, 11));
```
# JavaScript (ES6), 93 bytes
```
f=(a,b,i=2,g=(c,d)=>!d=>d?c:g(d,c%d):c)=>i?('-'.repeat(a-1)+'|').repeat(a*bb/g(a,b)/a)+`
`+f(b,a,i-1):''
```
Same algorithm as before, using `repeat` instead of `padStart`.
[Answer]
# Scala, 98 bytes
```
print((a to a*b).find(l=>l%a+l%b==0).map(l=>("-"*(a-1)+"|")*(l/a)+"\n"+("-"*(b-1)+"|")*(l/b)).get)
```
[Try it online](https://tio.run/##TclBCsIwEEDRvacYAoWZhEbdiJsIHsAbuJlpo0RiGtoggnr2WHXj7vH/1HHkOsjFdwUOHBL4e/Gpn2CfMzwWN47A4GDzlcza1jyGVBAZygCshewppB6j28WGTWzEuRXZK@dPQtUqjdyuyainIo1xyTOPSZnfkv8lRPbsC9VXfQM)
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), 103 bytes
```
a->b->{String l="",r="|\n";for(int m=0;(++m%a|m%b)>0;r+=m%b<1?'|':'-')l+=m%a<1?'|':'-';return l+r+'|';}
```
[Try it online!](https://tio.run/##hZJLa4NAEMfv@RSDEFR8oHm1ZKO9FXroKUfrYU1M2HRdZV0DIfGz21WTVopLRpDxN6/9O3vCZ@zkRcpO@@@mqBJKdrCjuCzhExN2nYC0UmAh8YEwTOEkC9xKEOoeKrYTJGfuBxPvd3/zJLwVnLBjGAKDoMFOmDjhtWdAA02zeaDdvpiGDjk3CBOQBR4yLCub4ls2TczQQ9wKpLfx3/SbvtYd3aQtwH8A8VRUnAG1uCURqptWA5p0Uu4K74rOOdlDJnUavbb@JFEMmB9LE3r1rcmjRLHkIi1FCcEg8rCrb4Nf26N8NsZnivyZIn9lw2KML2xYKfrMx/hc0X@u7rNUzB3t73tSmKeKLFWB8dlyyOtY4EXBVwruS3X@8HfX6NeVVw2MbsHdemHdb9n8t@TtpRRp5uaVcAt5SwRlRpsXeTFYoMnH6uoiPzbRs0Lm4qKgl0cDc/gp6583GGTUk/5dNz8 "Java (OpenJDK 8) – Try It Online")
### 110 bytes, n input values
```
a->{String s="";for(int v:a){for(int i=1,z=1;z>(z=0);s+=i++%v<1?'|':'-')for(int k:a)z|=i%k;s+='\n';}return s;}
```
[Try it online!](https://tio.run/##hVJdb4IwFH33V9yYGGhAQv3aYq1729ue9sh46BRNFQuhhUSQ384K6GIWmt0mTXvuuR@ntydWsGmSRuK0Pzdp/h3zHexiJiV8MC6qEWiTiikNH7hgMZx0gJcrHnuHXOwUT4T3fj9suFBB6MKnyrg4biED2rDpturvIOl4TA5JZmsaFGuGqseFU@yWFJNya5fUR0Q6lDvOpNjgN@tmra2phR7Us44rb5RPzi3L@hIWqbNI5ZkASeqmbZeMuq7vYu7NFwnfw0VLsnsZfU9BCCw7SgS90NY6DRpXkVQS6JPnYRV2AdfuID4bwmcG/szAX7mwGMIXLqwMeeZD@NyQf27OszTUHcyPfS3MN3mWJsdwbV3kdcjxYsBXBhxrdfj5uWvye9SfCOxuwN14Yd1PGf0Z8udVqujiJbnyUv1LVCzslhf4ITgw1svp4gIcIvJfYOaxNI2vXQL0RK9H/V43Pw "Java (OpenJDK 8) – Try It Online")
[Answer]
# Java 8, ~~125~~ ~~118~~ 117 bytes
```
a->b->{String A="\n",B=A,t="|";for(int i=1;!A.endsWith(t)|!B.endsWith(t);B+=i++%b<1?t:"-")A+=i%a<1?t:"-";return A+B;}
```
-7 bytes thanks to *@Nevay*.  
-1 byte by starting with a trailing new-line (`A="",B="\n"` replaced with `A="\n",B=A`).
**Explanation:**
[Try it here.](https://tio.run/##jZLfa4MwEMff91dcAwXFKLW/Npbq0IfBHgaDPuxh20O0aZfORtGzUNr@7TZSBx1EGERy@fjN3X09t3zP3bwQarv6adKMVxW8cqmOdwAVcpQpbLXCq1Fm3rpWKcpcec9dsHhRKDaipP8TLbGUahOGkEIADXfDxA2PVwhRQD4VoXEQUQzIibB1XlpSIcjAZ4PIE2pVvUv8ttA@DeLbI4udQDrOMFn4T/hIXGJHGgz575GVAutSQeTE7NwwbUyvok4y7a2zuM/lCnbatnXt5uMLuN1@Ai3Ut/HwpilaPgXfZiY8NuCxWT02q@cUpgY8pTA3J5kY8MSce9KbZGYuacrtj7SfUc@LWQ83ltUFHgz83oznZuy3w7j2ee5GWso9R/Fnprc32p@JU2i3pBvu8lCh2Hl5jV7RajJlcXCAANOPo2WsT5Z6vCiyg8XtLkjsfnHX5bm5AA)
```
a->b->{             // Method with two integer parameters and String return-type
  String A="\n",    //  String top line (starting with a trailing new-line)
         B=A,       //  String bottom-line (starting with a new-line)
         t="|";     //  Temp String "|" which is used multiple times
  for(int i=1;      //  Index-integer, starting at 1
      !A.endsWith(t)|!B.endsWith(t);
                    //  Loop as long as both Strings aren't ending with "|"
      B+=           //    After every iteration: append `B` with:
         i++%b<1?   //     If `i` is divisible by `b`:
                    //     (and increase `i` by 1 in the process)
          t         //      `t` (holding "|")
         :          //     Else:
          "-")      //      A literal "-"
    A+=             //   Append `A` with:
       i%a<1?       //    If `i` is divisible by `a`
        t           //     `t` (holding "|")
       :            //    Else:
        "-";        //     A literal "-"
                    //  End of loop (implicit / single-line body)
  return A+B;       //  Return both lines, separated by the new-line `B` started with
}                   // End of method
```
[Answer]
# [Python 2](https://docs.python.org/2/), 96 88 bytes
**Edit:** Saved 4 bytes thanks to [@Leaky Nun](https://codegolf.stackexchange.com/users/48934/leaky-nun)
**Edit:** Saved 4 bytes thanks to [@Rod](https://codegolf.stackexchange.com/users/47120/rod)
```
lambda a,b:b/gcd(a,b)*("-"*~-a+"|")+"\n"+a/gcd(a,b)*("-"*~-b+"|")
from fractions import*
```
[Try it online!](https://tio.run/##Zcm7CoAgFADQva@QO/lIgoiGoD9xuSaWkA/MJYh@3aK17cBJZ9li6KudVd3Ra4MEWz3pbl0MfcU4BQn8lijgAiZABRD4W/1tY3P0xGZciovhIM6nmAuvKbtQqKVDOzJWHw)
[Answer]
# [Python 2](https://docs.python.org/2/), 89 bytes
*Not the shortest Python 2 entry, but a different approach than* `gcd` *which may still be golfable.*
```
a,b=input()
h,p='-|'
x=b*(h*~-a+p),a*(h*~-b+p)
for v in x:print v[~zip(*x).index((p,p)):]
```
**[Try it online!](https://tio.run/##K6gsycjPM/r/P1EnyTYzr6C0REOTK0OnwFZdt0adq8I2SUsjQ6tON1G7QFMnEcJOArK50vKLFMoUMvMUKqwKijLzShTKouuqMgs0tCo09TLzUlIrNDQKdAo0Na1i//830zEBAA "Python 2 – Try It Online")**
[Answer]
# [Haskell](https://www.haskell.org/), ~~66~~ 60 bytes
```
a#b=do x<-[a,b];lcm a b`take`cycle(([2..x]>>"-")++"|")++"\n"
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P1E5yTYlX6HCRjc6UScp1jonOVchUSEpoSQxOzUhuTI5J1VDI9pIT68i1s5OSVdJU1tbqQZMxuQp/c9NzMxTsFUoKC0JLilSUDm0wNBA2ew/AA "Haskell – Try It Online")
  
  
  
Same length:
```
a#b=unlines[take(lcm a b)$cycle$([2..x]>>"-")++"|"|x<-[a,b]]
```
Old solution:
```
l!x=[1..div l x]>>([2..x]>>"-")++"|"
a#b|l<-lcm a b=l!a++'\n':l!b
```
[Answer]
# [Whispers v2](https://github.com/cairdcoinheringaahing/Whispers), 131 bytes
```
> Input
> Input
>> 1⊔2
>> (3]
>> L∣1
>> L∣2
>> Each 5 4
>> Each 6 4
> '-|'
>> 9ⁿL
>> Each 10 7
>> Each 10 8
>> Output 11 12
```
[Try it online!](https://tio.run/##K8/ILC5ILSo2@v/fTsEzr6C0hAtO2ykYPuqaYgRiaBjHgiifRx2LDWEMsIRrYnKGgqmCCZxtBmIrqOvWqIOELB817veByxkaKJgjcyxAHP/SEqBtCoaGCoZARxgacJkBAA "Whispers v2 – Try It Online")
## How it works
If you're unfamiliar with Whispers' program structure, I'd recommend reading the first part of [this](https://codegolf.stackexchange.com/a/174898/66833) post.
In this explanation, we'll refer to the two inputs as \$x\$ and \$y\$ respectively. Our first two lines simply take the inputs in, and store them on lines **1** (\$x\$) and **2** (\$y\$). We then move to line **3**, which returns \$\alpha = \mathrm{lcm}(x, y)\$ and to line **4**, which returns the range \$A = [1, 2, ..., \alpha]\$.
Next, we reach our first two `Each` statements, operating on each of the inputs:
```
>> L∣1
>> L∣2
>> Each 5 4
>> Each 6 4
```
These four lines both operate on \$A\$, but return two different arrays, which we will call \$A\_x\$ and \$A\_y\$. While being different arrays, they are both formed in similar ways, as can be noted from the similarities in the two pairs of lines. In fact, we can define \$A\_x\$ and \$A\_y\$ as
$$A\_x := [(i \div x) \in \mathbb{Z} \: | \: i \in A]$$
$$A\_y := [(i \div y) \in \mathbb{Z} \: | \: i \in A]$$
This leaves us with two lists consisting of a \$1\$ where we'd expect there to be a `|` character, and a \$0\$ where there should be a `-`. This takes us to the next section of our code:
```
> '-|'
>> 9ⁿL
>> Each 10 7
>> Each 10 8
```
First, we yield the string `-|`, then we create our next two arrays \$B\_x\$ and \$B\_y\$. Helpfully, we can use the same function to map \$A\_x\$ to \$B\_x\$ and \$A\_y\$ to \$B\_y\$, namely `9ⁿL`. This function yields the \$n^{th}\$ element of the string on line **9** i.e. `-|`, where \$n\$ is either \$0\$ or \$1\$, depending on the element from the respective \$A\$ arrays. This yields the two arrays \$B\_x\$ and \$B\_y\$ as defined below:
$$(B\_x)\_i = 
\begin{cases}
\text{"-"}, & (A\_x)\_i = 0 \\
\text{"|"}, & (A\_x)\_i = 1
\end{cases}$$
$$(B\_y)\_i =
\begin{cases}
\text{"-"}, & (A\_y)\_i = 0 \\
\text{"|"}, & (A\_y)\_i = 1
\end{cases}$$
The `Each` command is special-cased for when yielding an array of strings, where it returns a single string, rather than an array. Finally, we reach the statement
```
>> Output 11 12
```
which outputs \$B\_x\$, then a newline, then \$B\_y\$
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~121~~ ~~99~~ ~~93~~ ~~92~~ 89 bytes
This should be much shorter, hmmmm....
```
#define L(x)for(j=-1,i=a;j<i;i+=i%b||i%a)putchar(++j?j%x?45:124:10);
i,j;f(a,b){L(a)L(b)}
```
[Try it online!](https://tio.run/##dYxBCsIwFET3OUWpBP4nKdgau2gMvUAvkcZGf8AqVaHQ9uwxgltn9YY3jCsuzsW4Ow@exiHrYEZ/nyCYopRkrA4n0iQM8X5diVt8vF/uaicQIrSBz606NmWlmnKPmpEM2oOVPS4dWOygxy3eLI2AbGFZiodaqrT8cnp6Qp7/mgcl6z@mkofEG4sf "C (gcc) – Try It Online")
[Answer]
# [J](http://jsoftware.com/), 20 bytes
```
'-|'{~*.$&>;&(<:=i.)
```
[Try it online!](https://tio.run/##y/qfVqxga6VgoADE/9V1a9Sr67T0VNTsrNU0bKxsM/U0/2tyKekpqKfZWqkr6CjUWimkFXNxpSZn5CuYKaQpmPwHAA "J – Try It Online")
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), ~~19~~ 16 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
2{H┌*┐+..*..g/mP
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=MiU3QkgldTI1MEMqJXUyNTEwKy4uKi4uZy9tUA__,inputs=MTMlMEExMQ__)
Explanation:
```
2{                two times do
  H                 decreate ToS - input - by 1
   ┌*               get that many dashes
     ┐+             append a vertical bar
       ..*          push both inputs multiplied           \
          ..g       push gcd(input1, input2)              | LCM - 7 bytes :/
             /      divide the multiblication by the GCD  /
              m     mold the string to that length
               P    print that in a new line
```
[Answer]
# [Stacked](https://github.com/ConorOBrien-Foxx/stacked), ~~42~~ 38 bytes
```
[:...lcm@z:[:z\/\#-'-'*\rep'|'+out]"!]
```
[Try it online!](https://tio.run/##Ky5JTM5OTfn/P9pKT08vJznXocoq2qoqRj9GWVddV10rpii1QL1GXTu/tCRWSTH2v4NVGheXhpmCiaZCGpeGsYIRmDZSMAbThgqGUBomDuUbKBgaAFn/AQ "Stacked – Try It Online")
Input in the form of a pair of numbers. All the test cases put together look kinda like buildings.
## Explanation
This first takes the `lcm` of the two input numbers into `z`. Then, for each number `k`, we generate `z / k` strings of `-` of length `k - 1`, adding `|` to the end of each, and outputting each.
## Previous counted attempts
42 bytes: `[:...lcm@z:[:z\/\#-'-'*\rep'|'+''#`out]"!]`
## Other attempts
43 bytes: `[:...lcm@z:[:z\/\#-'-'*\rep'|'#`'|'+out]"!]`
45 bytes: `['@lcm'!#~@z,[:z\/\#-'-'*\rep'|'#`'|'+out]"!]`
45 bytes: `[:...lcm@x[x'-'*\#<$betailmap'|'#`'|'+out]"!]`
53 bytes: `[:...lcm'-'*@z#-'.'*'('\+')'+'.'+[z\'$1|'repl out]"!]`
54 bytes: `[:...lcm@x{!x'-'*('('n#-'.'*').')''#`'$1|'repl out}"!]`
[Answer]
# JavaScript (ES6), 89
```
f=(a,b,t=`
`,l=0,R=n=>'-'.repeat(n-1)+'|')=>l||1/t?f(a,b,l<0?t+R(b,l+=b):R(a,l-=a)+t,l):t
```
Evaluating the LCM with repeated addictions.
*Less golfed*
```
F=(a,b, sa='', sb='', la=0, lb=0)=>
{
    var R=n=>'-'.repeat(n-1)+'|'
    if (la != lb || la == 0)
    {
        if (la < lb) {
            sa += R(a)
            la += a
        }
        else
        {
            sb += R(b)
            lb += b
        }
        return F(a, b, sa, sb, la, lb)
    }
    else
        return sa+'\n'+sb
}
```
**Test**
```
f=(a,b,t=`
`,l=0,R=n=>'-'.repeat(n-1)+'|')=>l||1/t?f(a,b,l<0?t+R(b,l+=b):R(a,l-=a)+t,l):t
function update()
{
  var [a,b]=I.value.match(/\d+/g)
  R.textContent = f(+a,+b)
}  
update()
```
```
<input id=I oninput='update()' value='4 6'>
<pre id=R></pre>
```
[Answer]
**VBA (Excel) , 144  142 bytes**
```
Sub q()
a=[a1]
b=[a2]
Do Until c=d And d="|"
e=e+1
c=IIf(e Mod a,"-","|")
d=IIf(e Mod b,"-","|")
f=f& c
g=g& d
Loop
Debug.? f& vbCr& g
End Sub
```
-2 bytes. thanks Sir Washington Guedes.
[Answer]
# [J](http://jsoftware.com/), 20 bytes
```
*./($'-|'#~<:,1:)"0]
```
[Try it online!](https://tio.run/##y/r/P81WT0FLT19DRV23Rl25zsZKx9BKU8kg9n9qcka@QpqCoZGCpYKxgpECF1hAXR1Ca6QpGWoqGCoY6gAJIx2gPIhlAERgylTHSsHQWMHQ8D8A)
[Answer]
# [Ruby](https://www.ruby-lang.org/), 64 57 bytes
```
->a,b{[a,b].map{|n|(1..a.lcm(b)).map{|x|x%n>0??-:?|}*''}}
```
-7 bytes thanks to G B.
[Try it online!](https://tio.run/##RY/JCoNAEETvfkVfklHRwXFLEKIfIhJcieBGRsHg@O3GSZukD/2qquvSzyl7bdVtM8PUyJZ4Xwlt02ERnVAZpSlt8lbNNA3DWcynLrSiyAwiseqErOsWEwaMGLDDlrDR2eh8cCVc8DF0JBy8Od/Qw8rnxixg1iG8g1hz4Sp5QfgI5gBjJKFlmj@g6EFwocA@wzRy4H9ZxTqnfGjqUX6inoOxv9da8isoZVdsbw "Ruby – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~32~~ ~~30~~ 29 bytes
```
ＮθＮη≔θζＷ﹪ζη≦⁺θζＥ⟦θη⟧…⁺×-⁻ι¹|ζ
```
[Try it online!](https://tio.run/##TYs9C8IwFAD3/opHpvcgAbu4dHIUbOngJg61jSaQJm3SKBT/e4wfg@Mdd73qfO86k9LeTnFp4niRHmeqin9WmXch6JvFmcOa6aG0kYC1G6JxuHJQRFB307c6yOuCrYmBw69vvbYL5gBP2agzh9qZ4dPgUY8yIBMsS22z0BxKIg7syei9E1UplZtim8Q9iWBe "Charcoal – Try It Online") Link is to verbose version of code. Edit: Saved 1 byte thanks to @ASCII-only.
[Answer]
# Google Sheets, 77 Bytes
Anonymous worksheet formula that takes input from range `A1:B1` and outputs to the calling cell
```
=REPT(REPT("-",A1-1)&"|",LCM(1:1)/A1)&"
"&REPT(REPT("-",B1-1)&"|",LCM(1:1)/B1
```
-4 Bytes thanks to [@EngineerToast](https://codegolf.stackexchange.com/users/38183/engineer-toast)
]