coolroar Posted October 17, 2018 Share Posted October 17, 2018 Watch this speedy little app zip through n-queens solutions! N-Queens at Jounce.Space Simple javascript, no dependencies. A classic computer science exercise, the n queens puzzle is the problem of placing n chess queens on an nxn chessboard so that no queen threatens any another. Thus no queen shares a row, column, or diagonal with any other queen. My method does not use recursion and a global variable represents the chess board. [The CS professor frowns.] Mesmerizing! ? ? ? Quote Link to comment Share on other sites More sharing options...
ozdy Posted October 18, 2018 Share Posted October 18, 2018 Nice, btw finding an iterative solution to a recursive problem is both harder and more efficient, so dunno why your professor frowns Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.