Old CCC archives?

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Charles B.

Re: Old CCC archives?

Post by Charles B. »

An old thread but no problem bringing it up for some fresh air I think. I replied to Dann Corbit's post in this thread since I had to reply to someone.

************************************************

From looking around I gather that over time there have been four publically available (Windows OS) offline readers for the old CCC archives.


Still available readers:


01 - ccc-off-line (CCC-Off-LineV027h) - By Vincent Lejeune. This is the reader that is on Dann Corbit's site.


02 - ccc browser 1.1 - By Andrei Fortuna

http://www.reocities.com/SiliconValley/ ... loads.html

If I am understanding correctly Andrei Fortuna's first publically available reader was "The Ultimate CCC Browser" and that later evolved into the above "ccc browser 1.1".



No longer available readers:


03 - ccc offline reader - By Andreas Herrmann

http://web.archive.org/web/200204090646 ... eadere.htm


04 - ccc catabase navigator v1.2 - By (author not listed)

http://web.archive.org/web/200210161659 ... /page5.htm




Anyone know if the reader by Andreas Herrmann can still be obtained?
Dann Corbit
Posts: 12799
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Old CCC archives?

Post by Dann Corbit »

I don't understand how it works, since L() appears to be void {it does not return a value as far as I can see} and there is a test with the return of L().
Dann Corbit
Posts: 12799
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Old CCC archives?

Post by Dann Corbit »

Which is to say that my translation is as follows:

Code: Select all

#include <stdlib.h>
#include <io.h>

extern int   Q(void );
extern void  W(void );
extern void  L(void );
extern int   D(int P,int N,int U);
extern void  F(void );
extern int   s(void );
extern int   J(int q);

char              *a = "ecdfgdcebbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbecdfgdce",
                  I,
                  E,
                  *r = "ABCDDBCA",
                  w,
                  t[9],
                  *B = "()++_)0(",
                  R = 4,
                  z,
                  O,
                  *m[8] =
                      {"PPPPPPPP", "PPPPPPPP", "/1>B^boq",
                       "?A_aPPPP", "@OQ`PPPP", "?@AOQ_`a", "?@AOQ_`a"
                      },             
                  *l = "main(x)";
int K[99], Y[999], g[3], j, u,
n, i, f, q, b[128], _[128], y, k[32];

int Q(void)
{
    for (g[1] = g[2] = i = 0; i < 128; i++)
        g[_[i]] += (100 + (r[i & 7] - 66) * (r[i >> 4] - 65)) * (B[b[i]] - 40);
    return g[y] - g[y ^ 3];
}

void W(void)
{
    for (z = O = i = 0; i < 128; i++) {
        _[i] = (b[i] = a[(i + (i & 7)) / 2] - 97) ? i < 50 ? 2 : (y = 1) : 0;
        if ((i & 7) > 6)
            i += 8;
    }
}

void L(void)
{
    if (z) {
        w--;
        I = K[--z] & 127;
        y ^= 3;
        E = (65280 & K[z]) >> 8;
        b[I] = (K[z] & 128) ? 1 : b[E];
        b[E] = K[z] >> 16;
        _[I] = y;
        _[E] = b[E] ? y ^ 3 : 0;
    }
}

int D(int P, int N, int U)
{
    int             q = k[w],
                        H,
                        g = 0;
    for (F(); q < k[w + 1]; q++) {
        if (g = J(Y[q])) {
            H = -((U < 1) ? Q() : D(-N, -P, U - 1));
            L();
            H > P ? (w ? 0 : (u = Y[q])), P = H : 0;
            if (H >= N)
                break;
        }
    }
    return g ? P : s() ? w - 10000 : 0;
}

