Slashdot Mirror


Solving the Knight's Tour Puzzle In 60 Lines of Python

ttsiod writes "When I was a kid, I used to play the Knight's Tour puzzle with pen and paper: you simply had to pass once from every square of a chess board, moving like a Knight. Nowadays, I no longer play chess; but somehow I remembered this nice little puzzle and coded a 60-line Python solver that can tackle even 100x100 boards in less than a second. Try beating this, fellow coders!"

2 of 311 comments (clear)

  1. evolve or die by mkcmkc · · Score: 0, Flamebait

    Yawn.

    A good language needs to occasionally shed unneeded features, or it will ossify into an unusable mess. (This is why Perl is dying.)

    --
    "Not an actor, but he plays one on TV."
  2. Re:awesome by jellomizer · · Score: 0, Flamebait

    Does it? Python is a prototype language, the fact that people use it for real applications is besides the point. It should be kept simple and basic to aid for faster prototyping of code. A basic print command is needed not a printf replacement.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.