From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37695 invoked by alias); 4 Apr 2018 20:45:42 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 37279 invoked by uid 89); 4 Apr 2018 20:45:06 -0000 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 Received: from insomnia.benzedrine.ch (HELO insomnia.benzedrine.ch) (212.51.132.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Apr 2018 20:45:04 +0000 Received: from insomnia.benzedrine.ch (localhost [127.0.0.1]) by insomnia.benzedrine.ch (8.15.2/8.15.2) with ESMTPS id w34Kj0bj023677 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 4 Apr 2018 22:45:00 +0200 (MEST) Received: (from dhartmei@localhost) by insomnia.benzedrine.ch (8.15.2/8.15.2/Submit) id w34Kj0ps052193; Wed, 4 Apr 2018 22:45:00 +0200 (MEST) Date: Wed, 04 Apr 2018 20:45:00 -0000 From: Daniel Hartmeier To: SY Tang Cc: cygwin@cygwin.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) X-SW-Source: 2018-04/txt/msg00024.txt.bz2 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