Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 36

Thread: Grayout -Simple Linux freeware game

  1. #11

    Cool

    Classes. I'm still not friend with these. Though I can see the use for them. I'm glad to hear you are doing well with the classes.

    Anyway. I'm working on the machine solution update for the grayout program. Nothing to show today, despite me saying this type of program is quick to finish. Hopefully sometime next week. The plan is to have on or two algorithmic naive solutions, at least as allowed number of moves, and the challenge for the player is to do better. We will see. And discord friendship request arrived and accepted.
    Last edited by Jonax; 13-03-2022 at 08:16 PM. Reason: Typo

  2. #12
    Quote Originally Posted by Jonax View Post
    Classes. I'm still not friend with these. Though I can see the use for them. I'm glad to hear you are doing well with the classes.
    If you have any question in this area don't be afraid to ask. Unlike many Stack Overflow users I won't just tell you to go and read some pascal beginner book. While that may be a perfectly valid suggestion for long time. Giving such answer to a newbie is just a motivational killer and thus makes more harm than good. I know this from experience since I revived this kind of answers on various forums many times. Well not here on PGD. Which is why I'm regularly visiting PGD almost every day for years now.

    Quote Originally Posted by Jonax View Post
    The plan is to have on or two algorithmic naive solutions, at least as allowed number of moves, and the challenge for the player is to do better.
    I'm looking forward of seeing your solutions.
    If you hit a snag don't be afraid to ask for help. If you ask nicely I may even be convinced to install Lazarus again on my computer so I could test your code directly if the need arises.

  3. #13
    Thanks for the offer to help SilverWarior. So far I'm still making progress, but nothing to show today. Hopefully later this week, or perhaps next week. I can mention already now that the two algorithms are not equally effective, on average, and they both can be beaten by a human intelligence. Not surprisingly. But one has to start somewhere.


    I'm not visiting StackOverflow often but occasionally search engines send me there when searching for solutions to some problem or some notation I've forgotten. Now when you mention it I do have a beginners pascal book. The one I got with Delphi 3. It's still on a shelf somewhere. Though I don't think there were much about classes there. I'll ask you instead if I ever start dipping my toes in the classes. I can't comment on other fora but I really like it here in PGD forum.

  4. #14
    Progress slowing down. Got problems with the algorightmic solution. Made a workaround fix. Showed the animated gif in the discord.

  5. #15
    After looking at animation I'm guessing you are not counting the blocks that could be freed up in next move incorrectly. To me it seems that you are counting the number of faces that will border with the grayed out area after each move. but this is incorrect because you can clear several blocks surrounding one single block exposing multiple of its faces. So for instance if you clear other blocs on Northern, Eastern and Western side of one block you expose three faces of this one block. You should count this block only once. So in other words you would need a mechanism that will track which blocks you have already counted so you don't count them multiple times.

    Again this is just my guess based on observing your Algorithm progress through the board.

  6. #16
    That algorithm is not very efficient but at least it solves the pattern. I may have messed up the loop somewhere but the idea was to turn the maximum numbers of sqares each time.


    I'll upload a second algorithm to discord. It's supposed to maximize distance instead of area and tends to perform better for most patterns. Eventually there may be some combination of the two approaches.


    This is all work in progress now and the program is currently an aestethic mess. I'm afraid it won't be finished this week either. I'm still working on it.

  7. #17
    Quote Originally Posted by Jonax View Post
    I may have messed up the loop somewhere but the idea was to turn the maximum numbers of sqares each time.
    If the idea is to turn the maximum numbers of squares each time then you have a bug somewhere. While it seems to work like this in the start it fails to do so toward the end of provided animation.

  8. #18
    Quote Originally Posted by SilverWarior View Post
    If the idea is to turn the maximum numbers of squares each time then you have a bug somewhere. While it seems to work like this in the start it fails to do so toward the end of provided animation.
    Yeah, I may have a bug somewhere, happens a lot for me unfortunately. There are two provided animations. The first I may have messed up is supposed to be max turned squares per move. The second animation is supposed to make maxium advance towards other side per move, that later algo tends to solve the patterns faster. But no doubt not as fast as the unknown optimum solution. Unfortunately I'm kind of stuck now. Got to have some coffee and try again later.

    Happy Weekend!
    Last edited by Jonax; 19-03-2022 at 03:15 PM.

  9. #19

    Update

    Hi guys!

    After some polishing the updated Grayout program is completed. Now always solvable becuase the available number of steps are given by a new non optimized algorithm. In most cases you can probably beat that algorithm. I hope this will be the final version but one never knows what new issues may come up.

    The Linux (Debian) version can be downloaded from:

    https://www.jonax.se/downloads.php

    And below is the animated gif. Thanks to SilverWarior for help.



  10. #20
    Quote Originally Posted by Jonax View Post
    I hope this will be the final version but one never knows what new issues may come up.
    Why hoping this is the final version? There are still few possibilities for improvement:
    1. You could increase the number of colors and thus increase complexity of the puzzle
    2. You could introduce addition gravity mode where player clicks on any block which clears that block and any adjunct block of the same color and all of the blocks of the cleared area then falls down.
    3. You could introduce logging of player steps so he could undo some of its steps and then chose a different path.
    4. You could introduce some sort of a main menu through which player would issue commands for new game and which game type he wants.
    5. Heck I might even have an idea for even better algorithm for solving the game. Well it is more like modified puzzle generation code that would generate puzzle by adding certain number of colored blocks each step until the puzzle is field. Basically the reverse order of what player will be doing. This would allow you to get the number of steps needed for solving the puzzle during its creation.


    There are probably even more possible improvements that don't come to my mind right now.

Page 2 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •