[VA] My 2024's very first little teaser
|
01-26-2024, 07:32 AM
(This post was last modified: 01-26-2024 07:33 AM by PeterP.)
Post: #11
|
|||
|
|||
RE: [VA] My 2024's very first little teaser
Slight improvement, now in 3 lines, but still very long (and in-elegant) at 191 bytes.
10 Option Base 1 @ Fix 4 @ Dim A(9), C(2), D(2) @ MAT D=ZER @ Mat Input A @ A(2)=FNM(A(2),-1) 20 A(6)=FNM(A(6),-1) @ H=FNM(A(3),FNM(A(5),A(7))) @ Dim A(3,3) @ Mat D=CON @ C(2)=DET(A) 30 C(1)=H @ D(1)=2 @ DISP DOT(C,D) @ DEF FNM(X,Y) @ C(1)=X @ D(1)=Y @ FNM=DOT(C,D) @ END DEF Same principle still, matrix A has its elements (1,2) and (2,3) with a flipped signed, then the determinant of that matrix is calculated, which is now off only by 2* (1,3)*(2,2)*(3,1) which is added. The creation of the function FN M for the multiplication allowed to squeeze it into 3 lines. Cheers, PeterP |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)