1*21280Sdist /* 2*21280Sdist * Copyright (c) 1980 Regents of the University of California. 3*21280Sdist * All rights reserved. The Berkeley software License Agreement 4*21280Sdist * specifies the terms and conditions for redistribution. 5*21280Sdist */ 6*21280Sdist 711674Smckusick #ifndef lint 8*21280Sdist static char sccsid[] = "@(#)getcodi.c 5.1 (Berkeley) 05/30/85"; 911674Smckusick #endif not lint 1011674Smckusick 1111674Smckusick # include "getpar.h" 1211674Smckusick 1311674Smckusick /* 1411674Smckusick ** get course and distance 1511674Smckusick ** 1611674Smckusick ** The user is asked for a course and distance. This is used by 1711674Smckusick ** move, impulse, and some of the computer functions. 1811674Smckusick ** 1911674Smckusick ** The return value is zero for success, one for an invalid input 2011674Smckusick ** (meaning to drop the request). 2111674Smckusick */ 2211674Smckusick 2311674Smckusick getcodi(co, di) 2411674Smckusick int *co; 2512738Slayer double *di; 2611674Smckusick { 2711674Smckusick 2811674Smckusick *co = getintpar("Course"); 2911674Smckusick 3011674Smckusick /* course must be in the interval [0, 360] */ 3111674Smckusick if (*co < 0 || *co > 360) 3211674Smckusick return (1); 3311674Smckusick *di = getfltpar("Distance"); 3411674Smckusick 3511674Smckusick /* distance must be in the interval [0, 15] */ 3611674Smckusick if (*di <= 0.0 || *di > 15.0) 3711674Smckusick return (1); 3811674Smckusick 3911674Smckusick /* good return */ 4011674Smckusick return (0); 4111674Smckusick } 42