mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-29 19:40:35 +00:00
arg::nomore(); fixes in collatz3
This commit is contained in:
parent
98381f5526
commit
49877fbfc9
@ -65,6 +65,8 @@ namespace arg {
|
||||
lshift(); if(pos > isize(argument)) { printf("Missing parameter\n"); exit(1); }
|
||||
}
|
||||
|
||||
bool nomore() { return pos >= isize(argument); }
|
||||
|
||||
const string& args() { return argument[pos]; }
|
||||
const char* argcs() { return args().c_str(); }
|
||||
int argi() { return atoi(argcs()); }
|
||||
|
1
hyper.h
1
hyper.h
@ -2292,6 +2292,7 @@ namespace arg {
|
||||
int argi();
|
||||
ld argf();
|
||||
bool argis(const string& s);
|
||||
bool nomore();
|
||||
unsigned arghex();
|
||||
|
||||
inline void shift_arg_formula(ld& x, const reaction_t& r = reaction_t()) { shift(); x = argf();
|
||||
|
@ -1721,9 +1721,9 @@ int readArgs() {
|
||||
shift();
|
||||
transmatrix *T = &T2;
|
||||
while(true) {
|
||||
if(arg::pos >= isize(arg::argument)) break;
|
||||
if(arg::nomore()) break;
|
||||
else if(argis("fd")) { shift(); *T = *T * xpush(argf()); shift(); }
|
||||
else if(argcs()[0] == 't') { shift(); *T = *T * hr::cspin(dimid(argcs()[1]),dimid(argcs()[2]),argf()); shift(); }
|
||||
else if(argcs()[0] == 't') { int x = dimid(argcs()[1]); int y = dimid(argcs()[2]); shift(); *T = *T * hr::cspin(x, y, argf()); shift(); }
|
||||
else if(argis("/")) { shift(); if(T == &T2) T = &T3; else break; }
|
||||
else break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user