Web lists-archives.com

Re: Hexiom Solver Error: Anchor Not Found




On Wed, Apr 04, 2018 at 06:48:07PM +0800, SY Tang wrote:

> However, try as I might, I am unable to get it to work, I first got an
> error which says: *"WARNING: Couldn't compute FAST_CWD pointer"*, which I
> believe i self-fixed by running in Windows XP compatibility mode. After
> which, I still get another error which says *"Anchor not found"* and then a
> layout of 0s appear.
> 
> I assume that the "anchor" is the hexiom board which the program is
> supposed detect, but I do not understand how it cannot detect the board: I
> resized my chrome browser window so that the hexiom board takes the entire
> left half of the screen, with the cmd prompt on the right half, yet the
> program still shows the error. I watched the demonstration video and I
> can't find what I'm doing wrong. Can you please assist?
> 
> For your info, I am running Windows 10, Chrome Browser for the Hexiom game.

The program is taking a screenshot and searching the bitmap for the
upper left corner of the hexagon board, see function scan() in scrape.c

        for (py = 0; py < h - 1; ++py) {
                for (px = 0; px < w - 1; ++px) {
                        if (diff(R(px,     py), 0x25020C) < 4 &&
                            diff(R(px + 1, py), 0x25020C) < 4 &&
                            diff(R(px, py + 1), 0x25020C) < 4 &&
                            diff(R(px + 1, py + 1), 0x7F7F7F) < 4) {
                                fx = px;
                                fy = py;
                        }
                }
        }
        if (fx < 0 || fy < 0) {
                printf("anchor not found!\n");
                free(p);
                return;
        }

It looks for a two-by-two pixel square where the bottom-right pixel has
RGB color 127,127,127 (grey) and the other three pixels have RGB color
37,2,12 (redish almost black).

You could try to take a screenshot, write it into a bitmap file, open
that with MSPaint and check the RGB colors of the pixels at the upper
left corner of the hexagon.

This still works for me on Mac with Safari, if I find time I can give it
another try on a more recent Windows with an up-to-date cygwin.

I guess you could also just move the browser window so the corner is at
a known position, and edit scrape.c to simply set fx and fy to those
coordinates and rebuild a binary.

HTH,
Daniel

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple