Skip to content

Commit a560d11

Browse files
authored
Update othello.c
1 parent 9b0ec35 commit a560d11

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

examples/othello.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,17 @@ void prtbrd(char b[64]) __z88dk_fastcall;
9797
int prtscr(char b[64]) __z88dk_fastcall;
9898
#endif
9999

100+
101+
#ifdef __SANYO__
102+
#define BLACK 151 // 132 on phc-25
103+
#define WHITE 150 // 133 on phc-25
104+
//#define EMPTY 149
105+
#define EMPTY '-'
106+
#else
100107
#define BLACK '*'
101108
#define WHITE 'O'
102109
#define EMPTY '-'
110+
#endif
103111

104112
#ifdef __SPECTRUM__
105113
#define G_BLACK 128
@@ -476,7 +484,13 @@ void prtbrd(char b[64])
476484
#ifdef GRAPHICS
477485
#undef TEXT
478486
clg();
487+
488+
#ifdef __SANYO__
489+
printf("%c",26);
490+
#else
479491
printf("%c",12);
492+
#endif
493+
480494
for (i=0; i<8; i++) {
481495
putsprite(spr_or,127+i*16,2,&numbers[(i+1)*7]);
482496
putsprite(spr_or,112,16+i*16,&numbers[(i+1)*7]);
@@ -595,14 +609,29 @@ void prtbrd(char b[64])
595609
putchar('\n');
596610
}
597611
#else
612+
#ifdef __SANYO__
613+
printf(" %ct%c1 2 3 4 5 6 7 8%ct%c\n",27,2,27,0);
614+
#else
598615
printf(" 1 2 3 4 5 6 7 8\n");
616+
#endif
599617
for (i=0; i<8; i++) {
618+
#ifdef __SANYO__
619+
printf(" %u%c",i+1,233);
620+
#else
600621
printf(" %u",i+1);
622+
#endif
623+
601624
for (j=0; j<8; j++) {
602625
//#ifdef ANSITEXT
603626
//#endif
627+
#ifdef __SANYO__
628+
putchar(b[i*8+j]);
629+
putchar(' ');
630+
#else
604631
putchar(' ');
605632
putchar(b[i*8+j]);
633+
#endif
634+
606635
}
607636
putchar('\n');
608637
}
@@ -946,12 +975,19 @@ int main()
946975

947976
#endif
948977

978+
#ifdef __SANYO__
979+
980+
printf("%c\nWelcome to the %ct%c OTHELLO %ct%c program!\n",26,27,6,27,0);
981+
printf("\nNote: %ct%c BLACK ALWAYS GOES FIRST %ct%c ...Good luck!!!\n\n\n",27,2,27,0);
982+
983+
#else
949984
#ifdef ANSITEXT
950985
printf("%c\nWelcome to the %c[7m OTHELLO %c[27m program!\n",12,27,27);
951986
printf("\nNote: %c[4m BLACK ALWAYS GOES FIRST\n %c[24m ...Good luck!!!\n\n\n",27,27);
952987
#else
953988
printf("%c\nWelcome to the OTHELLO program!\n",12);
954989
printf("\nNote: BLACK ALWAYS GOES FIRST\n ...Good luck!!!\n\n\n");
990+
#endif
955991
#endif
956992
printf("Do you want to go first? ");
957993
if (toupper(getchar()) == 'Y')

0 commit comments

Comments
 (0)