home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume11
/
jotto
/
part01
/
subs.c
< prev
Wrap
C/C++ Source or Header
|
1990-12-11
|
432b
|
35 lines
/*
* subroutines
*
* These are worth optimizing in assembly language.
*/
#include "jotto.h"
int
inter(a,b)
char *a, *b;
{
int retval;
char *ap, *bp;
retval = 0;
for (ap=a; ap<a+WORDLEN; ap++)
for (bp=b; bp<b+WORDLEN; bp++) if (*ap == *bp) {
retval++;
break;
}
return retval;
}
int
blog(n)
register int n;
{
register int retval;
if (!n--) return 0;
retval = 0;
while (n) {n>>=1; retval++;}
return retval;
}