I'm gonna try giving problem 2 a shot.
Part a: without diagonal lines
Note that vertical lines and horizontal lines are the same, so we only need to count for one and multiply it by 2.
There are 2 cases.
Case 1: a line of triangles, a line of squares, and a line of both triangles and squares.
For the line of both triangles are squares, there are 6 possible arrangements. (s, t, t) (t, s, t) (t, t, s) (t, s, s) (s, t, s) (s, s, t)
There are also 6 possible arragements of the 3 lines (3!).
Therefore, there are 36 possible options.
Case 2: a line of triangles, a line of squares, and a line containing all triangles or all squares.
For the line containing all triangles or all squares, there are 2 possible arragements. (s, s, s) (t, t, t)
Finally, for each option there are 3 possible arrangements for the 3 lines. (3C2)
Therefore, there are 6 possible options.
Adding up both the cases we have 42 options.
However, we have to account for the fact that we can use both horizontal and diagonal lines, so we have a final answer of 84.
Part b: without diagonal lines
I don't think it is possible to have a grid with a diagonal line of squares or triangles since it would make having another line for the other shapes impossible.
Therefore, the answer is the same as without diagonal lines, 84.
My answer seems to be different from yours, do you mind explaining your logic?
=^._.^=