text:
Create a text image by manual automation
Challenge
Premise
It's 2006, and Alice is trying to send Bob their her completed notes on their newly ended expeditions into the labyrinthine school library, which the two of them found suffers from a bad case of non-Euclidean geometry.1
For some reason, Alice originally created her notes, which consist of black text on a white background, using SVG. What a genius. It hits her now that Bob doesn't have a single device that will display SVG! I mean, she accidentally fried it the last time she paid him a visit at his place.
She decides to send him a black-on-white raster rendering without anti-aliasing of any sort. Of course, she's going to do it with code. Her, since it figures that Bob would be the sort to take to hardware rather than software.2 Regardless, Alice can't go back on her word, so she supposes she's got to see it through. She thinks Bob should consider himself lucky that she has so much time to spend on their her notes…
1. Don't get the wrong idea! She's only sending them because he asked nicely, not because she's got any sympathy for boys who play Quake III Arena for eight hours at night (or whatever it is they do) and create only the barest skeleton of notes on their own.
2. She also, mysteriously, hasn't got a capable OS, but that's another story.
Task
Help Alice draw rasterised glyphs. She'll re-use and position them by herself, tasks that are trivial in comparison.
Input:

First take a string whose contents are an SVG path definition (d attribute) defining a single glyph. Only lines and cubic Béziers will be used. You only need to consider upper-case commands. Each pair of coordinates will be comma-separated. All coordinates will be given to one decimal place. Please refer to the examples.

There may or may not be whitespace at the top and/or left of the glyph.

Next, take an integer \$10\leq n\leq72\$ representing the height of the output described below.

Output: A matrix (actual type: 2D array or equivalent) of 1s and 0s where a 1 represents a pixel to be coloured black and a 0, white. The matrix is to be scaled to a height of \$n\$, maintaining the glyph's aspect ratio as far as possible. A 1 must appear where and only where, ideally, using vector graphics, more than or exactly 50% of the corresponding space would be black.

For standardisation purposes, compute the output as though there were no whitespace borders in the input.

In every example below, for reasons of clarity only, the output substitutes X for 1 and [space] for 0.
Examples
Run the following snippet to view them.

