Author Topic: 8 queens problem  (Read 479 times)

caballero

  • Member
  • *****
  • Posts: 1980
  • Matrix - Noah
    • abre ojos ensamblador
8 queens problem
« on: July 31, 2022, 04:26:42 AM »
https://es.wikipedia.org/wiki/Problema_de_las_ocho_reinas

Full masm 32 bits source code included.

The program generates 92 image files in the same folder with one solution in each of them. Not tested all of them, but have good looking.


 :eusa_boohoo: https://www.youtube.com/watch?v=lYM3-3wg3eI
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 1980
  • Matrix - Noah
    • abre ojos ensamblador
Re: 8 queens problem
« Reply #1 on: August 02, 2022, 06:03:11 AM »
No recursive version.
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 1980
  • Matrix - Noah
    • abre ojos ensamblador
Re: 8 queens problem
« Reply #2 on: August 06, 2022, 08:44:42 PM »
I have modified the program to give only the 12 fundamental solutions, removing all symmetries, from the total of 92 solutions. I have not tested it, but it has good looking, it would be nice if someone has the time to test them according to the info in wikipedia:

https://en.wikipedia.org/wiki/Eight_queens_puzzle
« Last Edit: August 07, 2022, 12:13:03 AM by caballero »
The logic of the error is hidden among the most unexpected lines of the program

Biterider

  • Member
  • ****
  • Posts: 975
  • ObjAsm Developer
    • ObjAsm
Re: 8 queens problem
« Reply #3 on: August 06, 2022, 09:53:25 PM »
Hi caballero
Sorry, but Windows blocks the download of your zip file  :sad:

Biterider

jj2007

  • Member
  • *****
  • Posts: 12952
  • Assembler is fun ;-)
    • MasmBasic
Re: 8 queens problem
« Reply #4 on: August 06, 2022, 10:31:02 PM »
No problem on Win7-64, and it assembles fine. Of course, as PNGs the pics would be over 300 times smaller ;-)

caballero

  • Member
  • *****
  • Posts: 1980
  • Matrix - Noah
    • abre ojos ensamblador
Re: 8 queens problem
« Reply #5 on: August 07, 2022, 12:01:37 AM »
Sorry, but Windows blocks the download of your zip file  :sad:
:hmmm:

I have splitted the zip in src+bin+img
The logic of the error is hidden among the most unexpected lines of the program

Biterider

  • Member
  • ****
  • Posts: 975
  • ObjAsm Developer
    • ObjAsm
Re: 8 queens problem
« Reply #6 on: August 07, 2022, 12:43:22 AM »
Hi caballero
Now Windows blocks only the bin file.  :thup:
I managed to build the exe by changing some paths according to my installation and it assembles fine.
Executing the created exe did not show anything (double-clicking or running it from cmd).
I disabled windows runtime protection and downloaded the bin file. Executing this exe version unfortunately did not change the previous result.
OS: Windows 10 Home (21H1)

Biterider

caballero

  • Member
  • *****
  • Posts: 1980
  • Matrix - Noah
    • abre ojos ensamblador
Re: 8 queens problem
« Reply #7 on: August 07, 2022, 01:52:53 AM »
> Executing the created exe did not show anything

It just should generate several ppm files in the same folder than the exe is.

Maybe you could try indicating exactly the folder you want in the variable "xzNameFileWCH", maybe something like
Code: [Select]
  szNameFileWCH   db "D:\Temp\z8Queens_%#04i.ppm", 0
The logic of the error is hidden among the most unexpected lines of the program

Biterider

  • Member
  • ****
  • Posts: 975
  • ObjAsm Developer
    • ObjAsm
Re: 8 queens problem
« Reply #8 on: August 07, 2022, 02:08:29 AM »
Hi caballero
At first I thought that the ppm files from the download were needed as some kind of resource.
Now I have deleted these and the files have been recreated.

I checked these new ppm files and the result and everything seems correct.  :thup:

Biterider

caballero

  • Member
  • *****
  • Posts: 1980
  • Matrix - Noah
    • abre ojos ensamblador
Re: 8 queens problem
« Reply #9 on: August 07, 2022, 02:15:48 AM »
Thanks for checking it, test passed.  :thumbsup:
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 1980
  • Matrix - Noah
    • abre ojos ensamblador
Re: 8 queens problem
« Reply #10 on: August 08, 2022, 04:52:51 AM »
I have tested one of the file missed in the list of the 4th version: the file z8Queens_0003.ppm, and it seems to be ok because it is a simmetry of the file z8Queens_0002.ppm by oblique descending, as seen in the image.
The logic of the error is hidden among the most unexpected lines of the program