1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-22 23:17:04 +00:00

edge function

This commit is contained in:
Zeno Rogue 2019-12-26 22:29:29 +01:00
parent 7f1f5ccb43
commit 688021ee1c

View File

@ -210,6 +210,13 @@ cld exp_parser::parse(int prio) {
else if(eat("floor(")) res = floor(real(parsepar()));
else if(eat("frac(")) { res = parsepar(); res = res - floor(real(res)); }
else if(eat("to01(")) { res = parsepar(); return atan(res) / ld(M_PI) + ld(0.5); }
else if(eat("edge(")) {
cld a = rparse(0);
force_eat(",");
cld b = rparse(0);
force_eat(")");
return edge_of_triangle_with_angles(2*M_PI/real(a), M_PI/real(b), M_PI/real(b));
}
else if(eat("ifp(")) {
cld cond = parse(0);
force_eat(",");