The Peg Puzzle Solved (Think Like a Programmer)

Поділитися
Вставка
  • Опубліковано 10 січ 2025

КОМЕНТАРІ • 12

  • @nolongerkai
    @nolongerkai 3 місяці тому

    Stumbled upon this puzzle in one of my drawers today and was curious how you could solve it using code. This is a very elegant and sturdy solution you have here! Now if I understood C++ I’d be able to track how it works. May attempt my own version in JavaScript one day. ¯\_(ツ)_/¯
    Great video!

  • @Pulsed101
    @Pulsed101 3 роки тому

    The code is waaaay over my head but at least I can follow your logic, very impressive

  • @Alexander-oh8ry
    @Alexander-oh8ry 4 роки тому +3

    This is unbelievably different from my approach for such a simple thing

    • @Pulsed101
      @Pulsed101 3 роки тому

      Any chance you're willing to share your solution? I have no idea how I would approach it

    • @Alexander-oh8ry
      @Alexander-oh8ry 3 роки тому +2

      @@Pulsed101 Id use a 2d array to store the state, which would make the legal move definition much easier, and for such a simple program I would not use any structs. Also, I would not use an extra board state editor that changes a binary number that represents the board state because this would take more time to make than simply writing some input based functions in the code that can visualize the board and let you dynamically change it.

  • @manishguptablackberry
    @manishguptablackberry 5 років тому +1

    Great efforts

  • @Razyelgore
    @Razyelgore 3 роки тому

    Its very interesting wish you showed all the code

  • @mohammedjawahri5726
    @mohammedjawahri5726 3 роки тому

    Why not work it backwards? No need to check "all pegs" if u can just work backward from the hole

  • @mxdici
    @mxdici 5 років тому +6

    Bro, what is going on

  • @jeffrygeorges1152
    @jeffrygeorges1152 4 роки тому

    What programming software is this?
    (Im a noob)

  • @ruthannmarie7119
    @ruthannmarie7119 5 років тому

    Just show the answer .lol