mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-10-09 03:42:24 +00:00
fieldpattern:: error detection in EASY
This commit is contained in:
@@ -64,6 +64,9 @@ EX int btspin(int id, int d) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if HDR
|
#if HDR
|
||||||
|
|
||||||
|
static const int ERR = -99;
|
||||||
|
|
||||||
struct fpattern {
|
struct fpattern {
|
||||||
|
|
||||||
unsigned force_hash;
|
unsigned force_hash;
|
||||||
@@ -94,6 +97,7 @@ struct fpattern {
|
|||||||
|
|
||||||
int add(int a, int b) {
|
int add(int a, int b) {
|
||||||
#ifdef EASY
|
#ifdef EASY
|
||||||
|
if(a == ERR || b == ERR || a*b<0) return ERR;
|
||||||
return (a+b)%Prime;
|
return (a+b)%Prime;
|
||||||
#else
|
#else
|
||||||
return m(a%Prime+b%Prime) + Prime * m(a/Prime+b/Prime);
|
return m(a%Prime+b%Prime) + Prime * m(a/Prime+b/Prime);
|
||||||
|
Reference in New Issue
Block a user