body { font-family: verdana; }
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}
th, td { padding: 5px; }
td { vertical-align: top; }
.w { width: 60%; }
.g { background-color: #eee; }
.m {
  font-family: monospace;
  padding: .2em;
}
.a { line-height: .7em !important; }
.s { font-size: 85%; }

Example 1

Input	Image from path definition

M 60.0,10.0 L 85.3,79.7 C 86.3,82.3 87.1,84.1 87.9,85.0 C 88.7,85.9 89.8,86.6 91.2,87.1 L 96.6,88.7 L 96.7,91.1 C 91.7,91.0 87.1,90.9 82.9,90.9 C 78.5,90.9 73.4,91.0 67.5,91.1 L 67.3,88.7 L 72.7,87.1 C 73.5,86.8 74.0,86.6 74.3,86.2 C 74.7,85.9 74.8,85.4 74.8,84.7 C 74.8,83.9 74.6,82.9 74.2,81.7 C 73.8,80.4 73.3,78.8 72.5,76.8 L 67.2,61.5 L 39.7,61.5 L 33.7,76.7 C 32.9,78.8 32.3,80.5 31.9,81.8 C 31.4,83.0 31.2,84.0 31.2,84.7 C 31.2,85.4 31.4,85.9 31.7,86.2 C 32.1,86.6 32.6,86.8 33.3,87.0 L 38.6,88.5 L 38.7,91.1 C 33.4,91.0 28.9,90.9 25.5,90.9 C 22.1,90.9 18.3,91.0 14.1,91.1 L 13.8,88.7 L 19.5,86.9 C 21.0,86.4 22.1,85.7 22.7,84.8 C 23.4,83.8 24.2,82.4 25.0,80.3 L 54.1,10.8 L 60.0,10.0 z M 41.8,56.3 L 65.3,56.3 L 54.2,24.9 L 41.8,56.3 z

11

<svg width="125" height="110" xmlns="http://www.w3.org/2000/svg">
<path style="fill:#000;" d="M 60.0,10.0 L 85.3,79.7 C 86.3,82.3 87.1,84.1 87.9,85.0 C 88.7,85.9 89.8,86.6 91.2,87.1 L 96.6,88.7 L 96.7,91.1 C 91.7,91.0 87.1,90.9 82.9,90.9 C 78.5,90.9 73.4,91.0 67.5,91.1 L 67.3,88.7 L 72.7,87.1 C 73.5,86.8 74.0,86.6 74.3,86.2 C 74.7,85.9 74.8,85.4 74.8,84.7 C 74.8,83.9 74.6,82.9 74.2,81.7 C 73.8,80.4 73.3,78.8 72.5,76.8 L 67.2,61.5 L 39.7,61.5 L 33.7,76.7 C 32.9,78.8 32.3,80.5 31.9,81.8 C 31.4,83.0 31.2,84.0 31.2,84.7 C 31.2,85.4 31.4,85.9 31.7,86.2 C 32.1,86.6 32.6,86.8 33.3,87.0 L 38.6,88.5 L 38.7,91.1 C 33.4,91.0 28.9,90.9 25.5,90.9 C 22.1,90.9 18.3,91.0 14.1,91.1 L 13.8,88.7 L 19.5,86.9 C 21.0,86.4 22.1,85.7 22.7,84.8 C 23.4,83.8 24.2,82.4 25.0,80.3 L 54.1,10.8 L 60.0,10.0 z M 41.8,56.3 L 65.3,56.3 L 54.2,24.9 L 41.8,56.3 z"/>
</svg>

Output

      X
     XX
     XXX
    X XX
    X  X
   X   XX
   XXXXXX
   X    XX
  X     XX
  X      X
XXX     XXXX

Example 2

Input	Image from path definition	Output

M 40.0,10.0 C 44.3,10.2 48.5,10.2 52.4,10.2 C 56.4,10.2 60.5,10.2 64.8,10.0 L 65.0,12.2 L 58.8,14.0 C 58.0,14.2 57.6,14.7 57.5,15.6 C 57.5,16.7 57.4,18.0 57.4,19.4 C 57.4,20.8 57.4,22.3 57.4,23.9 L 57.4,69.3 C 57.4,72.5 57.3,75.5 57.0,78.2 C 56.8,80.9 56.3,83.3 55.7,85.4 C 55.0,87.5 54.2,89.4 53.0,91.0 C 51.9,92.7 50.4,94.1 48.6,95.4 C 46.9,96.7 44.7,97.8 42.2,98.8 C 39.7,99.8 36.7,100.7 33.3,101.5 L 32.6,99.0 C 36.0,97.5 38.8,95.9 40.7,94.1 C 42.7,92.3 44.2,90.3 45.2,88.0 C 46.3,85.8 46.9,83.2 47.2,80.4 C 47.5,77.6 47.6,74.4 47.6,70.8 L 47.6,24.1 C 47.6,22.4 47.6,20.9 47.6,19.5 C 47.6,18.2 47.6,16.9 47.5,15.8 C 47.5,15.0 47.1,14.4 46.3,14.1 L 40.1,12.2 L 40.0,10.0 Z

20

<svg width="125" height="110" xmlns="http://www.w3.org/2000/svg">
<path style="fill:#000;" d="M 40.0,10.0 C 44.3,10.2 48.5,10.2 52.4,10.2 C 56.4,10.2 60.5,10.2 64.8,10.0 L 65.0,12.2 L 58.8,14.0 C 58.0,14.2 57.6,14.7 57.5,15.6 C 57.5,16.7 57.4,18.0 57.4,19.4 C 57.4,20.8 57.4,22.3 57.4,23.9 L 57.4,69.3 C 57.4,72.5 57.3,75.5 57.0,78.2 C 56.8,80.9 56.3,83.3 55.7,85.4 C 55.0,87.5 54.2,89.4 53.0,91.0 C 51.9,92.7 50.4,94.1 48.6,95.4 C 46.9,96.7 44.7,97.8 42.2,98.8 C 39.7,99.8 36.7,100.7 33.3,101.5 L 32.6,99.0 C 36.0,97.5 38.8,95.9 40.7,94.1 C 42.7,92.3 44.2,90.3 45.2,88.0 C 46.3,85.8 46.9,83.2 47.2,80.4 C 47.5,77.6 47.6,74.4 47.6,70.8 L 47.6,24.1 C 47.6,22.4 47.6,20.9 47.6,19.5 C 47.6,18.2 47.6,16.9 47.5,15.8 C 47.5,15.0 47.1,14.4 46.3,14.1 L 40.1,12.2 L 40.0,10.0 Z"/>
</svg>

 XXXXX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
  XX
 XX
XX

Example 3

Input	Image from path definition

M 80.0,40.0 C 80.0,50.8 77.1,59.6 71.5,66.3 C 65.8,73.0 58.4,76.9 49.2,77.9 C 51.9,85.6 58.9,89.5 70.1,89.5 C 74.6,89.5 78.7,88.8 82.3,87.4 L 82.8,89.7 C 75.9,95.2 70.5,97.9 66.5,97.9 C 53.9,97.9 45.8,91.4 42.3,78.3 C 31.3,78.3 22.8,75.1 16.7,68.6 C 10.6,62.2 7.5,53.4 7.5,42.3 C 7.5,30.7 10.8,21.6 17.4,14.9 C 24.0,8.1 33.1,4.8 44.8,4.8 C 56.0,4.8 64.7,7.9 70.8,14.2 C 76.9,20.5 80.0,29.0 80.0,40.0 L 80.0,40.0 z M 18.5,40.6 C 18.5,51.5 20.7,59.8 25.1,65.6 C 29.5,71.4 35.9,74.3 44.4,74.3 C 52.8,74.3 59.0,71.7 63.0,66.4 C 67.0,61.2 69.0,52.9 69.0,41.7 C 69.0,31.1 66.9,23.0 62.6,17.3 C 58.4,11.7 51.8,8.8 43.0,8.8 C 34.4,8.8 28.2,11.5 24.3,16.7 C 20.4,22.0 18.5,29.9 18.5,40.6 L 18.5,40.6 Z

10

<svg width="125" height="110" xmlns="http://www.w3.org/2000/svg">
<path style="fill:#000;" d="M 80.0,40.0 C 80.0,50.8 77.1,59.6 71.5,66.3 C 65.8,73.0 58.4,76.9 49.2,77.9 C 51.9,85.6 58.9,89.5 70.1,89.5 C 74.6,89.5 78.7,88.8 82.3,87.4 L 82.8,89.7 C 75.9,95.2 70.5,97.9 66.5,97.9 C 53.9,97.9 45.8,91.4 42.3,78.3 C 31.3,78.3 22.8,75.1 16.7,68.6 C 10.6,62.2 7.5,53.4 7.5,42.3 C 7.5,30.7 10.8,21.6 17.4,14.9 C 24.0,8.1 33.1,4.8 44.8,4.8 C 56.0,4.8 64.7,7.9 70.8,14.2 C 76.9,20.5 80.0,29.0 80.0,40.0 L 80.0,40.0 z M 18.5,40.6 C 18.5,51.5 20.7,59.8 25.1,65.6 C 29.5,71.4 35.9,74.3 44.4,74.3 C 52.8,74.3 59.0,71.7 63.0,66.4 C 67.0,61.2 69.0,52.9 69.0,41.7 C 69.0,31.1 66.9,23.0 62.6,17.3 C 58.4,11.7 51.8,8.8 43.0,8.8 C 34.4,8.8 28.2,11.5 24.3,16.7 C 20.4,22.0 18.5,29.9 18.5,40.6 L 18.5,40.6 Z"/>
</svg>

Output

  XXXX
 X    X
X     XX
X      X
X      X
X     X
 X    X
  XXXX
    X
     XXX

Example 4

Input	Image from path definition	Output

M 80.0,40.0 C 80.0,50.8 77.1,59.6 71.5,66.3 C 65.8,73.0 58.4,76.9 49.2,77.9 C 51.9,85.6 58.9,89.5 70.1,89.5 C 74.6,89.5 78.7,88.8 82.3,87.4 L 82.8,89.7 C 75.9,95.2 70.5,97.9 66.5,97.9 C 53.9,97.9 45.8,91.4 42.3,78.3 C 31.3,78.3 22.8,75.1 16.7,68.6 C 10.6,62.2 7.5,53.4 7.5,42.3 C 7.5,30.7 10.8,21.6 17.4,14.9 C 24.0,8.1 33.1,4.8 44.8,4.8 C 56.0,4.8 64.7,7.9 70.8,14.2 C 76.9,20.5 80.0,29.0 80.0,40.0 L 80.0,40.0 z M 18.5,40.6 C 18.5,51.5 20.7,59.8 25.1,65.6 C 29.5,71.4 35.9,74.3 44.4,74.3 C 52.8,74.3 59.0,71.7 63.0,66.4 C 67.0,61.2 69.0,52.9 69.0,41.7 C 69.0,31.1 66.9,23.0 62.6,17.3 C 58.4,11.7 51.8,8.8 43.0,8.8 C 34.4,8.8 28.2,11.5 24.3,16.7 C 20.4,22.0 18.5,29.9 18.5,40.6 L 18.5,40.6 Z

50

<svg width="125" height="110" xmlns="http://www.w3.org/2000/svg">
<path style="fill:#000;" d="M 80.0,40.0 C 80.0,50.8 77.1,59.6 71.5,66.3 C 65.8,73.0 58.4,76.9 49.2,77.9 C 51.9,85.6 58.9,89.5 70.1,89.5 C 74.6,89.5 78.7,88.8 82.3,87.4 L 82.8,89.7 C 75.9,95.2 70.5,97.9 66.5,97.9 C 53.9,97.9 45.8,91.4 42.3,78.3 C 31.3,78.3 22.8,75.1 16.7,68.6 C 10.6,62.2 7.5,53.4 7.5,42.3 C 7.5,30.7 10.8,21.6 17.4,14.9 C 24.0,8.1 33.1,4.8 44.8,4.8 C 56.0,4.8 64.7,7.9 70.8,14.2 C 76.9,20.5 80.0,29.0 80.0,40.0 L 80.0,40.0 z M 18.5,40.6 C 18.5,51.5 20.7,59.8 25.1,65.6 C 29.5,71.4 35.9,74.3 44.4,74.3 C 52.8,74.3 59.0,71.7 63.0,66.4 C 67.0,61.2 69.0,52.9 69.0,41.7 C 69.0,31.1 66.9,23.0 62.6,17.3 C 58.4,11.7 51.8,8.8 43.0,8.8 C 34.4,8.8 28.2,11.5 24.3,16.7 C 20.4,22.0 18.5,29.9 18.5,40.6 L 18.5,40.6 Z"/>
</svg>

               XXXXXXXX
           XXXXXXXXXXXXXXXX
        XXXXXXX     XXXXXXXXX
       XXXXX           XXXXXXX
      XXXX                XXXXXX
     XXXX                  XXXXXX
    XXXX                    XXXXXX
   XXXXX                     XXXXX
   XXXXX                     XXXXXX
  XXXXX                       XXXXX
 XXXXXX                       XXXXXX
 XXXXXX                         XXXX
XXXXXXX                         XXXXX
XXXXXX                          XXXXX
XXXXXX                          XXXXX
XXXXXX                          XXXXX
XXXXXX                          XXXXX
XXXXXX                          XXXXX
XXXXXX                          XXXXX
XXXXXX                          XXXXX
XXXXXX                          XXXXX
XXXXXX                          XXXXX
XXXXXX                          XXXXX
XXXXXX                         XXXXXX
 XXXXX                         XXXXXX
 XXXXXX                        XXXXXX
 XXXXXX                        XXXXXX
 XXXXXX                        XXXXX
  XXXXX                        XXXX
  XXXXXX                      XXXXX
  XXXXXX                      XXXXX
   XXXXXX                     XXXX
    XXXXX                    XXX
     XXXXX                  XXX
     XXXXXX                XXX
       XXXXXX             XXX
       XXXXXXX           XXX
         XXXXXXXXXXXXXXXXXX
            XXXXXXXXXXXXX
                  XXX
                  XXXX
                  XXXXX
                   XXXX
                   XXXXX
                    XXXXXX            X
                    XXXXXXXXXXXXXXXXXXX
                     XXXXXXXXXXXXXXXX
                      XXXXXXXXXXXXXXX
                        XXXXXXXXXXX
                           XXXXX

Credit

Wikimedia Commons

Remarks

This is code-golf, so fewest bytes wins.
Standard rules, I/O rules and loophole rules apply.
If possible, link an online demo of your code.
Please explain your code.

For standardisation purposes, compute the output as though there were no whitespace borders in the input. ~> I'm not sure to understand this rule. It seems like we need to compute the bounding box of the path if we want to get your example outputs -- which is equivalent to removing the top, right, bottom and left borders.

JavaScript (ES7),  364  352 bytes
Expects (path)(height).

f=
p=>h=>([x,y,X,Y]=[0,1,2,3].map(i=>Math[i&2?'max':'min'](...p.match(/\d+\S+/g).map(s=>+s.split`,`[i&1]))+.5|0),C=document.createElement`canvas`.getContext`2d`).fill(new Path2D(p))&C.getImageData(x,y,X-=x,Y-=y).data.map((v,i)=>!v|i%4-3?0:m[(i>>=2)/X*h/Y|0][i%X*h/Y|0]++,m=[...Array(h)].map(_=>Array(X*h/Y|0).fill(0)))||m.map(r=>r.map(v=>+(v>(Y/h)**2/2)))

o.innerHTML = f("M 80.0,40.0 C 80.0,50.8 77.1,59.6 71.5,66.3 C 65.8,73.0 58.4,76.9 49.2,77.9 C 51.9,85.6 58.9,89.5 70.1,89.5 C 74.6,89.5 78.7,88.8 82.3,87.4 L 82.8,89.7 C 75.9,95.2 70.5,97.9 66.5,97.9 C 53.9,97.9 45.8,91.4 42.3,78.3 C 31.3,78.3 22.8,75.1 16.7,68.6 C 10.6,62.2 7.5,53.4 7.5,42.3 C 7.5,30.7 10.8,21.6 17.4,14.9 C 24.0,8.1 33.1,4.8 44.8,4.8 C 56.0,4.8 64.7,7.9 70.8,14.2 C 76.9,20.5 80.0,29.0 80.0,40.0 L 80.0,40.0 z M 18.5,40.6 C 18.5,51.5 20.7,59.8 25.1,65.6 C 29.5,71.4 35.9,74.3 44.4,74.3 C 52.8,74.3 59.0,71.7 63.0,66.4 C 67.0,61.2 69.0,52.9 69.0,41.7 C 69.0,31.1 66.9,23.0 62.6,17.3 C 58.4,11.7 51.8,8.8 43.0,8.8 C 34.4,8.8 28.2,11.5 24.3,16.7 C 20.4,22.0 18.5,29.9 18.5,40.6 L 18.5,40.6 Z")(20).map(r => r.map(v => ' X'[v]).join('')).join('\n')

Commented
p => h =>                        // p = path, h = height
( [x, y, X, Y] =                 // find the bounding box (x, y) - (X, Y)
  [0, 1, 2, 3].map(i =>          // for i = 0 to 3:
    Math[i & 2 ? 'max' : 'min']( //   get the max if i > 1, or the min otherwise:
      ...p.match(/\d+\S+/g)      //     match all coordinates
      .map(s =>                  //     for each of them:
        +s.split`,`[i & 1]       //       keep x if i is even, or y if i is odd
      )                          //     end of inner map()
    ) + .5 | 0                   //   end of Math.min or Math.max; round the result
  ),                             // end of outer map()
  C = document.createElement     // create a canvas and get its 2D context C
      `canvas`.getContext`2d`    //
).fill(new Path2D(p)) &          // draw the path in the canvas
C.getImageData(                  // turn X into the width and Y into the height
  x, y, X -= x, Y -= y           //
).data.map((v, i) =>             // for each value at position i in the context data:
  !v |                           //   if v is not set
  i % 4 - 3 ?                    //   or this is not a transparency field:
    0                            //     do nothing
  :                              //   else:
    m[(i >>= 2) / X * h / Y | 0] //     increment m[] at the position obtained by
    [i % X * h  / Y | 0]++,      //     rescaling ((i >> 2) / X, (i >> 2) % X)
                                 //     according to the ratio h / Y
  m =                            //   initialize m[] to a matrix of size
    [...Array(h)].map(_ =>       //   floor(X * h / Y) x h,
      Array(X * h / Y | 0)       //
      .fill(0)                   //   filled with 0's
    )                            //
) ||                             // end of map()
m.map(r =>                       // for each row r[] in m[]:
  r.map(v =>                     //   for each value v in m[]:
    +(v > (Y / h) ** 2 / 2)      //     set v to 1 if it's greater than the threshold
  )                              //   end of inner map()
)                                // end of outer map()

HTML5 + ES6, 320 bytes

with(c.getContext`2d`)f=(d,h)=>(p.setAttribute("d",d),b=p.getBBox(),c.height=h,c.width=w=h*b.width/b.height,scale(s=h/b.height,s),translate(-b.x,-b.y),fill(new Path2D(d)),[...getImageData(0,0,w,h).data.filter((_,i)=>!(3&~i))].map(i=>` X`[i>>7]).join``.match(RegExp(`.{${c.width}}`,`g`)).join`
`)
console.log(f("M 80.0,40.0 C 80.0,50.8 77.1,59.6 71.5,66.3 C 65.8,73.0 58.4,76.9 49.2,77.9 C 51.9,85.6 58.9,89.5 70.1,89.5 C 74.6,89.5 78.7,88.8 82.3,87.4 L 82.8,89.7 C 75.9,95.2 70.5,97.9 66.5,97.9 C 53.9,97.9 45.8,91.4 42.3,78.3 C 31.3,78.3 22.8,75.1 16.7,68.6 C 10.6,62.2 7.5,53.4 7.5,42.3 C 7.5,30.7 10.8,21.6 17.4,14.9 C 24.0,8.1 33.1,4.8 44.8,4.8 C 56.0,4.8 64.7,7.9 70.8,14.2 C 76.9,20.5 80.0,29.0 80.0,40.0 L 80.0,40.0 z M 18.5,40.6 C 18.5,51.5 20.7,59.8 25.1,65.6 C 29.5,71.4 35.9,74.3 44.4,74.3 C 52.8,74.3 59.0,71.7 63.0,66.4 C 67.0,61.2 69.0,52.9 69.0,41.7 C 69.0,31.1 66.9,23.0 62.6,17.3 C 58.4,11.7 51.8,8.8 43.0,8.8 C 34.4,8.8 28.2,11.5 24.3,16.7 C 20.4,22.0 18.5,29.9 18.5,40.6 L 18.5,40.6 Z",50))
<canvas id=c><svg><path id=p />

Explanation: The HTML creates two global variables, c being the canvas element and p being the SVG path element.
with(c.getContext`2d`)

Put all of the canvas's 2d drawing functions into the current scope.
f=(d,h)=>(

Create a function of two parameters.
p.setAttribute("d",d),b=p.getBBox(),

Set the d attribute of the path and then get its bounding box.
c.height=h,c.width=w=h*b.width/b.height,

Set the size of the canvas to the desired height and scale the width.
scale(s=h/b.height,s),translate(-b.x,-b.y),

Scale and translate the drawing to fit the desired height.
fill(new Path2D(d)),

Draw the path on the canvas.
[...getImageData(0,0,w,h).data.filter((_,i)=>!(3&~i))].

Get the alpha channel of the canvas.
map(i=>` X`[i>>7]).

Map the dark pixels to X and the light pixels to space.
join``.match(RegExp(`.{${w}}`,`g`)).join`
`)

Rewrap the pixels to the width of the canvas.


text:
Is a statement of propositional logic always true?
The challenge is to golf a program that checks if a statement of propositional calculus/logic is a logical tautology (i.e. it is true for all possible values of the variables).
Input
Input formulas will use P, P', P'' ect. as variables. They can either be true or false.
(P and P') means both P and P' are true.
(P or P') means at least one of P and P' is true.
(P implies P') means that if P is true, than P' must be true.
(not P) means that P is false.
These forms can be nested.
Example input: (P implies ((P' or P'') and P'''))
Output
Output will be a truthy value if the input is a tautology, and a falsy value if it is not.
(i.e True/False 1/0)
Test Cases
P: False
(P implies P): True
((P implies P') implies ((P' implies P'') implies (P implies P''))): True
(P implies (P or P')): True
(P implies (P and P')): False
(P or (not P)): True
and, or, not, and implies are the ONLY operators.
This is code-golf. Shortest program in bytes wins.
Clarification
The type of logic used here is Classical logic.

Related: Are pigs able to fly

Thanks. I think it’s clearer now

Suggest (P or not P) as a True  a test case (you're missing one with not).

Could you please clarify that Question?
How could whether any statement of propositional logic was "true" not depend on the statement itself?
How could whether a statement was a logical tautology change that.
Forgive my ignorance, and how did "logical tautology" acquire that special difference from other tautologies? How does "it is true for all possible values…" relate to the every-day and wholly different "saying the same thing twice…" or "being true by necessity or by virtue of its logical form…"?

@RobbieGoodwin There are examples above. P implies Q depends on the actual values for P and Q, and is true only if values such that P and not Q never occur. P or not P is true for all possible values of P. I agree about 'logical tautology', which is itself a tautology.

Is the input strictly a string following the syntax given, or can I take it in different ways (e.g. different variable names, or a nested structure)?

@Noodle9 Oh, but that's not true for intuitionistic logic (a.k.a. constructive logic). So it's a very important test case to clarify that the question is for classical logic.

@Hjulle Strictly saying, it isn't "not true"; it is just not provable in that system.

@Bubbler Right. But I think that still makes it not a tautology?

@Hjulle In any case, I think I will accept answers that test for Classical logical tautologies.

@nph Yes, of course. I was just being silly. ;)
Thanks for the clarification!

@RobbieGoodwin  My question is just to test for logical tautologies.

Retina 0.8.2, 136 124 121 bytes
{T`()`<>
.*P.*
<$& ¶ $&>
(?=(P'*))(?=.*\1[^P']*(¶|$))\1
$.2
¶
a
<not 1>|<0 or 0>|<1 [ai]\w* 0>|<0 a\w* .>|(<[^P<>]*>)
$#1

Try it online! Link includes test cases. Explanation: Works by considering each variable in turn, replacing the string f(p) with the string <f(1) and f(0)> for each variable p. The resulting string is then evaluated according to Boolean arithmetic.
{`

Repeat the entire program until the buffer stops changing.
T`()`<>

Change the ()s to something that doesn't need to be quoted.
.*P.*
<$& ¶ $&>

If the line still contains a variable, then duplicate it, and wrap the whole buffer in <>, however the two copies are still separated by a newline for now.
(?=(P'*))(?=.*\1[^P']*(¶|$))\1
$.2

Replace all copies of the last variable in the line with 1 or 0 depending on whether this is the original or duplicate line.
¶
a

Replace the newline with an a so that the two lines are joined together by an < and > operation.
<not 1>|<0 or 0>|<1 [ai]\w* 0>|<0 a\w* .>|(<[^P<>]*>)
$#1

Simplify any expressions that only contain constants. The expressions <not 1>, <0 or 0>, <1 implies 0>, <1 and 0>, <0 and 0>, <0 and 1> and <0 and P> (edge case) all evaluate to 0, while any other expression that contains no sub-expressions or variables evaluates to 1. (The original version of the code was buggy in this respect and needed a byte to fix it which I have included in the revised byte count in the header.)

Python 3, 128 bytes
lambda s:eval("all("+s.replace("implies","<=").replace(*"'_")+"".join(f" for P{'_'*i} in[0,1]"for i in range(s.count("P")))+")")

Try it online!
The operator names in the task definition are the same as in Python (except implies, which is replaceable by <=), but there is an extra annoyance due to the necessity to replace apostrophes with something else.
To enumerate all possible values of variables, we construct a multi-level list comprehension of the form <given expression> for P in[0,1] for P_ in[0,1]... and evaluate whether all values are True.
I haven't found a short way to determine the number of distinct variables (= the number of levels), so I'm just counting all instances of P (which is more than necessary, and thus does the job). In principle, we could even shorten this check to len(s), but this would lead to timeouts for longer expressions...

you consider P' invalid output. is it really?

The wording of the task and test cases suggests that variables start from P and introduce apostrophes just when needed. But if you insist on a custom order, it works with my mentioned modification using len(s) instead of s.count("P") at the expense of exploding time complexity (which is actually considered norm in golf, I just prefer having all test cases passed on TIO).

JavaScript (ES6),  129 ... 122  115 bytes
Saved 1 byte thanks to @Neil
Returns 0 or 1.
f=(s,n)=>eval(s.replace(m=/\w+'*/g,s=>(m|=l=s.length,{a:"&",i:"<=",n:"!",o:"|"})[s[0]]||n>>l-1&1))?n>>m||f(s,-~n):0

Try it online!
How?
We use /\w+'*/g to match all variables and operator names.
The operators and, not and or can be easily translated to &, ! and | respectively.
Translating implies is a little trickier. We know that \$A \Rightarrow B\$ is equivalent to \$\neg A \lor B\$. But inserting a leading ! would be quite difficult. Fortunately, this can also be expressed as \$(A \operatorname{xor} 1)\lor B\$. Given the precedence of JS operators, no parentheses are needed. So, implies  is  could be translated to ^1|.
Edit: Better yet, as noticed by @Neil, implies can also be translated to <=, which is 1 byte shorter.
Variables are replaced by either \$0\$ or \$1\$ depending on their size and the current value of the counter \$n\$.
Once everything has been replaced in the original expression, we test whether it eval()uates to \$1\$.
We keep track in \$m\$ of all lengths of the matched strings OR'ed together. This value is greater than or equal to the length of the longest string and a fortiori of the longest variable name. We use it to make sure that all possible combinations are tried at least once.
Commented
f = (s, n) =>             // s = input string, n = counter
  eval(                   // evaluate as JS code:
    s.replace(            //   replace in s:
      m = /\w+'*/g,       //     all operator and variable names
      s =>                //     s = matched string
        (                 //
          m |=            //     do a bitwise OR between m and ...
            l = s.length, //       ... the length l of the matched string
          {               //     lookup object:
            a: "&",       //       "and"     -> "&"
            i: "<=",      //       "implies" -> "<="
            n: "!",       //       "not"     -> "!"
            o: "|"        //       "or"      -> "|"
          }               //
        )[s[0]] ||        //     translate the operator name according to
                          //     its first letter
        n >> l - 1 & 1    //     or replace the variable name with 0 or 1
    )                     //   end of replace()
  ) ?                     // end of eval(); if truthy:
    n >> m ||             //   stop if n is equal to 2 ** m (success)
    f(s, -~n)             //   otherwise, do a recursive call with n + 1
  :                       // else:
    0                     //   failure: return 0

i can be <= to save a byte.

05AB1E (legacy), 45 bytes
„€Ÿ(ì'''_:'Ø¢„<=:D'P¢ƒ1Ý'_N×“ €‡ Pÿ€†ÿ“}')J.Eb

Port of @KirillL.'s Python answer, so make sure to upvote him!
Outputs 1/0 respectively. If outputting True/False is allowed (even though these are both falsey in 05AB1E), the trailing b could be omitted.
Uses the legacy version of 05AB1E, where list [0,1] will be input as string with ÿ, whereas this would result in an error in the new version of 05AB1E.
Try it online or verify all test cases.
Explanation:
„€Ÿ(              # Push dictionary string "all("
    ì             # Prepend it in front of the (implicit) input-string
'' '_:           '# Replace all "'" with "_"
'Ø¢ „<=:         '# Replace dictionary string "implies" with "<="
D                 # Duplicate the string
 'P¢             '# Pop and count the amount of "P" in this string
    ƒ             # Loop `N` in the range [0, count]:
     1Ý           #  Push list [0,1]
     '_N×        '#  Push a string consisting of `N` amount of "_"
     “ €‡ Pÿ€†ÿ“  #  Push dictionary string " for Pÿ inÿ",
                  #  where the first `ÿ` is automatically replaced with the "_"-string
                  #  and the second the stringified "[0,1]" list
    }')          '# After the loop: push a ")"
J                 # Join all strings on the stack together
 .E               # Execute it as Python code
   b              # Then convert the "True"/"False" to 1/0 with the binary builtin
                  # (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why „€Ÿ( is "all("; 'Ø¢ is "implies"; and “ €‡ Pÿ€†ÿ“ is " for Pÿ inÿ".

R, 230 197 191 bytes
f=function(s,`[`=gsub)`if`(grepl("P",s<-sapply(0:1,`[`,pa="Q","and"["&","or"["|","not"["!","implies"["<=","P([^'])|P$"["Q\\1",s]]]]])),all(sapply("P'"["P",s],f)),all(sapply(parse(t=s),eval)))

Try it online!
Edits: -39 bytes in exchange for quite a lot of warnings
This was a lot of fun, but I must confess that I needed to look at the other answers for inspiration about how to handle 'implies'...
Works by recursively substituting each P (without any apostrophes) for 1 and 0, then reducing the number of apostrophes after all the remaining Ps and calling itself, until there are no more Ps left, at which point it evaluates each expression.
My pattern matching & substitution is rather clunky, so I suspect that this could still be reduced quite a lot.
Commented version:
is_tautology=f=function(string) {
    string=                         # exchange in string:
    gsub("and","&",                 # and -> &
    gsub("or","|",                  # or -> |
    gsub("not","!",                 # not -> !
    gsub("implies","<=",            # implies -> <=
    gsub("P([^'])","Q\\1",
    gsub("P$","Q",                  # P (but not P') -> Q
    string))))))
                                    # now exchange Q for 1 or for 0:
    string=sapply(0:1,gsub,pattern="Q",string)
    if(!any(grepl("P",string))){    # if there are no more P's left:
                                    # return true if expression evaluates true
                                    # in both cases (Q->1 and Q->2)
        return(eval(parse(text=string[1]))&&eval(parse(text=string[2])))
    } else {                        # otherwise (there are still some P's):
        string=g("P'","P",string)   # remove one apostrophe from each P'
                                    # and recursively call self
                                    # with both cases (Q->1 and Q->2)
        return(f(string[1])&&f(string[2]))
    }
}

SageMath, 140 134 132 bytes
lambda p:propcalc.formula(r(*"'0",r("implies","->",r("or","|",r("and","&",r("not","~",p)))))).is_tautology()
from re import sub as r

Try it online!

J, 114102 bytes
[:*/([:;e.&' ()'({.;(<./@i.~&'rapt'{ ::''+`*`<:,'1-';'&{',~&":1-~#)@}.);.1]),/&.":"#.2#:@i.@^1#.e.&'P'

Try it online!
How it works
2|:@#:@i.@^1#.e.&'P'

Count the P's in the string, 2^y, range, and base 2 it. This is a matrix with all boolean combinations for P variables. Now transforming the string to a J expression:
e.&' ()'

Bit mask if  () is at that position.
(…);.1]

Split the string based on the bit masks first item (which will be 1 expect in the single P case.) The groups start whenever the bit mask is 1, i.e. we either have the single groups  ,(,) or a group that starts with that and also has a word like (P'''
{.;(…)@}.

Take the first character of the group unmodified, and for the rest apply:
'&{',~&":1-~#

Length - 1 as string prepended with &{, e.g. 3&{ for P'''.
+`*`<:,'1-';

The operators: or, and, implies, not. Now we have a list of things we have to pick from.
<./@i.~&'rapt'{ ::''

Search for any of rapt (or, and, implicit, not) with the implicit P at the 5th place), reduce the word to that index, and take from the list (with an empty string if the group was only one character long.) We now have a list of valid J expressions like (0&{ <: (2&{ + 1&{)).
,/&.":"1

With the function on the left side and the booleans on the right side: Convert from numbers to strings with ": (this will only change the booleans), append them to the function, and with &. the inverse of ": will be called afterwards, so (0&{ <: (2&{ + 1&{)) 0 1 will then be called and converted to the integer 1.
[:*/

Multiply-reduce the results.

Wolfram Language (Mathematica), 10 bytes
TautologyQ

Yep, there's a builtin.... Now, the OP will have to decide if the input format is acceptable (I feel that it is well within the spirit of this site's guidelines).
In terms of the variables themselves, we need to use strings of letters in place of P, P', P'', and so on: we can use P, Pp, Ppp, and so on (as has been done in the TIO link), or a, b, c, foo, bar, or whatever. (Strangely, TautologyQ seems to be ok with a single variable containing primes, but two different such variables seems to break it.)
Logical input can be taken in two different formats.
We can preserve the infix notation in the examples, such as:
TautologyQ[(P \[Implies] (P \[And] Pp))]

Or we can use prefix notation, such as:
TautologyQ[Implies[P, And[P, Pp]]]

(If the input format is completely inflexible, then one can add some processing commands like StringReplace followed by ToExpression.)
Try it online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
How many weekdays?
This a simple question.
The start day is a Saturday and let the input be a non-negative number x.
The output should be the number of weekdays (Mon-Fri) in the next x days inclusive.
For example, if x = 3 then the output should be 2. For x from 0 onwards the output should be:
0,0,1,2,3,4,5,5,5,6,7,8,9,10,10,10,11,...

—-—
Now I am regretting not having asked the question for a user specified day of the week instead of just Saturday.  It’s too late to change the question now and a new question would probably be marked as a duplicate. If anyone wanted to add an answer for this extension, I would love to see it.

I found the title on this really confusing. I assumed it meant "how many weekdays until Saturday" which should never exceed five. But actually you're asking something completely different. I suggest revising the title to "how many weekdays"

Python 2, 18 bytes
lambda x:x*6/7-x/7

Try it online!
Found by brute-forcing. x*6/7 counts non-Sundays, and -x/7 subtracts the number of Saturdays.
all          x       0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 ...

all - Sun  = x*6/7   0  0  1  2  3  4  5  6  6  7  8  9 10 11 12 12 13 ...
Sat        = x/7     0  0  0  0  0  0  0  1  1  1  1  1  1  1  2  2  2 ...
all - Sun - Sat      0  0  1  2  3  4  5  5  5  6  7  8  9 10 10 10 11 ...

Brute-forcing suggests that this is the unique arithmetical solution of this length or shorter, subject to some limitations like not using parens, using only single-digit constants, and not having too-large intermediate results.

19 bytes
lambda x:x-x/7+-x/7

Try it online!
Found by brute-forcing. But, it has a nice interpretation. x counts all x days. Then -x/7 subtracts the number of Sundays in those x days, and +-x/7 subtracts the number of Saturdays. Note that there's a difference in Python between subtracting x/7 and adding -x/7 aka (-x)/7, because floor-div is not symmetric around zero since it always round down.
all =   x        0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 ...
Sun =   x/7      0  0  0  0  0  0  0  1  1  1  1  1  1  1  2  2  2 ...
Sat = -(-x/7)    0  1  1  1  1  1  1  1  2  2  2  2  2  2  2  3  3 ...

all - Sun - Sat  0  0  1  2  3  4  5  5  5  6  7  8  9 10 10 10 11 ...

20 bytes
lambda x:x*5/7+x%7/4

Try it online!
I found this by hand, noting that f(x) increases asymptotically with slope 5/7 and seeing that the difference to x*5/7 (with floor-division) has a nice period-7 form.

What does +- do?

@Anush The +-x/7 adds the term -x/7 AKA (-x)/7, which is different from the earlier term -x/7 which subtracts x/7, since Python's mod isn't symmetric around zero.

I wonder what you can do in Python 3.

@Anush That's an interesting question. Since the / will need to be //, it might be that something with % for mod becomes better. I'll see what the brute-forcing gives.

Do you think using parens could help? Is it easy to add that to the brute force?

@Anush I suspect parens won't help in this instance. The most likely form would be (...)/7, and I can't see a four-character expression working for the .... I had added parens but was getting bugs with that with pruning too-long expressions with them and took them out for now. Without pruning, they should be easy to add but make things take way way longer.

@Arnauld Thanks for spotting those, edited.

Can your technique give a short answer for my bonus question too?

@Anush Maybe? I don't see an obvious extension, but there's probably some way to incorporate an offset corresponding to the starting day.

APL (Dyalog Unicode), 7 bytes
+/2≤7|⍳

Try it online!
1-based range is a big win here.
How it works
+/2≤7|⍳
      ⍳  ⍝ 1-based range
    7|   ⍝ modulo 7; 1 2 3 4 5 6 0 ...
  2≤     ⍝ is at least 2; 0 1 1 1 1 1 0 ...
+/       ⍝ sum the booleans

For the bonus question (let the user provide the day of the week to start):
APL (Dyalog Unicode), 11 bytes
+/⎕⍴⎕⌽7↑5⍴1

Try it online!
We don't need any fancy arithmetic. Just create a bit vector, rotate it to match the requested day of week to start with, cycle it and count ones (i.e. sum).
Accepts Sun, Mon, ..., Sat as the number 0, 1, ..., 6 as the first input, and the number of days as the second (both from stdin). (It actually works for any integers (for the first input) and gives the result as if it was modulo 7.)
How it works
+/⎕⍴⎕⌽7↑5⍴1
      7↑5⍴1  ⍝ 1 repeated 5 times and then overtaken to length 7
             ⍝ i.e. 1 1 1 1 1 0 0
    ⎕⌽  ⍝ Take the starting weekday and rotate ^ that many units to the left
  ⎕⍴    ⍝ Take the number of days and cycle ^ to that length
+/      ⍝ Sum

Thank you for the bonus answer!

05AB1E, 8 6 bytes
Ý7%1›O

Try it online!
Very similar to the APL answer
Explained
Ý    | Generate a list between 0 and input
7%   | Mod each number by 7
1›   | Determine if each number is greater than 1
O    | Summate the list and output it

JavaScript (ES6), 16 bytes
n=>n*20/7+n%7>>2

Try it online!
How?
The expression \$\lfloor 5n/7\rfloor\$ gives the correct answer when \$n\bmod 7\$ is less than or equal to \$3\$ but is off by \$1\$ otherwise.
 n           | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16
-------------+---+---+---+---+---+---+---+---+---+---+----+----+----+----+----+----+----
 floor(5n/7) | 0 | 0 | 1 | 2 | 2 | 3 | 4 | 5 | 5 | 6 |  7 |  7 |  8 |  9 | 10 | 10 | 11
 expected    | 0 | 0 | 1 | 2 | 3 | 4 | 5 | 5 | 5 | 6 |  7 |  8 |  9 | 10 | 10 | 10 | 11
 difference  | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 |  0 |  1 |  1 |  1 |  0 |  0 |  0
 n mod 7     | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 0 | 1 | 2 |  3 |  4 |  5 |  6 |  0 |  1 |  2

This can be adjusted with:
$$f(n)= \left\lfloor\frac{5n}{7}\right\rfloor+\left\lfloor\frac{n\bmod 7}{4}\right\rfloor$$
which may also be expressed as:
$$f(n)= \left\lfloor\frac{20n/7+(n\bmod 7)}{4}\right\rfloor$$

JavaScript (Node.js), 15 bytes
In order to use @xnor's formula without adding explicit floor operations, we have to work with BigInts. So this version expects a BigInt as input.
n=>n*6n/7n-n/7n

Try it online!

Does 20/7*n run the risk of a floating-point rounding error in a way n*20/7 would not?

@Neil I'm almost certain it's safe in this case. But since you're right in the general case, I've updated it anyway.

I really like this answer because I can read it and it comes with math.  More languages have integer division than I had expected!

@Anush Just to clarify, JS doesn't have integer division (which is why I use a right-shift instead) unless we work with BigInts. I've added a port of xnor's answer to illustrate that.

How come 20/7 doesn't return a float in that case? Are you assuming BigInts there too?

@Anush 20/7 does return a float. But the final result is coerced to an integer because of the bitwise operation (the right-shift). See here.

Thanks so much for the explanation. I wonder if the same trick would work in Python 3. I don't know if you noticed but I also added a bonus question.

@Arnauld, using bitwise to floor i.e |0 saves you a byte, and you dont have to take the input as a bigint.
n=>6*n/7-n/7|0

@EliteDaMyth No, that wouldn't work. Each division has to be floored separately. For instance, it would give a(4)=2 instead of a(4)=3.

oh thanks for clarifying! @Arnauld.

Japt, 7 bytes
Port of Bubbler's APL solution so be sure to +1 them, too.
õu7 x¨2

Try it - Includes all test cases

bc, 29 bytes
define f(n){return n*6/7-n/7}

Try it online!

Julia, 143 Bytes
function weekdays(days)
    r = mod(days, 7)
    if r <= 2 r=0
    else r -= 2
    end
    wd::Int64 = floor(days/7)
    return(5 * wd + r)
end

Try it online!
To use a custom start date, I add an offset argument, and days += offset at the start of the function

Golfed, 89 bytes

Welcome to the site! These tips for golfing in Julia might be helpful. Also note that you should avoid using spaces (where possible) to minimise your byte count.

Jelly, 6 bytes
R%7>1S

Try it online!
Interestingly equal-length in all regards to Lyxal's 05AB1E answer, so I've copy-pasted the explanation, swapping out the commands.
R    | Generate a list between 0 and input
%7   | Mod each number by 7
>1   | Determine if each number is greater than 1
S    | Summate the list and output it

An all-ASCII Jelly answer, isn't that world first? :P

C (gcc), 18 bytes
f(n){n=n*6/7-n/7;}

Try it online!
Port of xnor's formula from his Python 2 answer.

Java, 12 bytes
x->x*6/7-x/7

perl -Minteger -lp, 14 bytes
$_=$_*6/7-$_/7

Try it online!
Uses the same algorithm as the Python 2 solution from @xnor. The -Minteger switch makes perl use integer division.

x86-16 machine code, 16 bytes
33 DB       XOR  BX, BX         ; clear BX sum
        MLOOP:
E3 0B       JCXZ DONE           ; handle x = 0
8A C1       MOV  AL, CL         ; loop counter to AL
D4 07       AAM  7              ; AL = AL mod 7
3C 01       CMP  AL, 1          ; AL <= 1 ?
7E 01       JLE  IS_WEEKEND     ; if so, is a weekend
43          INC  BX             ; otherwise increment count
        IS_WEEKEND:
E2 F3       LOOP MLOOP          ; loop until 0
        DONE:
C3          RET                 ; return to caller

Callable function, input in CL (unsigned byte) output to BX.

Or 22 bytes to operate on 16 bit unsigned WORD in CX:
33 DB       XOR  BX, BX         ; clear BX sum
        MLOOP:
E3 11       JCXZ DONE           ; handle x = 0
8B C1       MOV  AX, CX
33 D2       XOR  DX, DX         ; clear DX (high word of quotient)
BF 0007     MOV  DI, 7          ; set up WORD divisor
F7 F7       DIV  DI             ; DX = DX:AX mod DI
80 FA 01    CMP  DL, 1          ; DL <= 1 ?
7E 01       JLE  IS_WEEKEND     ; if so, is a weekend
43          INC  BX             ; otherwise increment count
        IS_WEEKEND:
E2 ED       LOOP MLOOP
        DONE:
C3          RET                 ; return to caller

Retina 0.8.2, 22 bytes
.+
$*
.(.{0,5}).?
$1
.

Try it online! Link includes test cases. Explanation:
.+
$*

Convert to unary.
.(.{0,5}).?

For each week, match Sunday, then up to five weekdays, then optionally match Saturday.
$1

Keep just the weekdays.
.

Count the resulting weekdays.

Charcoal, 10 bytes
ＩΣ…⪫00×⁵1Ｎ

Try it online! Link is to verbose version of code. This is actually 3 bytes shorter than trying to calculate the result arithmetically. Explanation:
        1   Literal string `1`
      ×⁵    Repeated 5 times i.e. `11111`
    00      Literal string `00`
   ⪫        Join its characters giving `0111110`
  …      Ｎ  Cyclically extend to the input number of days
 Σ          Sum the digits
Ｉ           Cast to string
            Implicitly print

Pyth, 8 bytes
lf<1%T7S

Try it online!
Port of Bubbler's APL solution.
Explanation
lf<1%T7S
l         : length of
 f        : filter on
       S  : 1-based range to input
  <1%T7   : where mod 7 is greater than 1

AWK, 29 bytes
{print int($0*6/7)-int($0/7)}

Try it online!
Port of @xnor's Python 2 answer.

Shaping the code like this will save 4 bytes: $0=int($0*6/7)-int($0/7)e

Befunge-93, 12 bytes
&:6*7/\7/-.@

Try it online!
Another port of xnor's algorithm.

Pyth, 7 bytes
sm<1%d7

Try it online!
Port of Lyxal's 05AB1E answer.
sm<1%d7
 m        For each number from 0-input:
    %d7     Mod 7
  <1        Greater than 1
s         Take the sum, implicit print

Also 7 bytes: t-Qy/Q7

Io, 44 bytes
It seems like ranging is too costly here.
f :=method(x,if(x>0,if(x%7>1,1,0)+f(x-1),0))

Try it online!
Io, 46 bytes
method(x,Range 0 to(x)map(i,if(i%7>1,1,0))sum)

Try it online!

brainfuck, 142 bytes
(Due to number-wrapping problems) The maximum supported input is 255.
>,[[>+>+<<-]>[-<+>]<->>>+++++++<[>->+<[>]>[<+>-]<<[<]>-]>[-]>>+<[<<<+>>>>[-<<<<[-]>+>>>]<<<<[->>+<<]>[->>>+<<<]>>>-<-]>[-]<<[-<<<<+>>>>]<<<]<.

Try it online!
If you are not sure whether this output is correct, try this link.
Explanation
>,

Read input
[

While the input is nonzero:
[>+>+<<-]>[-<+>]

>x 0 0 -> x 0 >x
<->>>+++++++<[>->+<[>]>[<+>-]<<[<]>-]>[-]

Modulo by 7
>>+<[<<<+>>>>[-<<<<[-]>+>>>]<<<<[->>+<<]>[->>>+<<<]>>>-<-]>[-]<<

Check if this number is greater than 1
[-<<<<+>>>>]<<<

Add it to the accumulator (at the first item of the tape)
]

End while
<.

Move to the accumulator, print the value.

Keg, 10 bytes
0&1ɧ⑷7%1>⑼

Try it online!
Total not a port of Lyxal's my 05AB1E answer... (spoiler, it is). ;P
Explained
0&1ɧ⑷7%1>⑼
0&              # Store 0 in the register, as this will be used to keep track of the number of weekdays
  1ɧ            # Create a range between 1 and the implicit input
    ⑷           # Map the following to each item in the stack:
      7%1>⑼     # Increment the register by whether or not ((item % 7) > 1)

x86-16 machine code, 18 16 bytes (No Loop):
Bytecode: "\xD4\x07\x88\xC1\xC1\xE8\x08\x6B\xC0\x05\x49\x78\x02\x01\xC8\xC3"
0:  d4 07                   aam    0x7          ; eax contains n, with aam 0x7 -> al = n % 7 and ah = n / 7
2:  88 c1                   mov    cl,al        ; keep result of n%7 in ecx
4:  c1 e8 08                shr    ax,0x8       ; by shifting 8 times ax, ax=al=n/7;
7:  6b c0 05                imul   ax,ax,0x5    ; we multiply by 5
a:  49                      dec    ecx          ; ecx = ecx - 1 -> give 65535 if n was power of 7
b:  78 02                   js     11 <end>     ; if it happened we don't care about the remainder so we can just return n/7*5, the Signed Flag will be set so we can jump 2 bytes forward.
d:  01 c8                   add    eax,ecx      ; if not then we add (n%7)-1 to n/7*5
00000011 <end>:
f:  c3                      ret

obtained from assembling thanks to objdump -d -mi8086 dayofweek.s
global dayofweek

bits 16

section .text

dayofweek:
    aam  7
    mov  cl, al
    shr  ax, 8
    imul ax,5
    dec  ecx
    js   end
    add  eax,ecx
end:
    ret

Test: main.c
int main() {
    for (short i = 0; i < 50; i++)
        printf("%2d %2d\n", dayofweek(i), (i*20/7+i%7)/4);
    return 0;
}

output:
0  0
0  0
1  1
2  2
3  3
...
33 33
34 34
35 35
35 35

It is not as short as @640KB (16 bytes) but I believe it is still an interesting answer as it provides a better performance (no loop)
edit: Thanks to Peter -2 bits
NB (Peter): Do note that aam only divides AL, not AX, so you might as well declare the arg in C as uint8_t, as well as specifying the gcc -mregparm=3 calling convention to put it in the reg you want.

You say this is supposed to be 16-bit code, and you even used bits 16, but you have a 66 operand-size prefix on instructions using 16-bit registers but not on instructions like add eax, ecx.  That's backwards; that machine code is what you'd get if you assembled for 32-bit mode.  Did you take this machine code from before you added bits 16 to the source?

Good point, I got the bytecodes from https://defuse.ca/online-x86-assembler.htm#disassembly , how could I get the 16 bits version in local ?

Just use nasm -fbin -l/dev/stdout to get a listing, or objdump -d -mi8086 to disassemble as 16-bit if you have machine code in an ELF object.  And IDK what good gcc-multilib would be for 16-bit code, I guess you actually built that as 32-bit so you could call from C easily.  I was going to say I guess you disassembled that by mistake, but yeah, using a 32-bit-mode online assembler would have the same problem.

Also obviously use 16-bit (or 8-bit) operand-size as much as possible to save bytes, with your return value only in AX.   (So the C return type is unsigned short).  Or just do this in 32-bit code; unless 16-bit lets you avoid high garbage in EAX outside what aam deals with.  Also, you seem to be using dec ecx after only writing CL, so the sign flag will depend on garbage left in high bytes of ECX.  (And you haven't documented a calling convention, but it looks like gcc -mregparm=3 so first arg in EAX).

xchg al, ah / imul ax, 5 might work to leave a valid result in the low byte of EAX (aka AL).  The low bits of a multiply don't depend on the high bits of the inputs (think of it as adding at various left shifts, and adding only propagates carry from low to high).  Or perhaps xchg ax,cx (1 byte) / mov al, ch (2B) / imul ax, 5 (3B) to also replace the mov    cl,al.  As long as your result fits in 1 byte, you're fine, but that might not be justified.  So perhaps movzx ax, ch (3B) to still allow xchg but avoid the immediate shift.  That'd allow 32-bit mode.

yes first param in eax which is the default when compiling with gcc and having bits 16 in the elf file

which is the default when compiling with gcc - no it isn't.  Compiling C with gcc -m16 is exactly the same as -m32, except it puts .code16gcc at the top of the asm output.  It still uses push dword to push args on the stack, as per the i386 System V ABI doc's calling convention.  https://godbolt.org/z/f5E83W.  Building an asm source file just assembles the instructions you wrote, in which case it's up to you to implement a calling convention of your choice, not something the "compiler" (assembler) can do for you.  You should definitely mention that you take the arg in AL.

(Do note that aam only divides AL, not AX, so you might as well declare the arg in C as uint8_t, as well as specifying the gcc -mregparm=3 calling convention to put it in the reg you want.)

PowerShell, 42 bytes
function x($y){[math]::floor($y*6/7-$y/7)}

Try it online!
Fork of Python 2 answer

Wasif, $y*6/7-$y/7 = $y*5/7 :) Try it online!

Vyxal, s, 5 bytes
ʀ7%1>

Try it Online!
Another port of my 05AB1E answer

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Format yourself for codegolf!
Task
Your task is to write a program that, taking no input, outputs a string that represents a formatted codegolf answer of itself. The pattern is the following:
[Language name][1], n bytes
=
```
source code
```
  [1]: link-to-language

With the language name being the language that you wrote your program (as stated in your interpreter no abbreviations such as JavaScript => JS), n bytes being the byte-count of your language, source code being the source code of your program (hence the quine tag) and link-to-language being a link to a resource about your language - whichever your online interpreter points to. Note that this is a real quine challenge, so answers cannot read their own source code.

Are all of the spaces required?

Not gonna swing my dupe hammer due to the different formatting of the markdown but: Related & Related

Possible duplicate of Generate a Markdown Template for your Post

Aside from being essentially duplicate, I don't find any novelty in this task over a regular quine, apart from the addition of some language-specific boilerplate.

What exactly is the link to the language?  The brief description really leaves a lot unanswered, especially since getting a shorter link is a very good way to decrease byte count.

Python 2, 102 bytes
_='## [Python 2][1], 102 bytes\n```\n_=%r;print _%%_\n```\n  [1]: https://docs.python.org/2';print _%_

Try it online!. Outputs exactly the source code of the post. Currently assumes that all of the spaces in the template are required.


text:
Orientation Oriented Programming
Write a program for a specific language that in different orientations performs different tasks.
Your code should have at least two non-empty lines and at least two non-empty columns and should complete at least one challenge from each category of challenges below when oriented in different ways.
Orientations
Your code can be arranged eight different ways, original and three ninety degree rotations and each reversed, eg:
$_=     $@$      /$     =.
@F.     /F_     .F@     _F/
$/       .=     =_$     $@$

=_$      .=     $/      $@$
.F@     /F_     @F.     _F/
 /$     $@$     $_=     =.

Here's a generator (thanks to @fireflame241!)
Tasks
string

"Hello, World!"
Covfefify a string
No A, just CAPS LOCK
Don't google "google"
1, 2, Fizz, 4, Buzz

number

Is this number a prime?
Fibonacci function or sequence
You're on a 8 day streak!
Count up forever
Am I a Rude Number?

kolmogorov-complexity

Sing Happy Birthday to your favourite programming language
Print a Tabula Recta!
Sing Baby Shark
Build me a brick wall!
Hare Krishna Hare Krishna Krishna Krishna Hare Hare

quine

A program that is a proper quine.
Program that creates larger versions of itself (quine-variant)
Print your code backwards - reverse quine
Print the last, middle and first character of your code
Mirror quine (or my head hurts) - This counts as two rotations!

ascii-art

Do you want to code a snowman?
It's my Birthday :D
In Honor of Adam West
5 Favorite Letters
It took me a lot of time to make this, pls like. (YouTube Comments #1)

Scoring
Your score will be the number of different tasks solved by your code (higher is better) with code length as a tie-breaker (lower is better).
Rules

All programs must be in the same language
The rules for each task are as specified in the linked questions.
Multiple tasks can be completed in the same orientation to help maximise score. For example, if s challenge has no expectation to handle the empty input, you could instead perform another task that takes no input.
Your code must perform tasks when oriented in at least three unique rotations.
You can assume that spaces will be automatically added when rotating your code, however if your code does necessitate space padding on the end of lines of each rotation, these should be included.

Thanks to everyone for their input in the sandbox (deleted).

How do we measure the size of the program? Are we going to assume that shorter lines are space padded so all lines are the same length? Or can the program size increase if we rotate/flip the program? If the latter, if a line starts with spaces and is reversed, do the trailing spaces disappear? For some languages, trailing spaces may matter. How do we deal with the absence of a trailing newline on the last line when we flip a program horizontally?

@Abigail this is a good question. I think once I changed the intended scoring from [tag:code-golf] to the number of tasks, I neglected to clarify the position (which I'd originally intended to be the largest byte count), but the approach that the current answers have taken is to minimise the byte-count which is quite interesting so keeping the minimal count is fine by me and assuming that the rotations will include spaces is fine too. If spaces are required in the originating code thought they should be counted.

05AB1E, 5 14 15 18 rotations (5 6 7 8 unique, 61 213 1488 4367 bytes)
.ï i…( )7ÝJ»•αγʒδÓ₂©8¥ŽQxΣxêÿ•sÅвJIvN”</[(0._-=:"ÆŸ,*”0¶:º•DùÙÂ+;Èγтáì³ÓW©ÎÂ_`ƒ≠îj*ΓçÊ~ÞÒ¸β¦oåb/õ47/vÎΓ”›≠øØZµλÝº•20вè¶¡Nè4äyè.;ëĀiηû»ëтÝ3Å€"Fizz"}5Å€á”ÒÖ”J}¦»]q]À=F₂Aë}š.?ćvD¡SaA„iĀë∍sna„>+?Å8IàQô2$4Žнв₄iï.
ï                                                                                …
i                                                                                _
Å                                                                                |
f                                                                                _
ë                                                                                Ć
∞                                                                                Ƶ
€                                                                                м
,                                                                                ×
]                                                                                T
q                                                                                ä
]                                                                                »
.                                                                                q
                                                                                ”
.                                                                                !
…                                                                                ï
ë                                                                                ‚
p                                                                                ,
i                                                                                ™
ï                                                                                Ÿ
.ïi_i“Ûà€‰€ž€¢‡Í! :D“ćuìëdiU„ $„ |}…-~-`)X·>δ∍»}ëĀi1ú.γžOså}R`¦??н©?н®ì.•gÍĆdQ¸G•Â‡D?,ë“«Î‡Ä¦í¥Â“#€¦`«'kì)™•1¢₂P•3вè4ô»]q]»ì” ©¢ØŽ”)s”E1BA50 Ž¬”Ð”î€ot”ëFëgiÊ¹Š'iĀëå4B23iï.                                 \””

Try it online (integer input): ascii-art Do you want to code a snowman?
Try it online (string input): ascii-art It took me a lot of time to make this, pls like. (YouTube Comments #1)
Try it online (no input): string 1, 2, Fizz, 4, Buzz
Try it online with all rows reversed (integer input): ascii-art It's my Birthday :D
Try it online with all rows reversed (string input): string Covefify a string
Try it online with all rows reversed (no input): kolmogorov-complexity Hare Krishna Hare Krishna Krishna Krishna Hare Hare
Try it online with each row reversed (integer input): number You're on a 8 day streak!
Try it online with each row reversed (string input): string No A, just CAPS LOCK
Try it online with each row reversed (no input): kolmogorov-complexity Print a Tabula Recta!
Try it online with both the rows and each row itself reversed (integer input): number Am I a Rude Number?
Try it online with both the rows and each row itself reversed (string input): string Don't google "google"
Try it online with both the rows and each row itself reversed (no input): kolmogorov-complexity Sing Happy Birthday to your favourite programming language
Try it online rotated 90 degrees clockwise (integer input): number Fibonacci function or sequence
Try it online rotated 90 degrees clockwise (no input): number Count up forever
Try it online rotated 90 degrees clockwise and then each row reversed (integer input): number Is this number a prime?
Try it online rotated 90 degrees clockwise and then each row reversed (no input): quine Print the last, middle and first character of your code
Try it online rotated 90 degrees counterclockwise (no input): kolmogorov-complexity Build me a brick wall!
Try it online rotated 90 degrees counterclockwise and then each row reversed (no input): string "Hello, World!"
Explanation:
In general, I mostly rely on the builtin q. This will stop the program, making everything after it no-ops.
In addition, for the four main rotations, I split them up into integer/string/no input with:
.ïi         # If the (implicit) input is an integer:
            #  Do something with the integer-input
ëĀi         # Else-if the (implicit) input-string is NOT empty:
            # (using the Python-truthify builtin `Ā`)
            #  Do something else with the string-input
ë           # Else (there is no input):
            #  Do something else without input

For the two clockwise rotations it's similar, but only with integer or no input (since there aren't any other challenges available with input from the list in the challenge).
And for the two counterclockwise rotations it's just a kolmogorov-complexity output without input.
Some things I had to fix for the rotations include:

Adding an additional space between the .ï and i at the start of the first line, and a space on each subsequent line. Without this space, the middle character for subprogram of the Print the last, middle and first character of your code challenge would have a newline character as the center, which isn't possible without screwing up the layout. With that added space, the middle character in that rotation also becomes a space (the first and last characters are both .).
Adding \” at the end of the final line. This is to close this string and discard it for the programs with all rows and each row itself reversed, which will now contain a leading ””\ followed by a bunch of no-op spaces.
For most rotations I reuse the . for the .ï (is_integer check), but for one rotation it's .… instead. . opens up 2-byte builtins, but since .… doesn't exist, the . is a no-op instead in this case.

As for an explanation of each individual program:
ascii-art Do you want to code a snowman?: …( )7ÝJ»•αγʒδÓ₂©8¥ŽQxΣxêÿ•sÅвJIvN”</[(0._-=:"ÆŸ,*”0¶:º•DùÙÂ+;Èγтáì³ÓW©ÎÂ_`ƒ≠îj*ΓçÊ~ÞÒ¸β¦oåb/õ47/vÎΓ”›≠øØZµλÝº•20вè¶¡Nè4äyè.;
See this answer of mine, except that the actual newline is replaced with a 0, which we replace to a newline after creating the string with 0¶:.
ascii-art It took me a lot of time to make this, pls like. (YouTube Comments #1): ηû»
See the second program in this answer of mine (provided by @Grimmy).
string 1, 2, Fizz, 4, Buzz: тÝ3Å€"Fizz"}5Å€á”ÒÖ”J}¦»
See this answer of @Grimmy.
ascii-art It's my Birthday :D: _i“Ûà€‰€ž€¢‡Í! :D“ćuìëdiU„ $„ |}…-~-`)X·>δ∍»}
See this answer of @Grimmy, with additional trailing } to close the if-statement.
string Covefify a string: 1ú.γžOså}R`¦??н©?н®ì.•gÍĆdQ¸G•Â‡D?,
See this answer of @Grimmy.
kolmogorov-complexity Hare Krishna Hare Krishna Krishna Krishna Hare Hare: “«Î‡Ä¦í¥Â“#€¦`«'kì)™•1¢₂P•3вè4ô»
See this comment of mine on the answer of @Emigna.
“«Î‡Ä¦í¥Â“  # Push dictionary string "drama share irish dna"
 #          # Split it on spaces: ["drama","share","irish","dna"]
  €¦        # Remove the first character of each word:
            #  ["rama","hare","rish","na"]
    `       # Push them separated to the stack
     «      # Merge the last two together: "rishna"
      'kì  '# Prepend a "k": "krishna"
         )  # And wrap everything on the stack into a list again:
            #  ["rama","hare","krishna"]
          ™ # Titlecase each: ["Rama","Hare","Krishna"]
•1¢₂P•      # Push compressed integer 27073120
 3в         # Convert it to base-3 as list: [1,2,1,2,2,2,1,1,1,0,1,0,0,0,1,1]
   è        # Index each integer into the list of words
    4ô      # Split the list of words into parts of size 4
      »     # Join each inner list by spaces, and then each string by newlines
            # (after which the result is output implicitly as result)

See this 05AB1E tip of mine (sections How to use the dictionary?, How to compress large integers?, and How to compress integer lists?) to understand why “«Î‡Ä¦í¥Â“ is "drama share irish dna"; •1¢₂P• is 27073120; and •1¢₂P•3в is [1,2,1,2,2,2,1,1,1,0,1,0,0,0,1,1].
number You're on a 8 day streak!: ₄внŽ4$2ôQàI8Å?+>„ans∍
See this answer of mine.
string No A, just CAPS LOCK: „AaS¡Dvć?.š
See this this answer of @Emigna, although without õ? and with .š instead of š, since his answer is built in the legacy version of 05AB1E instead of the new one.
kolmogorov-complexity Print a Tabula Recta!: A₂F=À
See this answer of @Adnan, although with ₂F instead of Dv, since I personally prefer to keep my programs as straight-forward as possible despite codegolfing (where ₂ is the builtin for 26, and F loops that many times).
number Am I a Rude Number?: 32B4å
See this answer of mine.
string Don't google "google": 'Š¹ÊigëF
Although there is this pretty old answer of @Adnan which worked on one of the earliest versions of 05AB1E when he posted it back in 2016, it doesn't even work anymore in the latest legacy version on TIO from around mid-2017, let alone in the latest 05AB1E version. So instead I now use this (which is also 2 bytes shorter anyway):
'Š¹        '# Push the dictionary string "google"
   Êi       # If the (implicit) input-string is NOT equal to "google":
     g      #  Pop and push the length of the (implicit) input-string
            #  (which will be output implicitly as result)
    ë       # Else:
     F      #  Start a loop using the (implicit) input-string,
            #  which will result in an error if it isn't an integer

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why 'Š¹ is "google".
kolmogorov-complexity Sing Happy Birthday to your favourite programming language: ”to€î”Ð”¬Ž 05AB1E”s)”ŽØ¢© ”ì»
See this 05AB1E answer of @Grimmy.
number Fibonacci function or sequence: Åf
Åf          # Given the (implicit) input-integer `n`, get the n'th Fibonacci number
            # (after which it is output implicitly as result)

number Count up forever: ∞€,
See this answer of @Sagittarius.
number Is this number a prime?: p
p           # Given the (implicit) input-integer, check if it's a prime number
            # (1 if truthy; 0 if falsey)
            # (after which it is output implicitly as result)

quine Print the last, middle and first character of your code: .…. .
As I already mentioned earlier, I added an additional no-op space to the program so the middle character in this orientation would be a space character, instead of a newline character. The first and last characters are ., so we'll have the following sub-program:
.           # No-op, since `.…` isn't an available 2-byte builtin
 …. .       # Push 3-char string ". ."
     q      # Stop the program, making everything after that no-ops
            # (after which the result is output implicitly)

kolmogorov-complexity Build me a brick wall!: .…_|_ĆƵм×Tä»
See this answer of @Adnan, although golfed by 2 bytes by replacing "_|__" with …_|_Ć (push 3-char string "_|_"; and then enclose, appending its own first character) and 175 with Ƶм (compressed integer).
string "Hello, World!": ”Ÿ™,‚ï!”
See this answer of @Adnan, except with trailing ” to close the string.
The ] you see before the q in each program is to close all open if-else statements and loops before doing this q.
I'm unable to fit anything more in it from the list in the challenge description. The ones left are three (kolmogorov-complexity/ascii-art) that require you to output something without input (which I have already used in all eight rotations) and four quine-related challenges, which are just impossible with this kind of layout in 05AB1E.
If there would have been more challenges taking integer/string inputs, those could have been added as well.

Yes! Totally what I was hoping to see!

This is a work of art!

@DomHastings Ok, I'm finally done. All 8 rotations and 18 subprograms in total. Updating those TIOs is such a pain btw, haha. The 7 remaining challenges to choose from I won't be able to add (see what I mentioned at the very bottom). (If there were any other challenges that take input, I could have added them, but I'm kinda glad there aren't, since it's pretty time-consuming.. xD)

Nice dedication! I'll certainly take this aspect into consideration for any future challenges like this, I'm glad you (seemingly anyway) enjoyed this!

perl -M5.010 -Mbigint, 8 orientations, 8 18 tasks, 1644 2840 bytes
####################################################iA;"/sv)=-=f{.{ei#
if(eof()){say+("11 *25 *\n7 4*10 *5 *10 4*" .##cAc##f.e[^ag.(-po$./lf#
"\n5 4*12 7*12 4*\n3 6*12 7*12 6*\n2 9*9 9*".##'+b##(.x^(yk$$$orp*^s(#
"9 9*\n 47*\n49*\n49*\n49*\n 47*\n  5*7 21*".##@wM##eYi$$$k3x_d =).ee#
"7 5*\n4 4*7 3*4 5*4 3*7 4*\n7 **7 *6 3*6 *".##@@E##o;tvc1g)[>#2$.+{o#
"7 **\n")=~s/(\d+)(\D)/$2 x$1/gre}else{chomp(##4`c##f/}]*.px1=%._(?$f#
$_=<>);if(/\D/){/^google/&¨$_=length}else##":B##(.$"$(b ]00.>?(_(#
{$_=sprintf"00%b",$_;$_=/00100(.{5})*$/?1:0}}##VQl##){_;v(s2,;#$1{?=)#
say;#[447}E<vFX**gd's<kN6iiX#gS0qnsHgj'M%um$###>fr##)2=$*(z)$son;s{<)#
=pod#+RvC!y-9UwQ7ImGlBV03'UoBoqY:#OR`6z&C_;0###$I7##{6<v({t}xa+-$as>{#
[$1=~y,a-zA-Z,A-Za-z,r]ige}};say;#zG}B2|M}TI###X^4##$}>=$sde[yQ2nya;{#
"ur new baby! :D"}}else{s[a([^aA]*)a?] ##l"}###/)u##_(;"cpvl0$s;=$ycs#
$/,grep$_,@x}else{$_="Congratulations on yo".##"(O##=?$[)lfs]x9s$1$ha#
' $'x$_,' |'x$_,'-'x$x,'~'x$x,'-'x$x);$_=join##ZSo##j{v$)ize+[Ja_}&oy#
;if(/^-?\d+$/){if($_){$x=1+2*($_<0?1:$_);@x=(##)<V##os=v$ts{$0Jy;)}m+#
if(eof()){$_="Hello, World!"}else{$_=<>;chomp##WJ+##iaa]c/}@x]^!$()p+#
###############################################JvE##nye"*/-x[}@!p?(;$#
###############F+g@,ZHTSgmA|[\N"0`EV(>QJ'=b(9]+FJY##"$i;(,>=1#>$&!?i_#
###########.###lq{$LWnQj&g|l27@'o}Tr@VFDBI`K#np#7g##"&oi$b{(]6>p&)!f;#
#9Tj=~7D#Sxy{##.YTb}.:7dj+t|4-8Fo\GZJ?E=L7CWYq-RVu##,}ufvp$0){/}=/)(r#
#7$_j;&Q,A$b###<M+agLQ5{_6z^mL6V:VVo;Azb`4<5tAUx9###A)y()c2,wwd}$x//e#
#L[vlh(sa#ya(##hOy>[A&.[usZ_Xzkgn^{qdp|2B{T-g5&$u+##.(;#/g}1h;0#n};\d#
#,zQS#wBpraB.##(Qrc\!&X(_i[Cd1o:vuq76kWY/g0v>xso8|##.?$/)d|)id'[%e/Do#
#{x]V;Gzdos."##eXBcnsw2l?ImMzjJ;0NO045|JIrUh\sT@wh##Z!ca{t|;lCxd$l^/}#
###LuyK/nf;)k##G{3|#3B)J\n"rG__@*w0,6h6m6\MLggprbN##,)=[#f$@eiU\_s()}#
#";M!aBwa x3r##Oj@;),oZ-Yh6gBXx*B-Aq|!Xg;vx!@O7V^_###/###.2x#####e####
#t"]#sLTrr$xa##p79<GL"e"STDrRWLVRHuQY`_zmq;wDu`3cD####################
#ru}~;b'Ggy)h#########################################################
#io#=rgr,/a/S###rof zzuBzziF:zzuB:zziF:_$?3%_$?5%_$?51%_$yas{))(foe(fi
#BYyr!vay_s$ ###Xat(\'7O(>#;a:na?/$*)...(]81[1^|8^/~=><yas}tixe;001..1
#  a!l+7m$;.y###iv&.:!Pd.MSjhr6,|E+>cjA(%?NuLB"}ss#8H?<Otd~Bw0zy>#dop=
#yosrrm#m/")b###$#;yas}")".]]7[c$[)"   ","___",'" "'," : "(."( n\".]]5
#pt;ae{;oy!6a##[c$[)"$,"\\","$,">"(.")".]]6[c$[)"   ","< >","[ ]"," :"
#p yePVaMbkxB##."$(."(".]]4[c$[)"$,"/","$,"<"(./$.]]5[c$[)"$,"$,"/","$
#ayaD!~m,ar""##(.")".]]3[c$[)"-","O","o","."(.]]1[c$[)"$,"_",".",","(.
#Has!u#dyBao(##]]2[c$[)"-","O","o","."(."(".]]4[c$[)"$,"$,"\\","$(./$.
#"d;oodnd/ho(##]]0[c$[)")_*_(","\\_/ ",".....","_===_"(."$./$.]]0[c$[)
#=hytYoadsSd=##"___ ","_  ","___ ",""(."$=_$;g/./~=><}1-_${pam=c@{esle
#_"a!!pra~  x##}5=x _$;g//$..|..^/s;2=x _$;/$.)81x"|___"(=_${))(foe(fi
#$.sss=GD=""$#########################################################

Before explaining how it works, let me tell how I created the monster
above. I started off with 8 programs, each doing 1 to 3 tasks. Which task they do depends on the input (all input is read as a single line from STDIN) they get: void, an integer, or a string. 8 programs handle void input, 6 handle integer input, and 4 handle string input. If there would be more tasks which take integer and/or string input, we could have handled 24 inputs.
Now, we take the 8 programs, and combine them in the following way:
###################PP=PP#
PROGRAM 1 TOP    ##RRpRR#
PROGRAM 1 BOTTOM ##OOoOO#
=pod             ##GGdGG#
PROGRAM 2 BOTTOM ##RR RR#
PROGRAM 2 TOP    ##AA AA#
###################MM MM#
#     #           #     #
# M M #           #44 33#
# O O #           #     #
# T T #           #TB BT#
#PT TP#           #OO OO#
#OO OO#           #PT TP#
#TB BT#           # T T #
#     #           # O O #
#77 88#           # M M #
#     #           #     #
#MM MM###################
#AA AA##    POT 6 MARGORP
#RR RR## MOTTOB 6 MARGORP
#GGdGG##             dop=
#OOoOO## MOTTOB 5 MARGORP
#RRpRR##    POT 5 MARGORP
#PP=PP###################

Any 'gaps' (whether from short lines, or how the programs are laid out) are filled with random characters, protected by comment characters.
Any lines starting with =pod prevent Perl to see the rest of the program; this way we get to have two programs per rotation; flipping the program in the x-axis exposes the other program.
A few things need to be taken care off: programs should finish with semi-colon or a right-paren which closes a block. That way, the final statement is finished, and only then, Perl will recognized the =pod as the start of a POD section. Second, if we have a construct of the form s[pattern][replacement], with a newline between the s[pattern] and [replacement], we must add a space after s[pattern]. Otherwise, we may end up with s[pattern]#, and that # Perl will not see as a comment, but as a delimiter for the replacement part. With a space before the #, Perl will treat it as a comment.
Up to the tasks!
No rotations, no mirroring
if(eof()){say+("11 *25 *\n7 4*10 *5 *10 4*" .
"\n5 4*12 7*12 4*\n3 6*12 7*12 6*\n2 9*9 9*".
"9 9*\n 47*\n49*\n49*\n49*\n 47*\n  5*7 21*".
"7 5*\n4 4*7 3*4 5*4 3*7 4*\n7 **7 *6 3*6 *".
"7 **\n")=~s/(\d+)(\D)/$2 x$1/gre}else{chomp(
$_=<>);if(/\D/){/^google/&¨$_=length}else
{$_=sprintf"00%b",$_;$_=/00100(.{5})*$/?1:0}}
say;

No input
Without input, this does the "In Honor of Adam West" task. We're using a simple encoded string, where repeated characters are encoded as NNc, which means NN times the character c. The string is decoded and printed.
Try it online!
Integer input (non negative)
Now we determine whether the given number is a Rude Number. We take the number, get the binary representation, prepend 00, and look whether the result contains 00100 followed by Ns 0s and 1s, where N is a multiple of 5.
Try it online!
String input
For other inputs, if the input equals google, we die. Otherwise, we print the length of the input.
Try it online!
No rotation, mirrored.
If we mirror the program, we effectively end up with:
if(eof()){$_="Hello, World!"}else{$_=<>;chomp
;if(/^-?\d+$/){if($_){$x=1+2*($_<0?1:$_);@x=(
' $'x$_,' |'x$_,'-'x$x,'~'x$x,'-'x$x);$_=join
$/,grep$_,@x}else{$_="Congratulations on yo".
"ur new baby! :D"}}else{s[a([^aA]*)a?] #
[$1=~y,a-zA-Z,A-Za-z,r]ige}};say;

No input.
The program prints out Hello, World!. Nothing creative going on here.
Try it online!
Integer input
We do the "It's my Birthday :D" task. If the input equals 0, we print out Congratulations on your new baby! :D. For the input (N) is positive, we start printing out N candles, then a cake of width 2 * N - 1. If the input is negative, we print a candleless cake, with width 3. All pretty straightforward.
Try it online!
String input
Now we do the "No A. just CAPS LOCK". We repeatedly find strings which are delimited by a (either case), with no a in between (with some trickery to make it work for the end of the string as well. We throw away the bounding as, and flip the case of the string between the as.
Try it online!
Rotating 90° counter clockwise, no mirroring
We then end up with effectively:
if(eof()){{say++$_;redo}}
else{$_=<>;chomp;if(/\D/)
{/^.+?(?{say$&})(?!)/;/^(
..*).(?{say$1})(?!)/x}else
{$p=$_>1;$n=$_;$p&&=$n%$_
for 2..$n-2;say!!$p}}

No input
With no input, we enter an infinite loop, where we increment $_ and print the result.
Try it online!
Integer input (non-negative)
We will now determine whether the given number is a prime number. We do this by checking whether non of the integers between (but not including) 1 and the input number evenly divides the input number. We then print the result (1 if it's a prime, an empty line if it's not).
Try it online!
String input
Now we do the YouTube Comments #1 task. We do this by finding all sub strings of the given string, which are anchored at the beginning. This is done by use a regexp (/^.*?/), printing the match (/(?{say $&})/) and then failing the match (/(?!)/ (it can never happen that the current position isn't followed by an empty string)). This cause Perl to backtrack and try the next match. The quantifier modifier ? makes Perl try the shortest strings first. This takes care of the first half (including the full line). For the second half, we use /^(..*)./, which does almost the same thing, except it only matches sub strings which are followed by at least one other character (so, it skips the full string), and it tries it in "longest first" order.
Try it online!
Rotating 90° counter clockwise, mirrored
Then we effectively get:
if(eof()){$_=join"",A..Z,
A..Y;/.{26}(?{say$&})(?!)/
;exit}$_=<>;$v=aeiouy;$c=
"[^$v]";$v="[$v]";if(
/^($c*$v*($c))$c*($v)/){
say$1.((({split//,bpcgdtf.
vgkkgpbsztdvfzs}->{$2}||$2
).$3)x 2)}else{@x=(0,1);@x
=($x[1],$x[0]+$x[1])while
--$_>=0;say$x[0]}

No input
This prints out the "Tabula Recta". It does so by creating a string consisting of all the letters A to Z, followed by the letters A to Y (so, 51 letters in total). We then find all sub strings of length 26 and print them, using the same trick as above.
Try it online!
Integer input (non negative)
In this case, we calculate the Nth Fibonacci number, where N is the input. We do this by keeping track of two numbers, initialized to (0, 1), and N times replacing (n, m) by (m, n + m).
Try it online!
String input
Now we "Covfefify a string". We start of by grabbing the parts of the string we need (/^($c*$v*($c))$c*($v)/, where $c and $v are character classes matching consonants and vowels). We find the replacement consonant by doing a lookup ({split//,bpcgdtfvgkkgpbsztdvfzs}->{$2}||$2 -- the string is split into a list of characters, the surrounding {} turns the list into a hash ref; the ->{$2} indexes the second captures; if there is no match, the ||$2 makes it return the second capture -- this takes care of consonants which are replaced by themselves). Then it's a matter of constructing the final string.
Try it online!
Rotate the program, no mirroring
We effectively end up with:
if(eof()){$_=("___|"x18).$/;$_ x=2;s/^..|..$//g;$_ x=5}
else{@c=map{$_-1}<>=~/./g;$_=$".(""," ___","  _"," ___"
)[$c[0]].$/.$".("_===_","....."," /_\\","(_*_)")[$c[0]]
.$/.($","\\",$",$")[$c[4]]."(".(".","o","O","-")[$c[2]]
.(",",".","_",$")[$c[1]].(".","o","O","-")[$c[3]].")".(
$","/",$",$")[$c[5]].$/.("<",$","/",$")[$c[4]]."(".($".
": ","] [","> <","   ")[$c[6]].")".(">",$","\\",$")[$c[
5]]."\n (".(" : ",'" "',"___","   ")[$c[7]].")"}say;

No input
We now "Build me a brick wall!". We start off by concatenating the string ___| 18 times by it self, adding a newline, then doubling the line. We remove the first two characters, and the last two characters before the final newline. We then print the result 5 times.
Try it online!
Other input
It's time to build a snowman. We split the input on characters (which is assumed to be a string consisting of 1s, 2s, 3s, and 4s). It's then just a matter of combining the pieces of the snowman by getting the right parts from a series of lists.
Try it online!
Rotated 180°, mirrored.
Effectively, we have:
if(eof()){say$_%15?$_%5?$_%3?$_:Fizz:Buzz:FizzBuzz for
1..100;exit}say<>=~/^8|^1[18](...)*$/?an:a;

No input
Without input, the program does the FizzBuzz challenge. Nothing special going here, we loop numbers from 1 to 100, if 15 divides it evently, "FizzBuzz" is printed; if 5 divides it evently, "Buzz" is printed; if 3 divides it evenly, "Fizz" is printed, else, the number itself is printed.
Try it online!
Other input (assumed to be a non-negative integer)
This does the "You're on a 8 day streak!" task. If the input starts with 8, or starts with either 18 or 11 followed by 3 k digits for some k >= 0, we print "an", else we print "a".
Try it online!
Rotated 270° counter clockwise, no mirroring.
We end up with:
$_="Happy Birt"
."hday to You";
say;say;say
s!to!Dear!r=~
s!You!Perl!r;say;

This does only one thing, sing "Happy Birthday". The string "Happy Birthday to You" is created, and printed twice. Then it's printed with "to" replaced by "Dear", and "You" by "Perl". Then the original string is printed once again.
Try it online!
Rotated 270° counter clockwise, mirrored.
Effectively, we end up with:
$x=(("Baby Shark".(
" doo"x6).$/)x3).Baby.
" Shark!";say$x;say$x
=~s/Baby/$_/gr for
Daddy,Mommy,Grandpa,
Grandma;

This sings Baby Shark. It creates the string "Baby Shark doo doo doo doo\n", repeated thrice, followed by "Baby Shark!". This is printed, then it's printed another four times with Baby replaced by "Daddy", "Mommy", "Grandpa", and "Grandma" repectively.
Try it online!

Nice work! Minor thing though, the "don't Google Google" challenge asks for the length of the input, rather than the reverse!

@DomHastings Fixed now. Also added 4 more orientations.

Yes! Awesome work!

I think I spend more work creating this post than actually coding.

Befunge-93, 4 orientations, 4 tasks, 1205 bytes
In Honor of Adam West
>52*"       **       *      ***      *       **       "v  v.:>1
v"    ****       ***    *****    ***       ****    "*52<  <1+^
>52*"  *****       *********************       *****  "v
v" *********************************************** "*52<
>52*"*************************************************"v
v"*************************************************"*52<
>52*"*************************************************"v
v" *********************************************** "*52<
>52*"  *********         *********         *********  "v
v"   ******            *******            ******   "*52<
>52*"     ****            *******            ****     "v
v"       ****          *     *          ****       "*52<
>52*"           *                         *           "v
                            >        ^v         **25"A"<
                            v-1,\_@#:<<
                            >        ^v       *2"s"<
>52*"EEEEE      DDDD     CCCC       BBBB      AAA "v
v"A   A     B   B     C         D   D     E    "*52<
>52*" EEEE     D   D         C      BBBB     AAAAA"v
v"A   A     B   B     C         D   D     E    "*52< <,,,,,,,,,,,,,,@
>52*"EEEEE      DDDD     CCCC       BBBB     A   A"v v"Hello, World!"*25

Try it online!
Nothing special here. We push the 650 characters which needs to be printed
on the stack, then use a loop to print 650 characters.
5 Favorite Letters
Mirroring the original program vertically gives us:
>52*"EEEEE      DDDD     CCCC       BBBB     A   A"v v"Hello, World!"*25
v"A   A     B   B     C         D   D     E    "*52< <,,,,,,,,,,,,,,@
>52*" EEEE     D   D         C      BBBB     AAAAA"v
v"A   A     B   B     C         D   D     E    "*52<
>52*"EEEEE      DDDD     CCCC       BBBB      AAA "v
                            >        ^v       *2"s"<
                            v-1,\_@#:<<
                            >        ^v         **25"A"<
>52*"           *                         *           "v
v"       ****          *     *          ****       "*52<
>52*"     ****            *******            ****     "v
v"   ******            *******            ******   "*52<
>52*"  *********         *********         *********  "v
v" *********************************************** "*52<
>52*"*************************************************"v
v"*************************************************"*52<
>52*"*************************************************"v
v" *********************************************** "*52<
>52*"  *****       *********************       *****  "v
v"    ****       ***    *****    ***       ****    "*52<  <1+^
>52*"       **       *      ***      *       **       "v  v.:>1

Try it online!
As above; it pushes the 230 characters to be printed on the stack, and
then uses a loop to print 230 characters. It will reuse part of the loop
from the solution above.
Count up forever
Mirroring the original program horizontally give us:
         1>:.v  v"       **       *      ***      *       **       "*25>
          ^+1<  <25*"    ****       ***    *****    ***       ****    "v
                v"  *****       *********************       *****  "*25>
                <25*" *********************************************** "v
                v"*************************************************"*25>
                <25*"*************************************************"v
                v"*************************************************"*25>
                <25*" *********************************************** "v
                v"  *********         *********         *********  "*25>
                <25*"   ******            *******            ******   "v
                v"     ****            *******            ****     "*25>
                <25*"       ****          *     *          ****       "v
                v"           *                         *           "*25>
                <"A"52**         v^        >
                                 <<:#@_\,1-v
                    <"s"2*       v^        >
                    v" AAA      BBBB       CCCC     DDDD      EEEEE"*25>
                    <25*"    E     D   D         C     B   B     A   A"v
                    v"AAAAA     BBBB      C         D   D     EEEE "*25>
   @,,,,,,,,,,,,,,< <25*"    E     D   D         C     B   B     A   A"v
52*"!dlroW ,olleH"v v"A   A     BBBB       CCCC     DDDD      EEEEE"*25>

Try it online!
Uses a tiny loop. In the loop it duplicates the top of the stack, prints it, then adds 1 to the top of the stack. Rinse and repeat. 1 is pushed on the stack before entering the loop.
Hello, World
Rotating the original program by 180° gives the following program:
52*"!dlroW ,olleH"v v"A   A     BBBB       CCCC     DDDD      EEEEE"*25>
   @,,,,,,,,,,,,,,< <25*"    E     D   D         C     B   B     A   A"v
                    v"AAAAA     BBBB      C         D   D     EEEE "*25>
                    <25*"    E     D   D         C     B   B     A   A"v
                    v" AAA      BBBB       CCCC     DDDD      EEEEE"*25>
                    <"s"2*       v^        >
                                 <<:#@_\,1-v
                <"A"52**         v^        >
                v"           *                         *           "*25>
                <25*"       ****          *     *          ****       "v
                v"     ****            *******            ****     "*25>
                <25*"   ******            *******            ******   "v
                v"  *********         *********         *********  "*25>
                <25*" *********************************************** "v
                v"*************************************************"*25>
                <25*"*************************************************"v
                v"*************************************************"*25>
                <25*" *********************************************** "v
                v"  *****       *********************       *****  "*25>
          ^+1<  <25*"    ****       ***    *****    ***       ****    "v
         1>:.v  v"       **       *      ***      *       **       "*25>

Try it online!
This will push the necessary characters on the stack, and then prints those characters (no loop).

Bash, 4 orientations, 4 tasks, 1794 bytes
We are (ab)using the fact that (ba)sh is a true interpreter: it reads a line of code, and execute it. This means, once it has encountered an exit, it will never see the rest of the program, and won't complain it cannot parse it.
5 Favorite Letters
echo " AAA      BBBB       CCCC     DDDD      EEEEE";#   eedw
echo "A   A     B   B     C         D   D     E    ";#   xcoh
echo "AAAAA     BBBB      C         D   D     EEEE ";#   ih i
echo "A   A     B   B     C         D   D     E    ";#   toxl
echo "A   A     BBBB       CCCC     DDDD      EEEEE";#     =e
exit                                                ;#    $$
                                                          x([
                                                          ;(
                                                          dx1
                                                          o+
                                                          n1]
                                                          e)
                                                           )
###                                                      ;;;;
;;;                                                      ####
"
c" #;                                                    tixe
\! #;"       **       *      ***      *       **       " ohce
,d #;"    ****       ***    *****    ***       ****    " ohce
ol #;"  *****       *********************       *****  " ohce
lr #;" *********************************************** " ohce
lo #;"*************************************************" ohce
eW #;"*************************************************" ohce
H  #;"*************************************************" ohce
"" #;" *********************************************** " ohce
   #;"  *********         *********         *********  " ohce
oot#;"   ******            *******            ******   " ohce
hhi#;"     ****            *******            ****     " ohce
ccx#;"       ****          *     *          ****       " ohce
eee#;"           *                         *           " ohce

Try it online!
Count up forever
Rotating this by 90° counter clock wise, we end up with
while [ 1 ]  ;# eeeeeeeeeeeeee
do x=$((x+1));# xccccccccccccc
echo $x;done ;# ihhhhhhhhhhhhh
exit         ;# tooooooooooooo

                 """""""""""""
                     ***
######              *****
;;;;;;             *******
"""""              ********
E   E             *********
E E E             **********
E E E             **********
E E E            ** *********
EEEEE            *  *********
                    ******  *
                    ******  *
                    *****    *
                    *****
                    *****
 DDD               ******
D   D             *******
D   D            ********
D   D             *******
DDDDD              ******
                   ******
                   *******
                   **********
                  **********
                 ***********
C   C            ***********
C   C            ***********
C   C             **********
C   C              **********
 CCC               *******
                   ******
                   ******
                  *******
                 ********
                  *******
 B B               ******
B B B               *****
B B B               *****
B B B               *****    *
BBBBB               ******  *
                    ******  *
                 *  *********
                 ** *********
                  **********
                  **********
 AAAA             *********
A A                ********
A A                *******
A A                 *****
 AAAA                ***
"""""            """""""""""""
                ;;;;;;;;;;;;;;
ooooot          ##############
hhhhhi       #;           tixe
cccccx       #; "!dlroW " ohce
eeeeee       #;"c\,olleH" ohce

Try it online!
In Honor of Adam West
Rotating this once again by 90° counter clockwise, and we get:
echo "           *                         *           ";#eee
echo "       ****          *     *          ****       ";#xcc
echo "     ****            *******            ****     ";#ihh
echo "   ******            *******            ******   ";#too
echo "  *********         *********         *********  ";#
echo " *********************************************** ";# ""
echo "*************************************************";#  H
echo "*************************************************";# We
echo "*************************************************";# ol
echo " *********************************************** ";# rl
echo "  *****       *********************       *****  ";# lo
echo "    ****       ***    *****    ***       ****    ";# d,
echo "       **       *      ***      *       **       ";# !\
exit                                                    ;# "c
                                                            "
####                                                      ;;;
;;;;                                                      ###
 )
 )e
]1n
 +o
1xd
 (;
[(x
 $$    #;                                                tixe
e=     #;"EEEEE      DDDD     CCCC       BBBB     A   A" ohce
lxot   #;"    E     D   D         C     B   B     A   A" ohce
i hi   #;" EEEE     D   D         C      BBBB     AAAAA" ohce
hocx   #;"    E     D   D         C     B   B     A   A" ohce
wdee   #;"EEEEE      DDDD     CCCC       BBBB      AAA " ohce

Try it online!
Hello, World!
A final rotation of 90° counter clockwise, and we get:
echo "Hello,\c";#       eeeeee
echo " World!" ;#       xccccc
exit           ;#       ihhhhh
##############          tooooo
;;;;;;;;;;;;;;
"""""""""""""            """""
      ***                AAAA
     *****                 A A
    *******                A A
   ********                A A
   *********             AAAA
  **********
  **********
 ********* **
 *********  *
 *  ******
 *  ******               BBBBB
*    *****               B B B
     *****               B B B
     *****               B B B
     ******               B B
     *******
     ********
     *******
     ******
     ******
    *******               CCC
 **********              C   C
  **********             C   C
  ***********            C   C
  ***********            C   C
  ***********
  **********
 **********
    *******
     ******
     ******              DDDDD
     *******             D   D
     ********            D   D
     *******             D   D
     ******               DDD
     *****
     *****
*    *****
 *  ******
 *  ******
 *********  *            EEEEE
 ********* **            E E E
  **********             E E E
  **********             E E E
   *********             E   E
   ********              """""
    *******             ;;;;;;
     *****              ######
      ***
"""""""""""""

ooooooooooooot #;         tixe
hhhhhhhhhhhhhi #; enod;x$ ohce
cccccccccccccx #;))1+x(($=x od
eeeeeeeeeeeeee #;  ] 1 [ elihw

Try it online!
On TIO, this will actually print Hello,\c, followed by  World! on a newline. Whether \c is supported is implementation defined according to POSIX.1, and so is the alternative, the -n option. The intention is to surpres the newline echo by default emits. (And on my system, the builtin echo omits a newline when encountering \c, but doesn't recognize -n -- and the standalone utility does both). YMMV.

what about printf Hello, Try it online!