* Copyright (c) 1988 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* %sccs.include.redist.c%
"@(#) Copyright (c) 1988 The Regents of the University of California.\n\
static char sccsid
[] = "@(#)ching.cno.c 5.3 (Berkeley) %G%";
* cno - Read a question, cast a change, and output the line values to the
* standard output for processing by "phx".
long now
; /* current time */
unsigned seed
; /* seed for random number generator */
char string
[6+1]; /* where the actual change string is put */
{ { OYIN
, YYANG
,}, { YYANG
, YYIN
,} },
{ { YYANG
, YYIN
,}, { YYIN
, OYANG
,} },
seed
= (int)now
+ getquest() + getgid() + getuid() + getpid(); /* randomize */
printf("%s\n", change());
* Hash the question by adding all the characters together.
while ((c
= getchar()) != EOF
)
* Get a set of six lines making up a change.
string
[i
] = table
[getrnum()&01][getrnum()&01][getrnum()&01] + '0';
* Get a number more random than what getrand() gives.
return((getrand())>>(getrand()%17));
return(seed
= (seed
*13077) + 6925);