1 #ifndef lint 2 static char sccsid[] = "@(#)getcodi.c 4.2 (Berkeley) 05/27/83"; 3 #endif not lint 4 5 # include "getpar.h" 6 7 /* 8 ** get course and distance 9 ** 10 ** The user is asked for a course and distance. This is used by 11 ** move, impulse, and some of the computer functions. 12 ** 13 ** The return value is zero for success, one for an invalid input 14 ** (meaning to drop the request). 15 */ 16 17 getcodi(co, di) 18 int *co; 19 double *di; 20 { 21 22 *co = getintpar("Course"); 23 24 /* course must be in the interval [0, 360] */ 25 if (*co < 0 || *co > 360) 26 return (1); 27 *di = getfltpar("Distance"); 28 29 /* distance must be in the interval [0, 15] */ 30 if (*di <= 0.0 || *di > 15.0) 31 return (1); 32 33 /* good return */ 34 return (0); 35 } 36