1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2 /* hack.rip.c - version 1.0.2 */
3 /* $FreeBSD: src/games/hack/hack.rip.c,v 1.4 1999/11/16 10:26:37 marcel Exp $ */
4 /* $DragonFly: src/games/hack/hack.rip.c,v 1.4 2006/08/21 19:45:32 pavalos Exp $ */
8 static void center(int, const char *);
10 static char rip
[][60] = {
24 " _________)/\\\\_//(\\/(/\\)/\\//\\/|_)_______\n",
26 static const int n_rips
= sizeof(rip
) / sizeof(rip
[0]);
39 sprintf(buf
, "%ld AU", u
.ugold
);
41 sprintf(buf
, "killed by%s",
42 !strncmp(killer
, "the ", 4) ? "" :
43 !strcmp(killer
, "starvation") ? "" :
44 index(vowels
, *killer
) ? " an" : " a");
47 if(strlen(buf
) > 16) {
50 for(i
= 0; i
<= 16; i
++)
51 if(buf
[i
] == ' ') i0
= i
, i1
= i
+1;
58 sprintf(buf
, "%4d", getyear());
60 for(y
= 8, j
= 0; j
< n_rips
; y
++, j
++){
64 while(dpx
[x
] == ' ') x
++;
66 while(dpx
[x
] && dpx
[x
] != ' '){
78 center(int line
, const char *text
)
80 const char *ip
= text
;
83 op
= &rip
[line
][28 - ((strlen(text
)+1)/2)];
84 while(*ip
) *op
++ = *ip
++;