After two weeks, it seems only right that we actually get around to a real chess puzzle. First on the list: Eight queens puzzle.
Specifically, how do you place n queens on an n by n chess board such that no pair of queens can attack one another?
After two weeks, it seems only right that we actually get around to a real chess puzzle. First on the list: Eight queens puzzle.
Specifically, how do you place n queens on an n by n chess board such that no pair of queens can attack one another?
Ever been to Cracker Barrel? Remember that peg game? It seems that rather a few people are interested in how to solve it: Google. Let’s do that.
Yesterday’s post at /r/dailyprogrammer managed to pique my interest1:
A triangle on a flat plane is described by its angles and side lengths, and you don’t need all of the angles and side lengths to work out everything about the triangle. (This is the same as last time.) However, this time, the triangle will not necessarily have a right angle. This is where more trigonometry comes in. Break out your trig again, people.
Yesterday, the daily programmer Subreddit had a post that mirrored a problem I’ve often seen before: the idea that if you follow first links ((With some caveats)) on Wikipedia, you eventually end with Philosophy. For example, if you follow the first links from Molecule, you get the following path:
Molecule → Atom → Matter → Rest Mass → Invariant Mass → Energy → Kinetic Energy → Physics → Natural Philosophy → Philosophy
One more challenge from Programming Praxis’ Word Games today (there are only a few left!). This time we have the challenge of cutting off bits of words, one letter at a time, such that each step is still a word.
The example given in their post is planet → plane → plan → pan → an → a
, although surely many such examples exist.
One of the rites of passage for computer scientists it seems is to solve the Eight Queens Problem–where you must place 8 queens on a chessboard so that no pair of queens is attacking each other. Even better is when you can expand that to the n-queens problem with n queens on an n by n chessboard. After finding it again in older posts on both Programming Praxis and DataGenetics, I decided to go ahead and take a crack at it and I think the solution is pretty straight forward.