Skip to content

Instantly share code, notes, and snippets.

@jmccardle
Created August 10, 2023 03:04
Show Gist options
  • Save jmccardle/69d46752af02517f6b21c0edeafa903c to your computer and use it in GitHub Desktop.
Save jmccardle/69d46752af02517f6b21c0edeafa903c to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LeannAlexandra
Copy link

Hi

I want to offer my help on your venture of definitively solving FloodGame.

I can generate data for your use in learning and assessing your machine learning ai. - just tell me how you need it stored to be used seamlessly in your project.

[The Abridged Version Below] - Unabridged here

Since I saw your youtube video , I've spent my time addressing the same issue of what you thought about
I have a perfect foundational idea (in c++)

SUMMARY:

Deviation from your video:

  • Does not yet use graphs*, doesn't plan to go to center.

PLAY FOR GAIN:

  • I play the first option from the list of options with the highest tile gain in that step, (if playing color 1 or 6 gives the same expansion, play 1)
  • I continue to iterate this way until I have win condition
  • an integer containing the number of steps to that point is then set.

BRUTE FORCE:

  • I use the integer (above- PFG) to limit the amount of steps ( the depth of recursion in essence)
  • I then iterate into every first option of all choices, creating branches as I go, never playing further than the quick solution
  • I then do backtracking and iterate through all (possible) plays - sometimes the order of the last 3 or 4 moves doesn't even matter, creating many paths, unnecessarily, but still necessary in the outlier cases where it actually does matter**(#1, 2 & 3) below
  • in every iteration if a shorter path is found, set the integer to that and limit the amount of steps to the new, smaller number.

NEEDED ACTIONS:

  1. I need to change existing code iterate BRUTEFORCE width first
  2. I could rack an integer of the available colors still on the board (cannot win in 3 if there is 4 colors left)
  3. reimplement a tracking plan to keep at least 'a' shortest path from the algorithm (removed because bad scaling)
  4. processing efficiency - I know how I can get performance gain (if necessary.)

Since You'd want to pit your AI against the most efficient algorithm out there, I would say it would be my honor to create that algorithm to race you - or you could use the existing program(eventually) to generate data useable in your training of ml/ai.

If you would have me as assistant , and maybe give me some pointers along the way, I would like to help you on your quest to solve FloodGame - I would require you to tell me how to save my data, and what data you'd need to use for your purposes

Practicality: My 'play for gain' solution can generate both the grid and provide a reasonable solution in any configuration (ie: grid of 50x50 with 12 colors ) in a fast time. Though currently it sometimes gives an unrealistic value (my human brain least possible moves to win -1).
Potentially it will give a benchmark when you're planning to slap a neural network on it, (PLUS the flexibility of the width/heigh/depth dynamic might be an interesting 'curveball' to validate your training data and neural network).

Sincerely

LeAnnAlexandra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment