![]() |
(25) N-Queens - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (25) N-Queens (/thread-18092.html) |
(25) N-Queens - Thomas Klemm - 03-02-2022 01:20 AM References The program is based on the flowcharts that are linked in Dave Britten's solution. But I had to make some changes:
Registers 0: # of old queens 1: New queen 2: Old queens 3: Chopping block 4: i counter 5: n size of board 6: 10 as constant Initialization and Run CLEAR REG FIX 8 8 STO 0 STO 5 10 STO 6 GTO 13 R/S Solution After about 40 minutes this result is shown: 0.57263148 This corresponds to the following setup: 5 7 2 6 3 1 4 8 8: | | | | | | | |#| 7: | |#| | | | | | | 6: | | | |#| | | | | 5: |#| | | | | | | | 4: | | | | | | |#| | 3: | | | | |#| | | | 2: | | |#| | | | | | 1: | | | | | |#| | | The next solutions will be shown after starting the program again with R/S. However for now it will not detect the end. There simply was no memory left to do so. Program The program can be used in this HP-25C emulator. Code: 01: 24 01 : RCL 1 RE: (25) N-Queens - Dave Britten - 03-02-2022 01:31 AM Wow, impressive! I took a very brief stab at doing this, but I was about 20 steps over the limit, with no obvious way to trim any more fat. |