1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-08-30 01:07:57 +00:00

fieldpattern:: error detection in EASY

This commit is contained in:
Zeno Rogue
2020-01-15 18:13:06 +01:00
parent b12e1a71dd
commit 19769feaaf

View File

@@ -64,6 +64,9 @@ EX int btspin(int id, int d) {
}
#if HDR
static const int ERR = -99;
struct fpattern {
unsigned force_hash;
@@ -94,6 +97,7 @@ struct fpattern {
int add(int a, int b) {
#ifdef EASY
if(a == ERR || b == ERR || a*b<0) return ERR;
return (a+b)%Prime;
#else
return m(a%Prime+b%Prime) + Prime * m(a/Prime+b/Prime);