File: direc.cc

package info (click to toggle)
pacman 10-13
  • links: PTS
  • area: main
  • in suites: woody
  • size: 664 kB
  • ctags: 1,108
  • sloc: cpp: 3,333; makefile: 502; sh: 96
file content (14 lines) | stat: -rw-r--r-- 298 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include"direc.h"

//get next coordinates going in a certain direction
void next(int* x,int* y,direction d,int xx,int yy) {
*x=xx;
*y=yy;
switch (d) {
 case none: break;
case still: break;
case up: (*y)--; break;
case down: (*y)++; break;
case left: (*x)--; break;
case right: (*x)++; break;
	  }}