bool x_cmd(File *f, Cmd *cp) { if(cp->re) looper(f, cp, cp->cmdc=='x'); else linelooper(f, cp); return true; }
int x_cmd(File *f, Cmd *cp) { if(cp->re) looper(f, cp, cp->cmdc=='x'); else linelooper(f, cp); return TRUE; }
bool isbetween(char* to, char* from) { int fromx = squarexfinder(from); int fromy = squareyfinder(from); int tox = squarexfinder(to); int toy = squareyfinder(to); if (isondiag(to,from) == 1 && tox < fromx && toy < fromy) { if (diaglooper(tox, toy, fromx, 0) == 1) return 1; else return 0; } else if (isondiag(to,from) == 1 && fromx < tox && fromy < toy) { if (diaglooper(fromx, fromy, tox, 0) == 1) return 1; else return 0; } else if (isondiag(to,from) == 1 && tox > fromx && fromy > toy) { if (diaglooper(tox, toy, fromx, 1) == 1) return 1; else return 0; } else if (isondiag(to,from) == 1 && tox < fromx && toy > fromy) { if (diaglooper(fromx, fromy, tox, 1) == 1) return 1; else return 0; } else if (isonline(to,from) == 1 && fromx > tox) { if (linelooper(tox, toy, fromx, 0) == 1) return 1; else { printf("Nothing found between %s and %s\n", to, from); return 0; } } else if (isonline(to,from) == 1 && tox > fromx) { if (linelooper(fromx, toy, tox, 0) == 1) return 1; else return 0; } else if (isonline(to,from) == 1 && fromy > toy){ if (linelooper(tox, fromy, toy, 1) == 1) return 1; else return 0; } else if (isonline(to,from) == 1 && toy > fromy) { if (linelooper(tox, toy, fromy, 1) == 1) return 1; else return 0; } else printf("%s and %s are not on the same line or diagonal\n", to, from); }