Please dont take this seriously guys its just a dumb meme I haven’t written a single line of code in half of these languages

  • NocturnalMorning@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    Python one is accurate. Most of our problems are solved by importing a library and writing the line, librarySolver.importedFunction.SolveMyProblem()

    def main(): Print(‘thanks librarySolver’)

      • ornery_chemist@mander.xyz
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        So many solver solutions that day, either Z3 or Gauss-Jordan lol. I got a little obsessed about doing it without solvers or (god forbid) manually solving the system and eventually found a relatively simple way to find the intersection with just lines and planes:

        1. Translate all hailstones and their velocities to a reference frame in which one stone is stationary at 0,0,0 (origin).
        2. Take another arbitrary hailstone (A) and cross its (rereferenced) velocity and position vectors. This gives the normal vector of a plane containing the origin and the trajectory of A, both of which the thrown stone must intersect. So, the trajectory of the thrown stone lies in that plane somewhere.
        3. Take two more arbitrary hailstones B and C and find the points and times that they intersect the plane. The thrown stone must strike B and C at those points, so those points are coordinates on the line representing the thrown stone.
        4. Use the equation for the thrown stone to find its position at time = 0
        5. Translate that position back to the original reference frame.

        It’s a suboptimal solution in that it uses 4 hailstones instead of the theoretical minimum of 3, but was a lot easier to wrap my head around.

        • SpeakinTelnet@sh.itjust.works
          link
          fedilink
          arrow-up
          0
          ·
          8 months ago

          That is a great explanation of how you solved it, thanks! I should go back to it and conquer that puzzle properly without a solver. Or at least try.