The MASM Forum

Projects => Game Development => Topic started by: avcaballero on July 31, 2022, 04:26:42 AM

Title: 8 queens problem
Post by: avcaballero 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
Title: Re: 8 queens problem
Post by: avcaballero on August 02, 2022, 06:03:11 AM
No recursive version.
Title: Re: 8 queens problem
Post by: avcaballero 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
Title: Re: 8 queens problem
Post by: Biterider on August 06, 2022, 09:53:25 PM
Hi caballero
Sorry, but Windows blocks the download of your zip file  :sad:

Biterider
Title: Re: 8 queens problem
Post by: jj2007 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 ;-)
Title: Re: 8 queens problem
Post by: avcaballero on August 07, 2022, 12:01:37 AM
Quote from: Biterider on August 06, 2022, 09:53:25 PM
Sorry, but Windows blocks the download of your zip file  :sad:
:hmmm:

I have splitted the zip in src+bin+img
Title: Re: 8 queens problem
Post by: Biterider 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
Title: Re: 8 queens problem
Post by: avcaballero 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
  szNameFileWCH   db "D:\Temp\z8Queens_%#04i.ppm", 0
Title: Re: 8 queens problem
Post by: Biterider 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
Title: Re: 8 queens problem
Post by: avcaballero on August 07, 2022, 02:15:48 AM
Thanks for checking it, test passed.  :thumbsup:
Title: Re: 8 queens problem
Post by: avcaballero 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.