Skip to main content
Commonmark migration
Source Link

##QBIC, 41 bytes

QBIC, 41 bytes

:~a>0|[a|?@|`+space$(b-1)+@\`][a+1|Z=Z+@- 

Explanation

:~a>0| Gets a, and checks if a > 0 If it isn't the program quits without printing anything [a| For b=1; b <= a; b++ ?@|`+ Print "|" space$ and a number of spaces (b-1) euqal to our current 1-based line - 1 +@\` and a "\" ] NEXT [a+1| FOR c=1; c <= a+1; c++ Z=Z+@- Add a dash to Z$ Z$ gets printed implicitly at the end of the program, if it holds anything The last string literal, IF and second FOR loop are closed implicitly. 

##QBIC, 41 bytes

:~a>0|[a|?@|`+space$(b-1)+@\`][a+1|Z=Z+@- 

Explanation

:~a>0| Gets a, and checks if a > 0 If it isn't the program quits without printing anything [a| For b=1; b <= a; b++ ?@|`+ Print "|" space$ and a number of spaces (b-1) euqal to our current 1-based line - 1 +@\` and a "\" ] NEXT [a+1| FOR c=1; c <= a+1; c++ Z=Z+@- Add a dash to Z$ Z$ gets printed implicitly at the end of the program, if it holds anything The last string literal, IF and second FOR loop are closed implicitly. 

QBIC, 41 bytes

:~a>0|[a|?@|`+space$(b-1)+@\`][a+1|Z=Z+@- 

Explanation

:~a>0| Gets a, and checks if a > 0 If it isn't the program quits without printing anything [a| For b=1; b <= a; b++ ?@|`+ Print "|" space$ and a number of spaces (b-1) euqal to our current 1-based line - 1 +@\` and a "\" ] NEXT [a+1| FOR c=1; c <= a+1; c++ Z=Z+@- Add a dash to Z$ Z$ gets printed implicitly at the end of the program, if it holds anything The last string literal, IF and second FOR loop are closed implicitly. 
added 544 characters in body
Source Link
steenbergh
  • 8.2k
  • 1
  • 27
  • 43

##QBIC, 4241 bytes

:~a>0|[a|?@|`+space$(b-1)+@\`][a+1|Z=Z+@- 

Explanation

:~a>0| Gets a, and checks if a > 0 If it isn't the program quits without printing anything [a| For b=1; b <= a; b++ ?@|`+ Print "|" space$ and a number of spaces (b-1) euqal to our current 1-based line - 1 +@\`}[a+1|Z=Z+@ and a "\" ] NEXT [a+1| FOR c=1; c <= a+1; c++ Z=Z+@-` Add a dash to Z$ Z$ gets printed implicitly at the end of the program, if it holds anything The last string literal, IF and second FOR loop are closed implicitly. 

##QBIC, 42 bytes

:~a>0|[a|?@|`+space$(b-1)+@\`}[a+1|Z=Z+@-` 

##QBIC, 41 bytes

:~a>0|[a|?@|`+space$(b-1)+@\`][a+1|Z=Z+@- 

Explanation

:~a>0| Gets a, and checks if a > 0 If it isn't the program quits without printing anything [a| For b=1; b <= a; b++ ?@|`+ Print "|" space$ and a number of spaces (b-1) euqal to our current 1-based line - 1 +@\` and a "\" ] NEXT [a+1| FOR c=1; c <= a+1; c++ Z=Z+@- Add a dash to Z$ Z$ gets printed implicitly at the end of the program, if it holds anything The last string literal, IF and second FOR loop are closed implicitly. 
Source Link
steenbergh
  • 8.2k
  • 1
  • 27
  • 43

##QBIC, 42 bytes

:~a>0|[a|?@|`+space$(b-1)+@\`}[a+1|Z=Z+@-`