#include "dir.h" Dir charToDir(char ch) { switch(ch) { case 'd': return down; case 'u': return up; case 'l': return left; case 'r': return right; default: return none; } }