Skip to main content
1 of 2
Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56

Java (JDK), 123 bytes

d->n->{var c="\\|/".split("")[d];for(int i=n;i-->0;)System.out.printf("%"+(d<1?n-i:d>1?i+1:1)+"s%2s %s%n",c,i%2<1?c:"",c);}

Try it online!

Takes d as one of 0, 1 or 2.

Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56