MSVS-2019 Oddity

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

brianr
Posts: 536
Joined: Thu Mar 09, 2006 3:01 pm

Re: MSVS-2019 Oddity

Post by brianr »

And, that works nicely.
Now, down to only 18 W1 warnings.
I may have to expand to W2...
Thanks again.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: MSVS-2019 Oddity

Post by Joost Buijs »

The problem seems solved already, but if you only want to use the enums as constants you don't have to give the enum a name at all, but you can specify the type that you want the enums to have. Specifying int is probably redundant because most compilers will default to int anyway.
So just enum {...}; without the typedef should work too.

Code: Select all

// squares
enum : int
{
	A1, B1, C1, D1, E1, F1, G1, H1,
	A2, B2, C2, D2, E2, F2, G2, H2,
	A3, B3, C3, D3, E3, F3, G3, H3,
	A4, B4, C4, D4, E4, F4, G4, H4,
	A5, B5, C5, D5, E5, F5, G5, H5,
	A6, B6, C6, D6, E6, F6, G6, H6,
	A7, B7, C7, D7, E7, F7, G7, H7,
	A8, B8, C8, D8, E8, F8, G8, H8
};
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: MSVS-2019 Oddity

Post by Ras »

Joost Buijs wrote: Tue Sep 22, 2020 7:09 pmbut you can specify the type that you want the enums to have.
Doesn't compile as C99. Are you sure that this is for C and not C++? Because AFAIK, the underlying enum type in C is always int. But yeah, it should work like this:

Code: Select all

// squares
enum
{
	A1, B1, C1, D1, E1, F1, G1, H1,
	A2, B2, C2, D2, E2, F2, G2, H2,
	A3, B3, C3, D3, E3, F3, G3, H3,
	A4, B4, C4, D4, E4, F4, G4, H4,
	A5, B5, C5, D5, E5, F5, G5, H5,
	A6, B6, C6, D6, E6, F6, G6, H6,
	A7, B7, C7, D7, E7, F7, G7, H7,
	A8, B8, C8, D8, E8, F8, G8, H8
};
Rasmus Althoff
https://www.ct800.net
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: MSVS-2019 Oddity

Post by Joost Buijs »

Ras wrote: Tue Sep 22, 2020 8:53 pm
Joost Buijs wrote: Tue Sep 22, 2020 7:09 pmbut you can specify the type that you want the enums to have.
Doesn't compile as C99. Are you sure that this is for C and not C++? Because AFAIK, the underlying enum type in C is always int. But yeah, it should work like this:
It's for C++, I haven't been using C for almost 20 years and assumed Tinker is written in C++, maybe it isn't.
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: MSVS-2019 Oddity

Post by mvanthoor »

Isn't Tinker on any rating list? I've been looking for the engine, but the only one I can find is Thinker 5.4c, but that engine is written by a different person. I haven't been able to find anything regarding "Tinker".
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
brianr
Posts: 536
Joined: Thu Mar 09, 2006 3:01 pm

Re: MSVS-2019 Oddity

Post by brianr »

Tinker is private.

A handful of engine testers over the years have graciously included it in a few matches.
Sergio Martinez ran it a few years ago in the "Swiss tourneys".
It was about 2,500.
In addition, it was playing quite a lot on ICC from January, 2000 until a few years ago.

However, since the arrival of Griaffe and NNs, it has been largely dormant.

Tinker's grandfather started playing rudimentary chess in 1971 on a 16KB IBM 1130 (3.6 micro-sec add register speed) running off of punch cards. It was in Fortran and could manage about two ply.

Like many, I thought that the initial challenge was to get it to play at all, with a focus on move generation (which turns out to not be very important overall). Hard-coded recursion was added in about 1978 along with some PDP-11 assembler routines which enabled 4-6 ply searching. I don't recall knowing about alpha beta back then.

It went dormant until almost 20 years later with the Kasparov Deep Blue matches.
Hardware had improved a lot!
Instead of just playing at all, the new goal was to beat me (my own chess is very poor).
Then, I discovered GNUChess, then Crafty, and ICC. Soon thereafter Tinker played it's first game online.
It was far stronger than me just using simple tactics.

Since then so many things have been tried that the code became a total mess.
Search and evaluation turned out to be very important!

A/B, null move, hashing, killers, SEE, pondering, non-rotated bitboards, magic BBs, pruning, Nalimov tablebases, books, position learning, TD learning, genetic alg, NNs (simple hand-crafted), Texel-type tuning, testing methodologies and process, etc.

It has never had parallel search. It might win an occasional game against early versions of Stockfish with a 200 to 1 time advantage, so it seemed pretty pointless, at least until the core code was better (which has never happened, of course).
Tinker was never very competitive, but for a long time it ranked in the bottom of the top third of engines, until about the clone wars.
It eventually became more about the journey.
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: MSVS-2019 Oddity

Post by Dann Corbit »

After you can compile on -W4 with MSCVC, try GCC with -pedantic. Then move up to clang with maximum error checking.
When you get not a single peep from any compiler, your code is correct.

Now, compilers will bark if you use strcpy() for instance. But they are right in barking at you.
If you cannot justify with asserts using sizeof and strlen then you should not be using it.

C is a language that lets you shoot yourself in the foot.
C++ and PL/1 will allow you to blow your whole leg off with a shotgun.

Optimized, compiled languages give you the greasy fast speed.
But you must know and obey the laws
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.