/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'
<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));stat
icintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(s
tab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\
r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(IS
ALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=a
bc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;
len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;cha
r*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev
/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));s
tatic__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/register
db_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q
;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<=
'9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;
staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-
'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\
n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h
>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getlin
e}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4rando
m()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameifthereareles
sthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,
word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');fo
r(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randoms
ym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2
){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';else
skill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a
':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));
intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetab
le*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976
\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(
*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==
NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p
==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr
;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<
ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesi
ze_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*
chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscores
andcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hang
pic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_h
angon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);i
f(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_ha
ng(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mick
eyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sized
b_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)regist
ersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'
tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|
\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*
p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2
*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&≤
n)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<
='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A
'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb
_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*
chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcha
rhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0'])
;elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharab
c[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*
/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,had
dr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#in
clude<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoob
ig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_
t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*st
rlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*ab
c;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnput
c(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc)
;c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))ab
c[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c
,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<
=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inli
nesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsym
s(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9"
;staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TO
LOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1
];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']
='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='
s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rn
dvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_ra
ndomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_ista
b(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))
(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0'
)cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;stati
cchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;regis
tersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tr
ies;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#incl
ude<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt10
24];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inline
char*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsym
tabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;regis
terchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='
_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registerchar
c,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;f
or(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon
());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)
(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void))
;staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_i
sym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n
""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)
if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;fo
r(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a'
]=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcoun
t;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#includ
e<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_
t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/reg
isterdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=
0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&
&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_
tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(≤n);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a'
]=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnpu
tc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/pa
ram.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{g
etline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4
random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherea
relessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(t
ries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(
');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_ra
ndomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&sk
ill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0'
;elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'
A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,cha
r*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromt
hetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n
""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecn
putc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(w
ord==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)
if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_
taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#inc
lude<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inl
inesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,
*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunders
coresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p
=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}in
tdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(
c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}
db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:4
8mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`
sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)r
egistersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/
*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]=
"\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnp
utc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tr
ies=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(trie
s&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modi
f[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c
)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));v
oiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs
));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}stat
iccharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-
'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticc
harabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(wor
d,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(add
r,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.
h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmani
stoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)
size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':')
;/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerch
ar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));
cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(≤n);}{registercharc,c1;db_hang(tries,word
,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*
p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hang
man.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||
('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static_
_inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db
_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\
n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(a
bc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(a
bc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c
-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[
0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<d
ev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*
db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db
_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA
(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p
)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;
staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;
registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;retu
rn!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>
#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`
-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__i
nlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db
_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;
registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(
*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registe
rcharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=w
ord;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_h
angon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALP
HA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((v
oid));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X
_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""942
3\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p
;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar
*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[
c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&≤n)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_
tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#i
nclude<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((
size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab
*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*l
enp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>
='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){static
size_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[
c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc)
;cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<s
ys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BE
GIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{retur
narc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameift
herearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_h
ang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnpu
tc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=
db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!trie
s&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1
]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?
(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char
*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbol
fromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n8888
8\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}e
lsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*
/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p
;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_
expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h
>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static
__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerch
ar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringu
nderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;
for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r'
);}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOL
OWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']
=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521
:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/*
*if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(
mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->na
me);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstch
ar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);el
secnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\
0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if
(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&
&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLO
WER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t
*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsy
mtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;
}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[
(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;st
aticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strch
r(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangma
n(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_mac
hdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'han
gmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(
lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!
=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;regis
terchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-a
bc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries
,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISAL
PHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db
_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='
z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;st
atic__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random
(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n"
"9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnp
utc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[siz
eof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{
abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(m
odif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#incl
ude<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inline
char*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tst
ab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(IS
ALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries
<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_tt
ries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerch
ar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL
;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/
vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$
$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}stat
ic__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/
if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)intt
ries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p+
+)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{re
gistercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registercha
r*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while
(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#define
ISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon_
_P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandomsymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qual
ify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/for((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n
""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){if(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=wo
rd;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){staticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registe
rchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n)
{abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_
expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#include<sys/param.h>#include<vm/vm.h>#include<machine/db_machdep.h>#include<ddb/db_sym.h>#include<ddb/db_extern
.h>#include<dev/cons.h>#include<dev/rndvar.h>#defineTOLOWER(c)(('A'<=(c)&&(c)<='Z')?(c)-'A'+'a':(c))#defineISALPHA(c)(('a'<=(c)&&(c)<='z')||('A'<=(c)&&(c)<='Z'))/**if[`sizedb_hangman.o|awk'BEGIN{getline}{print$$1+$$2}'`-gt1024];*then*echo'hangmanistoobig!!!'*fi**/static__inlinesize_tdb_random
__P((size_t));static__inlinechar*db_randomsym__P((size_t*));voiddb_hang__P((int,char*,char*));intdb_hangon__P((void));staticintskill;static__inlinesize_tdb_random(mod)registersize_tmod;{returnarc4random()%mod;}static__inlinechar*db_randomsym(lenp)size_t*lenp;{registerchar*p,*q;/*chooserandoms
ymtab*/registerdb_symtab_tstab=db_istab(db_random(db_nsymtabs));/*chooserandomsymbolfromthetable*/q=db_qualify(X_db_isym(stab,db_random(X_db_nsyms(stab))),stab->name);/*don'tshowsymtabnameiftherearelessthan3of'em*/if(db_nsymtabs<3)while(*q++!=':');/*strlen(q)&&ignoringunderscoresandcolons*/fo
r((*lenp)=0,p=q;*p;p++)if(ISALPHA(*p))(*lenp)++;returnq;}staticcharhangpic[]="\n88888\r\n""976\r\n""975\r\n""9423\r\n""92\r\n""910\r\n""9\r\n""9";staticcharsubstchar[]="\\/|\\/O|/-|";voiddb_hang(tries,word,abc)inttries;registerchar*word;registerchar*abc;{registerchar*p;for(p=hangpic;*p;p++){i
f(*p>='0'&&*p<='9'){if(tries<=(*p)-'0')cnputc(substchar[(*p)-'0']);elsecnputc('');}elsecnputc(*p);}for(p=word;*p;p++)if(ISALPHA(*p))cnputc(abc[TOLOWER(*p)-'a']);elsecnputc(*p);cnputc('');cnputc('(');for(p=abc;*p;p++)if(*p=='_')cnputc('a'+(p-abc));cnputc(')');cnputc('\r');}intdb_hangon(void){s
taticsize_tlen;staticsize_ttries;staticchar*word=NULL;staticcharabc[26+1];/*for'\0'*/if(word==NULL){registerchar*p;for(p=abc;p<&abc[sizeof(abc)-1];p++)*p='-';*p='\0';tries=2*(1+skill/3);word=db_randomsym(&len);}{registercharc,c1;db_hang(tries,word,abc);c1=cngetc();c=TOLOWER(c1);if(ISALPHA(c)&
&abc[c-'a']=='-'){registerchar*p;registersize_tn;/*strchr(word,c)*/for(n=0,p=word;*p;p++)if(*p==c)n++;if(n){abc[c-'a']=c1;len-=n;}else{abc[c-'a']='_';tries--;}}}if(tries&&len)return1;if(!tries&&skill>2){registerchar*p=word;for(;*p;p++)if(ISALPHA(*p))abc[TOLOWER(*p)-'a']=*p;}db_hang(tries,word
,abc);cnputc('\n');word=NULL;return!tries;}voiddb_hangman(addr,haddr,count,modif)db_expr_taddr;inthaddr;db_expr_tcount;char*modif;{if(modif[0]=='s'&&'0'<=modif[1]&&modif[1]<='9')skill=modif[1]-'0';elseskill=5;while(db_hangon());}/*$OpenBSD:db_hangman.c,v1.142000/04/0521:54:48mickeyExp$*/#incl