1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-24 10:27:45 +00:00

graph drawing in RogueViz

This commit is contained in:
Zeno Rogue
2018-10-23 17:05:46 +02:00
parent 6b47221a64
commit 0a54e56950
4 changed files with 514 additions and 59 deletions

28
hyper.h
View File

@@ -4239,5 +4239,33 @@ namespace ts {
void generate_around(cell *c);
int euclidAlt(short x, short y);
struct exp_parser {
string s;
int at;
exp_parser() { at = 0; }
map<string, ld> extra_params;
bool ok() { return at == isize(s); }
char next() { if(at == isize(s) || at == -1) return 0; else return s[at]; }
bool eat(const char *c) {
int orig_at = at;
while(*c && *c == next()) at++, c++;
if(*c == 0) return true;
else at = orig_at;
return false;
}
ld parse(int prio = 0);
ld parsepar() {
ld res = parse();
if(next() != ')') { at = -1; return res; }
at++;
return res;
}
};
}