void F(void)
{
    k[w + 1] = k[w++];
    for (i = 128; i-- > 0;) {
        if (_[i] == y) {
            if (b[i] > 1) {
                for (j = 0; j < 8; ++j)
                    for (n = i;;) {
                        n += m[b[i]][j] - 80;
                        if (n & 136 || _[n] == y)
                            break;
                        Y[k[w]++] = n << 8 | i;
                        if ((l[b[i]] & 1) || _[n])
                            break;
                    }
            } else {
                if (_[i] & 1) {
                    if (_[i - 17] > 1)
                        Y[k[w]++] = (i - 17) << 8 | i;
                    if (1 < _[i - 15])
                        Y[k[w]++] = (i - 15) << 8 | i;
                    if (!_[i - 16]) {
                        Y[k[w]++] = (i - 16) << 8 | i;
                        if (!_[i - 32] && i > 95)
                            Y[k[w]++] = (i - 32) << 8 | i;
                    }
                } else {
                    if (!_[16 + i]) {
                        if (i < 33 && !_[i + 32])
                            Y[k[w]++] = (i + 32) << 8 | i;
                        Y[k[w]++] = (16 + i) << 8 | i;
                    }
                    if (_[i + 15] & 1)
                        Y[k[w]++] = (i + 15) << 8 | i;
                    if (_[i + 17] & 1)
                        Y[k[w]++] = (i + 17) << 8 | i;
                }
            }
        }
    }
    w--, i = 0;
}

int s(void)
{
    for (q = i = -1; 128 > ++i;)
        if (b[i] > 5 && _[i] == y)
            q = i;
    for (E = 0; 0 <= i; i--) {
        if (_[i] == (y ^ 3)) {
            if (b[i] < 2) {
                if (((i - 17 == q || i - 15 == q) && _[i] & 1) || (_[i] > 1 && (i + 15 == q || i + 17 == q)))
                    E = 1;
            } else {
                for (j = 0; j < 8; j++)
                    for (n = i;;) {
                        n += m[b[i]][j] - 80;
                        if (q == n)
                            E = 1;
                        if (n & 136 || _[n] || l[b[i]] & 1)
                            break;
                    }
            }
        }
    }
    return E;
}

int J(int q)
{
    I = 127 & q;
    E = (q & 65280) >> 8;
    K[z++] = q | b[E] << 16;
    b[E] = b[I];
    if (b[I] < 2 && (E > 111 || E < 9))
        b[E] = 5, q &= 128;
    b[I] = _[I] = 0;
    _[E] = y;
    ++w;
    return s() ? (y ^= 3) && L() && 0 : (y ^= 3);
}

int main(void)
{
    W();
    while (1) {
        *k = w = 0;
        if (y & O) {
            D(-9999, 9999, R);
            u ? J(u) : exit(s() * y);
        }
        for (t[1] = u = w = 0, F(); i < 128; *t = 32 * _[i] + b[i]["-0.\"21+"], i += (i & 15) < 8 ? write(1, t, 1) : 8 * write(1, "\n", 1));
        if (O - 3) {
            read(0, t, 9);
            f = *t + 799 - t[1] * 16 | (799 - t[3] * 16 + t[2]) << 8;
            for (n = i = 0; i < k[1]; i++)
                f == Y[i] ? n = f : 0;
            n ? J(n) : *t == 85 ? O = 0, L() : *t == 67 ? O = t[1] - 48 : *t == 71 ? O = y : *t == 78 ? W() : *t == 80 ? R = t[1] - 48 : 0;
        }
    }
    return 0;
}
No doubt I have bollixed something up.
UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

Re: Old CCC archives?

Post by UncombedCoconut »

In K&R, functions return int if not otherwise specified. Return value is undefined though (except for main?), hence the && 0 to fix the return value to J(q).
Dann Corbit
Posts: 12799
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Old CCC archives?

Post by Dann Corbit »

UncombedCoconut wrote:In K&R, functions return int if not otherwise specified. Return value is undefined though (except for main?), hence the && 0 to fix the return value to J(q).
Here:
return s() ? (y ^= 3) && L() && 0 : (y ^= 3);

The return value of a void function is evaluated.
Now, if we make L() int as per the default you will see that the return value is never set in function L().

It appears to be undefined behavior to me either way.

But it is not at all unlikely that I goofed it up in reformatting so that I could read it.
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: Old CCC archives?

Post by Zach Wegner »

L should be int, and the return value doesn't matter because of the &&0.

The statement could be reduced to this to save a few characters:

return s() ? y ^= 3, L(), 0 : (y ^= 3);