Results 1 to 9 of 9

Thread: Sorry ! can't resist Posting this !

  1. #1

    Thread Starter
    Addicted Member Active's Avatar
    Join Date
    Jan 2001
    Location
    Lat: 13° 4' 46" N, Long: 80° 15' 20" E
    Posts
    209

    Talking

    Note : compiles under GCC
    Author : anonymous

    Code:
    #define X N(a,O(h,W(f,M(c,g))),O(i,W(f,M(d,g))))
    #define A(x) r(D(x,1); O(x,-9); D(x,O(x,1)))
    #define L(x) toupper(getchar())-x
    #define R Z,Z,0,0
    #define S 0,9,6,6,6,6,6,6,9,0
    #define q D(h,0); A(f)A(g)
    #define T 0,6,1,2,2,2,2,1,6,0
    #define U 0,6,2,3,3,3,3,2,6,0
    #define C(x) ((x<1)||(x>8))
    #define F(x,y) printf(x,y);
    #define N(x,y,z) *O(*O(x,y),z)
    #define y(a,b,c) a[b][c]
    #define O(x,y) ((x)+(y))
    #define u(x) (O(0,-(x)))
    #define W(x,y) ((x)*(y))
    #define G(x) printf(x);
    #define D(x,y) (x=(y))
    #define P (rand()%6)
    #define Y D(e,O(e,1))
    #define s D(f,O(f,Q))
    #define H(x) return x
    #define B(x) while(x)
    #define M(x,y) *O(x,y)
    #define z(a,b) a[b]
    #define E(x) if(x)
    #define I main(){
    #define Z 0,0,0,0
    #define t G("\n")
    #define V(x) (!x)
    #define v h,i,j,k
    #define w e,f,g
    #define J int
    #define Q u(1)
    #define p "%c"
    #define o 'A'
    #define r for
    #define n 60
    #define K do
    
    J y(a,10,10)={R,R,R,R,Z,1,Q,Z,Z,Q,1,R,R,R,R,Z},y(b,10,10)={R,S,T,
    U       ,       U       ,       U       ,       U       ,       T
    ,       S       ,       R       }       ,       z       (       c
    ,       9       )       =       {       Q       ,       Q       ,
    Q,0,0,1,1,1,0},z(d,9)={Q,0,1,Q,1,Q,0,1,0};I J w,v;l();r(D(e,0);O(
    e       ,       -       n       )       ;       Y       )       {
    q       D       (       h       ,       O       (       h       ,
    m       (       f       ,       g       ,       1       ,       1
    )));E(h){K{G("\n?")K{D(f,L(O('A',Q)));}B(C(f));K{D(g,L('0'));}B(C
    (       g       )       )       ;       }       B       (       V
    (       m       (       f       ,       g       ,       1       ,
    Q       )       )       )       ;       l       (       )       ;
    }q E((D(k,O(m(f,g,Q,1),P)))>h){D(h,k);D(i,f);D(j,g);}E(h&&m(i,j,Q
    ,       Q       )       ) /***/ l /***/ (       )       ;       }
    }       J       m       (/*   */v/*****/)       J       v       ;
    {       J       w       ; /***/ E /***/ (       N       (       a
    ,h,i))H(0);E(O(k,Q))D(N(a,h,i),j);D(e,N(b,h,i));r(D(g,1);O(g,-9);
    D       (       g       , /***/ O /***/ (       g       ,       1
    )       )       )       {/*****/D/*   */(       g       ,       O
    (       g       ,       Q /***/ ) /***/ )       ;       E       (
    V(O(N(a,O(h,M(c,g)),O(i,M(d,g))),j))){r(D(f,1);V(O(X,j));D(f,O(f,
    1       )       )       )       ;       E       (       V       (
    O       (       N       (       a       ,       O       (       h
    ,       W       (       f       ,       M       (       c       ,
    g))),O(i,W(f,M(d,g)))),u(j))))r(s;f;s){X=X*k;D(e,O(e,N(b,O(h,W(f,
    M       (       c       ,       g       )       )       )       ,
    O       (       i       ,       W       (       f       ,       M
    (       d       ,       g       )       )       )       )       )
    );}}D(g,O(g,1));}E(V(O(e,u(N(b,h,i))))){D(N(a,h,i),0);H(0);}H(e);
    }       l       (       )       {       J       f       ,       g
    ;       t       A       (       g       )       {       F       (
    p       ,       O       (       O       (       o       ,       g
    ),Q))A(f)F("%c:",M("X O<",O(N(a,g,f),1)))t}G(" ")A(f)F("%d ",f)t}
    If you can't beat your computer at chess, try kickboxing !!!
    [Download Tag Editing Tools.]

  2. #2
    ChimpFace9000
    Guest
    It wouldnt compile, whats it do?

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It prints a sort of noughts-and-crosses board.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Won't compile under VC++ 6. How does it work, and how did you compile it???
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Put it in a .c rather than .cpp file, and add #include <stdio.h> at the top.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6

    Thread Starter
    Addicted Member Active's Avatar
    Join Date
    Jan 2001
    Location
    Lat: 13° 4' 46" N, Long: 80° 15' 20" E
    Posts
    209
    IT IS A COMPLETE WORKING PROGRAM WRITTEN IN ANSI-C
    THAT ACTUALLY PLAYS A DECENT GAME OF OTHELLO!

    THE COMPUTER IS PLAYING 'X'; YOU ARE 'O'.

    CELLS ARE IDENTIFIED BY ROW LETTER FOLLOWED BY COLUMN NUMBER:
    F4
    IS AN ACCEPTABLE FIRST MOVE FOR 'O', FOR EXAMPLE. ENTER YOUR MOVE,
    FOLLOWED BY "ENTER"; THE COMPUTER WILL MAKE ITS MOVE AND PRINT THE
    RESULTING NEW BOARD.

    SAVE THE PROGRAM IN A FILE WITH A .c EXTENSION AND
    COMPILE THE PROGRAM AS USUAL AND RUN IT!
    If you can't beat your computer at chess, try kickboxing !!!
    [Download Tag Editing Tools.]

  7. #7

    Thread Starter
    Addicted Member Active's Avatar
    Join Date
    Jan 2001
    Location
    Lat: 13° 4' 46" N, Long: 80° 15' 20" E
    Posts
    209
    add #include <stdio.h> at the top
    I used Bloodshed Dev-C++ v2.0, and it compiled it
    without the preamble.
    If you can't beat your computer at chess, try kickboxing !!!
    [Download Tag Editing Tools.]

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Whatever Obviously ANSI think different...it didn't work when I compiled it, for the reason that you can't use printf without a prototype
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9

    Thread Starter
    Addicted Member Active's Avatar
    Join Date
    Jan 2001
    Location
    Lat: 13° 4' 46" N, Long: 80° 15' 20" E
    Posts
    209
    For Those Who are new to othello like myself..

    http://www.armory.com/~iioa/othguide...ellorules.html
    If you can't beat your computer at chess, try kickboxing !!!
    [Download Tag Editing Tools.]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width