X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; q=dns; s=default; b=mY2L ptIo3Ygm+pFyyVRqS6egIWY2y4+WWKMd1E/i2J82JF1kBMhAUv397h8i/zefpDrJ /neoabW1quaQzWy39aVdX6WFhuYZwwbCwrzSNsY5cV/a+5Kg8xGjIT/rIQlEhpGI 85L3piVK1oEX8s+Byo5Zy7sC9IAy+7q+hnkHOfs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=default; bh=nwZ8rgdb4/ eGd9cJ9eZ/kqm/meQ=; b=JmmSO2oFBpexp5mycID8SMMuJ4ysCYbGa5oPmirzRt lnQcX/Ay5bxI8up7TtsXQlZNL8+C2NKRGuTUTIB0JC9z2SWpKHLyGynHVPBDYv1t LBhSYfy1cbzuOhDNvfbJDWLStYJB/TwiJhpx5vhCBwon6KsJ2u8J4C8sDWX3BC85 M= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Tang, tang, game, watched X-HELO: insomnia.benzedrine.ch Date: Wed, 4 Apr 2018 22:45:00 +0200 From: Daniel Hartmeier To: SY Tang Cc: cygwin AT cygwin DOT com Subject: Re: Hexiom Solver Error: Anchor Not Found Message-ID: <20180404204500.GA91500@insomnia.benzedrine.ch> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) 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