Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #38808

Re: Logic conundrums in check

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.javascript
Subject Re: Logic conundrums in check
Date Sat, 19 Sep 2020 15:17:40 +0200
Lines 28
Message-ID <hsmenkFq3o8U1@mid.individual.net> (permalink)
References <05dec20a-bc09-49d0-907d-b36b2387ea73o@googlegroups.com> <hsjhtgF7jajU1@mid.individual.net> <f00cef81-b9be-4f67-bdb0-4b2c73924680o@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Trace individual.net IGbnBeXvE0Jw6ViffM8yVQlMiZ9m3uNkczfEZOWHS7gvbHpclq
Cancel-Lock sha1:R1jfMo+nLOKAFAjcUB4EC8jGFYY=
In-Reply-To <f00cef81-b9be-4f67-bdb0-4b2c73924680o@googlegroups.com>
Xref csiph.com comp.lang.javascript:38808

Show key headers only | View raw


Jonas Thörnvall:

> Den fredag 18 september 2020 kl. 12:53:47 UTC+2 skrev Arno Welzel:
>> On 17.09.20 12:25, Jonas Thörnvall wrote:
[...]
>>> First you have to find your kings position "tile" i don't keep
>>> track of it. Then it seem i actually have to make a "test move"
>>> actually
>> 
>> Why don't you keep track on which tile the king is?
> 
> Of course its position recorded, but i made tiles an array object and
> pieces only properties of the tiles. "Of course i could have a
> variable named KingPosition, Queenposition and so on"

I would have done this the other way: every tile has the position as
property. As there is a maximum of 32 pieces, checking their positions
to decide wether a move is possible or not or if the king is in check
would not take that long - just check position of the maximum of 31
other pieces and for the "check" test the fields they can move to.

BTW: You should also learn how to use a *real* newsserver with a
NNTP-client instead of Google Groups.


-- 
Arno Welzel
https://arnowelzel.de

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-17 03:25 -0700
  Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-17 03:28 -0700
  Re: Logic conundrums in check John G Harris <niam@jghnorth.org.uk.invalid> - 2020-09-17 14:09 +0100
    Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-17 07:25 -0700
      Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-17 23:50 -0700
    Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-17 07:32 -0700
    Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-17 07:54 -0700
    Re: Logic conundrums in check Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-09-17 21:19 +0100
      Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-17 13:57 -0700
  Re: Logic conundrums in check Arno Welzel <usenet@arnowelzel.de> - 2020-09-18 12:53 +0200
    Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-18 04:48 -0700
      Re: Logic conundrums in check Arno Welzel <usenet@arnowelzel.de> - 2020-09-19 15:17 +0200
        Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-19 07:58 -0700
          Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-19 08:02 -0700
          Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-19 08:05 -0700
          Re: Logic conundrums in check luserdroog <luser.droog@gmail.com> - 2020-09-19 11:27 -0700
            Re: Logic conundrums in check Arno Welzel <usenet@arnowelzel.de> - 2020-09-20 00:10 +0200
              Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-19 16:09 -0700
              Re: Logic conundrums in check luserdroog <luser.droog@gmail.com> - 2020-09-19 17:07 -0700
          Re: Logic conundrums in check Arno Welzel <usenet@arnowelzel.de> - 2020-09-20 00:08 +0200
  Re: Logic conundrums in check Scott Sauyet <scott@sauyet.com> - 2020-09-22 09:55 -0700
    Re: Logic conundrums in check Scott Sauyet <scott@sauyet.com> - 2020-09-22 10:01 -0700
      Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-23 02:26 -0700
        Re: Logic conundrums in check Scott Sauyet <scott.sauyet@gmail.com> - 2020-09-24 19:41 -0700
          Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-24 22:45 -0700
          Re: Logic conundrums in check Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-09-24 22:58 -0700

csiph-web