]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - warp/sm.c
1 /* Header: sm.c,v 7.0 86/10/08 15:13:35 lwall Exp */
4 * Revision 7.0 86/10/08 15:13:35 lwall
5 * Split into separate files. Added amoebas and pirates.
17 char screen
[23][90], buf
[10];
26 fgets(screen
[0],90,stdin
);
27 if (isdigit(screen
[0][0])) {
28 int numstars
= atoi(screen
[0]);
30 for (y
=0; y
<23; y
++) {
36 for ( ; numstars
; numstars
--) {
37 scanf("%d %d\n",&tmpy
,&tmpx
);
43 for (y
=0; y
<23; y
++) {
44 printf("%s\n",screen
[y
]);
50 for (y
=1; y
<23; y
++) {
56 for (y
=1; y
<23; y
++) {
57 fgets(screen
[y
],90,stdin
);
60 for (y
=0; y
<23; y
++) {
61 for (x
=0; x
<80; x
+= 2) {
62 if (screen
[y
][x
] == '*') {
65 else if (screen
[y
][x
] == '\t' || screen
[y
][x
+1] == '\t') {
66 fprintf(stderr
,"Cannot have tabs in starmap--please expand.\n");
72 printf("%d\n",numstars
);
74 for (y
=0; y
<23; y
++) {
75 for (x
=0; x
<80; x
+= 2) {
76 if (screen
[y
][x
] == '*') {
77 printf("%d %d\n",y
,x
/2);