Queens Chess Challenge - Small Basic
Published Feb 12 2019 01:51 PM 300 Views
Microsoft
First published on MSDN on Jan 11, 2013

Authored by Ed Price


Make sure you check out LitDev's January challenges .


Here's more info about Amir CPS 's Challenge: 8-Queens!


The 8-Queens problem in chess is to place 8 queens on a chess board such that none of the queens is threatening any of the others.  The problem is to input the 8 columns of the queens on the rows of a chess board, with 1 being the first column and 8 being the last, e.g. 1 2 3 4 5 6 7 8 means the queens are along the diagonal, which would not be a valid solution.


More Info about this problem




Write a program to test a user input guess.


Examples:



  • Enter board configuration: 2 4 6 8 3 1 7 5 - This is a valid configuration (as above).

  • Enter board configuration: 1 8 2 5 3 7 4 6 - This is NOT a valid configuration.



Nonki took a crack at solving this challenge:


QDX521


Black queens means valid and red queens means NOT valid.






What do you think? Have you tried it?


And be sure to check out the forum thread: http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/1be6e691-9942-4b5f-a1a5-47bd3f...


Thanks!


- Ninja Ed


Version history
Last update:
‎Feb 12 2019 01:51 PM
Updated by: