ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

Preliminary attempt at a zfind-like oscillator searcher

For scripts to aid with computation or simulation in cellular automata.

Preliminary attempt at a zfind-like oscillator searcher

Postby A for awesome » May 29th, 2017, 4:29 pm

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* osrc.cpp version 0.1 (2017-05-29 rev #01)                                             *
* A search program for low-period oscillators and "short-wide" spaceships,              *
*  written in cross-platform C++.                                                       *
* It probably could just be in C, but I didn't want to go there.                        *
*                                                                                       *
* Options:                                                                              *
*                                                                                       *
*     PERIOD:          Sets the period of the search (from 1 to 10, or higher prime     *
*                       periods). Higher composite periods supported incompletely.      *
*                                                                                       *
*     WIDTH:           Sets the width of the search (from 1 to 9).                      *
*                                                                                       *
*                       WARNING: A width-9 search uses slightly over 2 GB. A width-8    *
*                                search uses approximately 270 MB. Width-10 searches    *
*                                are possible in principle, but likely require at least *
*                                17 GB available. Memory usage may be reduced in future *
*                                versions.                                              *
*                                                                                       *
*     MAX_LENGTH:      Sets the maximum length of the search.                           *
*                                                                                       *
*     FULL_PD_BY:      Requires all partials to have their first full-period row by     *
*                       this length.                                                    *
*                                                                                       *
*     MIN_ROTOR_WIDTH: Requires all solutions to have at least this many rows between   *
*                       their first and last full-period rows (inclusive).              *
*                                                                                       *
*     MAX_SOLUTIONS:   After this many solutions have been found, stop search.          *
*                                                                                       *
*     SYMMETRY:        Asymmetric, odd, even, and gutter modes supported.               *
*                                                                                       *
*     SHIFT:           Allows searches for spaceships by offsetting the first           *
*                       generation and last generation by 1 relative to each other.     *
*                                                                                       *
*                                                                                       *
* Known limitations:                                                                    *
*                                                                                       *
*     Full-period testing for composite periods is incomplete.                          *
*                                                                                       *
*     Extremely high memory usage for relatively high widths.                           *
*                                                                                       *
*     Requires a moderate degree of effort and ntzfind-setup.cpp to change the rule.    *
*                                                                                       *
*     Changes to the source code and recompilation are required to change the search    *
*      settings.                                                                        *
*                                                                                       *
*     Much slower than zfind for equivalent periods and widths.                         *
*                                                                                       *
*     Does no stator optimization, and only rudimentary support for eliminating         *
*      duplicate-rotor solutions. Outputs each solution once in each phase.             *
*                                                                                       *
*     This comment box is very difficult to format.                                     *
*                                                                                       *
* By Aidan F. Pierce and whoever else wants to get rid of any of the above limitations  *
*  and/or add new functionality.                                                        *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include <iostream>
#include <string>
//* Get rid of the first / if you've figured out how to accept command-line parameters and autogenerate this part into a file called settings.cpp.
//Don't change things here:
#define SYM false
#define GAP 0
#define NONE 0
#define GUTTER 1
#define ODD 2
#define EVEN 3

//Change things here:
#define PERIOD 4
#define WIDTH 6
#define MAX_LENGTH 100 //Not guaranteed to be exact
#define FULL_PD_BY 1 //Do not set this to zero
#define MIN_ROTOR_WIDTH 0
#define MAX_SOLUTIONS 0x7FFFFFFF
#define SYMMETRY NONE //NONE, GUTTER, ODD, EVEN
//Uncomment this to search for c/PERIOD spaceships instead. Do not use the SYMMETRY option.
//#define SHIFT

//Don't change things here:
//For that matter, don't pay attention to the awful parameter names either.
#if SYMMETRY == GUTTER
#undef SYM //Avoid pointless warning
#define SYM true
#elif SYMMETRY == ODD
#undef GAP //Avoid another pointless warning
#define GAP 2
#elif SYMMETRY == EVEN
#undef GAP //Avoid yet another pointless warning
#define GAP 1
#endif

//Change this if you dare (at least to any rule with B3i and without B2a, B2c, or B1e):             P.S. Don't bother even thinking about B0 or B1c rules.
//Randomly copied from ntzfind (B3/S2-i34q). If you have ntzfind, it's fairly simple to generate one of these for any rule you want.
inline int stepcell(int o, int a, int b, int c, int d, int e, int f, int g, int h){
   return (~o&((0x0)|((a^b^c^d^e^f^g^h)&(((a|b|c|d)&(e|f|g|h))|((a|b|e|f)&(c|d|g|h)))&~(((a|b)&(c|d)&(e|f)&(g|h))|(~((a&b)^(c&d)^(e&f)^(g&h))&((a&b)|(c&d)|(e&f)|(g&h)))))))|(o&((0x0)|(~(a^b^c^d^e^f^g^h)&(a|b|c|d|e|f|g|h)&~(((a|b|c)&(d|e|f)&(g|h))|(a&b&c)|(d&e&f)|((a|b|c)&(d|e|f)&(~(a^b^c)|~(d^e^f)))|(g&h&(a|b|c|d|e|f)))&~(~(b|d|f|h)&~((a^e)|(c^g))))|((a^b^c^d^e^f^g^h)&(((a|b|c|d)&(e|f|g|h))|((a|b|e|f)&(c|d|g|h)))&~(((a|b)&(c|d)&(e|f)&(g|h))|(~((a&b)^(c&d)^(e&f)^(g&h))&((a&b)|(c&d)|(e&f)|(g&h)))))|(0x0|(((~b&~f)&~((~c^~e)|(~a^~g))&(~e^~g)&~(~d|~h))|((~d&~h)&~((~e^~g)|(~a^~c))&(~c^~e)&~(~b|~f))))));
}

//*/#include "settings.cpp"
inline int steprow(int r1, int r2, int r3){
   return stepcell(r2, r1, r1 >> 1 | (((r1 >> (WIDTH-GAP)) & 1) << (WIDTH-1)), r2 >> 1 | (((r2 >> (WIDTH-GAP)) & 1) << (WIDTH-1)), r3 >> 1 | (((r3 >> (WIDTH-GAP)) & 1) << (WIDTH-1)), r3, r3 << 1, r2 << 1, r1 << 1) & ((1 << WIDTH) - 1); //It's magic. Don't ask. So is the last function.
}
//The search state
int rows[MAX_LENGTH][PERIOD];
//Search metadata for lookup in table_of_tables
int rind[MAX_LENGTH][PERIOD];
//Holds counts of possible matching extensions to combinations of rows
int main_table[1<<(WIDTH*3)];
//Holds the extensions themselves
int* table_of_tables[1<<(WIDTH*3)];
#define LMASK 1<<(WIDTH-1)
#define RMASK 1
#define RNULL 1<<WIDTH
void make_tables(){
    long r1, r2, r3, r4, ind;
    int* temp; //Pointless, on second thought, but I don't feel like fixing it now.
    //Initialize counts to 0
   for(long long i = 0; i < 1<<(WIDTH*3); i++){
      main_table[i] = 0;
      table_of_tables[i] = nullptr;
   }
   //Generate counts
   for(long long i = 0; i < 1<<(WIDTH*3); i++){
      r1 = i >> (WIDTH*2); //Top row
      r2 = (i >> WIDTH) & ((1 << WIDTH) - 1); //Middle row
      r3 = i & ((1 << WIDTH) - 1); //Bottom row
      r4 = steprow(r1, r2, r3); //Result
      //Check edge cases:                  !NOTE! This only works in rules with B3i and none of B1e, B2a, and B2c.
      if(!(!GAP && (r1 & r2 & r3 & LMASK)) && !(!SYM && (r1 & r2 & r3 & RMASK))){
         main_table[r1 << (WIDTH*2) | r2 << WIDTH  | r4]++; //Increment extension count for r124 combo
      }
   }
   
   //Do all that again to populate the extension table
   for(long long i = 0; i < 1<<(WIDTH*3); i++){
      r1 = i >> (WIDTH*2); //Top row
      r2 = (i >> WIDTH) & ((1 << WIDTH) - 1); //Middle row
      r3 = i & ((1 << WIDTH) - 1); //Bottom row
      r4 = steprow(r1, r2, r3); //Result
      ind = r1 << (WIDTH*2) | r2 << WIDTH  | r4; //Index in count, extension tables
      //Check edge cases:                  !NOTE! This only works in rules with B3i and none of B1e, B2a, and B2c.
      if(!(!GAP && (r1 & r2 & r3 & LMASK)) && !(!SYM && (r1 & r2 & r3 & RMASK))){
         //Populate table of extensions
         if(table_of_tables[ind] == nullptr){
            table_of_tables[ind] = new int[main_table[ind]+1];//Add 1 for null-terminated array
            table_of_tables[ind][0] = RNULL;
         }
         //Find first unfilled index with SNEAKY POINTER MATH!!!
         //I'm exaggerating; it's not that interesting. It's quite useless, in fact, and less safe than it could be.
         for(temp = table_of_tables[ind]; *temp != RNULL; temp++);
         *temp = r3;
         //Null-terminate it!
         *(temp+1) = RNULL;
      }
   }
}

//Main search subroutines start here.

//Convert a row of Bits inTO a plaintext String
inline std::string btos(int b){
   std::string rtn = "";
   for(int i = 0; i < WIDTH; i++){
      rtn += ((b >> i) & 1) ? 'O' : '.';
   }
   return rtn;
}
//const int subperiods[9][3] = {{1,1,1},{1,1,1},{1,1,2},{1,1,1},{1,2,3},{1,1,1},{1,2,4},{1,1,3},{1,2,5}};
int max_full_pd_length = MAX_LENGTH;
int scount = 0;

//Figure out if it's an exciting, full-periodic, wide-rotor solution or if it's just a boring old still life or something.
bool handle_solution(int length){
   int test = 0, q = 0;
   bool test2 = false;
   
   //Test for first full-periodic row
   for(int i = 0; i < length; i++, q+=!test2){
      test = rows[i][0];
      for(int j = 1; j < PERIOD; j++){
//There MUST be a better way.
#if PERIOD == 4
         if(j != 2) continue;
#endif
#if PERIOD == 6
         if(j != 3) continue;
#endif
#if PERIOD == 8
         if(j != 4) continue;
#endif
#if PERIOD == 9
         if(j != 3) continue;
#endif
#if PERIOD == 10
         if(j != 5) continue;
#endif
         if(rows[i][j] != test){
            test2 = true;
         }
      }
   }
   if(!test2) return false; //If there aren't any, why bother?
   
   //Test for last full-periodic row
   for(int i = length-1; i >= 0; i--){
      test = rows[i][0];
      for(int j = 1; j < PERIOD; j++){
//Here, too.
#if PERIOD == 4
         if(j != 2) continue;
#endif
#if PERIOD == 6
         if(j != 3) continue;
#endif
#if PERIOD == 8
         if(j != 4) continue;
#endif
#if PERIOD == 9
         if(j != 3) continue;
#endif
#if PERIOD == 10
         if(j != 5) continue;
#endif
         if(rows[i][j] != test){
            test2 = false;
            max_full_pd_length = i;
            break;
         }
      }
      if(!test2){
         break;
      }
   }
   
   //Minus 1 for "inclusive".
   if(max_full_pd_length - q < MIN_ROTOR_WIDTH - 1){
      return false;
   }
   
   //Yippee! It's a solution!
   scount++;
   std::cout << "Solution found (#" << scount << "); "
             << "length = " << length-2 << ":" << std::endl; //A patent falsehood, but oh well.
   //Output it in plaintext
   for(int i = 0; i < length; i++){
      for(int j = 0; j < PERIOD; j++){
         std::cout << btos(rows[i][j]) << " ";
      }
      std::cout << "\n";
   }
   std::cout << std::endl;
   return true;
}

//Basically what it says.
inline bool test_full_pd(int length){
   int test = 0;
   bool test2 = false;
   for(int i = 0; i < length; i++){
      test = rows[i][0];
      for(int j = 1; j < PERIOD; j++){
//And here. Did I mention here?
#if PERIOD == 4
         if(j != 2) continue;
#endif
#if PERIOD == 6
         if(j != 3) continue;
#endif
#if PERIOD == 8
         if(j != 4) continue;
#endif
#if PERIOD == 9
         if(j != 3) continue;
#endif
#if PERIOD == 10
         if(j != 5) continue;
#endif
         if(rows[i][j] != test){
            test2 = true;
         }
      }
   }
   return !test2;
}

//Basically what it says.
void output_partial(int length){
   std::cout << "Partial (length = " << length << "):" << "\n";
   for(int i = 0; i < length; i++){
      for(int j = 0; j < PERIOD; j++){
         std::cout << btos(rows[i][j]) << " ";
      }
      std::cout << "\n";
   }
   std::cout << "\n";
}

//Do everything.
int main(){
   int length = 2, phase = 0, max_partial_length = 0;
   long long prev = 0; //Lookup key for the previous two rows, or at least the relevant rowphases within them.
   bool thing = false;
   make_tables();
   //Initialize search space (may or may not be necessary).
   for(int i = 0; i < MAX_LENGTH; i++){
      for(int j = 0; j < PERIOD; j++){
         rows[i][j] = 0;
         rind[i][j] = 0;
      }
   }
   //Main loop
   for(;;){//It's infinite!!!
      //handle_solution(MAX_LENGTH);
      beginning_of_infinite_loop: //This irritating language doesn't allow continues for outer loops
      //std::cout << "Q";
      //std::cout << length << " " << phase << "\n";
      if(length > 8+max_partial_length){//If search has advanced significantly
         output_partial(length);//I guess I'll comment this
         //std::cout << length;
         max_partial_length = length;//Reset expectations
      }//endif
      if(length < max_partial_length-16){//If search has shortened significantly
         max_partial_length = length;//Reset expectations
      }//endif
      if(length < 2) break; //Search complete
      rind[length][phase]++; //Advance
#ifdef SHIFT //If we're searching for spaceships
      if(phase == 1 && rows[length][0] & 1){//If there's a cell out of range, trim search to avoid segfaults
         phase--; //Backtrack in time
         if(phase < 0){ //If this is impossible
            length--; //Backtrack in space
            phase = PERIOD-1; //Return to the end of time
         } //Endif
         continue; //Nothing more to do here
      } //Endif
      prev = (rows[length-2][phase] << (2*WIDTH)) + (rows[length-1][phase] << WIDTH) + (rows[length-1][(phase+1)%PERIOD] >> (phase == PERIOD-1)); //Store lookup key
#else //If not
      prev = (rows[length-2][phase] << (2*WIDTH)) + (rows[length-1][phase] << WIDTH) + rows[length-1][(phase+1)%PERIOD]; //Store lookup key
#endif //Endelse
      //std::cout << rind[length][phase] << " " << main_table[prev] << "\n";
      if(rind[length][phase] >= main_table[prev] || length > MAX_LENGTH-2 || ((length == FULL_PD_BY + 2) && test_full_pd(length))){ //If options exhausted for current rowphase, or search otherwise needs to be pruned
         phase--; //Backtrack in time
         if(phase < 0){ //If this is impossible
            length--; //Backtrack in space
            phase = PERIOD-1; //Return to the end of time
         } //Endif
         continue; //Nothing more to do here
      } //Endif
      //std::cout << "R";
      rows[length][phase] = table_of_tables[prev][rind[length][phase]]; //Advance the current rowphase to the next option
      phase++; //Time moves forwards unless otherwise noted (above or below)
      if(phase == PERIOD){ //The universe has already ended
         length++; //Advance in space
         phase = 0; //Reset to beginning of time
         rind[length][phase] = -1; //Be sneaky and account for the annoying increment at the beginning of the loop
         if(length == MAX_LENGTH) break; //Sanity check: somehow our check above for MAX_LENGTH being approached failed, so we better quit so as not to segfault.
      } else { //TMC: Too Many Comments
         rind[length][phase] = -1; //Be sneaky and account for the annoying increment at the beginning of the loop
         continue; //Help with solution handling at beginning of search
      } //Endelse
      for(int i = 0; i < PERIOD; i++){ //Iterate over all generations of the previous two rows
         //std::cout << rows[length-1][phase] << " " << rows[length-2][phase] << "\n";
         if(rows[length-1][i] || rows[length-2][i]){ //If they're non-empty
            goto beginning_of_infinite_loop; //Never mind, not a solution; nothing to see here, move along
         } //Endif
      } //Endfor
      //Yay, it works!
      //std::cout << length << " ";
      thing = handle_solution(length); //They dissolve quite well, actually (at least in sulfuric acid)
      if(scount > MAX_SOLUTIONS) break; //TMS: Too Many Solutions
      //std::cout << length << " ";
      if(!thing) output_partial(length); //If it is, in fact, nothing, output it anyways, but no false advertising it as a solution
      length = ((max_full_pd_length!=MAX_LENGTH) ? max_full_pd_length : (length-2)); //Skips a few things, but oh well.
      //std::cout << length << " " << max_full_pd_length;
      phase = PERIOD-1; //Return to the end of time again
   }//End the infinite loop
   std::cout << "Search complete: " << scount << " solution" << (scount == 1 ? "" : "s") << " found.";
   /*
   for(int i = 0; i < 1 << (WIDTH*3); i++){
      std::cout << "\n" << i << "\n" << main_table[i] << "\n";
      for(int j = 0; j < main_table[i]; j++){
         std::cout << table_of_tables[i][j] << "\n";
      }
   }//*/
   
   std::cout << std::endl; //Just because.
   return 0;
}

If anyone has any comments, questions, suggestions, or improvements, feel free to reply and/or post modified versions of my code.

Currently configured for tlife. To configure for B3/S23, replace lines 95-97 with the following:
int stepcell(int o, int a, int b, int c, int d, int e, int f, int g, int h){
   return (~o&((0x0)|((a^b^c^d^e^f^g^h)&(((a|b|c|d)&(e|f|g|h))|((a|b|e|f)&(c|d|g|h)))&~(((a|b)&(c|d)&(e|f)&(g|h))|(~((a&b)^(c&d)^(e&f)^(g&h))&((a&b)|(c&d)|(e&f)|(g&h)))))))|(o&((0x0)|(~(a^b^c^d^e^f^g^h)&(a|b|c|d|e|f|g|h)&~(((a|b|c)&(d|e|f)&(g|h))|(a&b&c)|(d&e&f)|((a|b|c)&(d|e|f)&(~(a^b^c)|~(d^e^f)))|(g&h&(a|b|c|d|e|f))))|((a^b^c^d^e^f^g^h)&(((a|b|c|d)&(e|f|g|h))|((a|b|e|f)&(c|d|g|h)))&~(((a|b)&(c|d)&(e|f)&(g|h))|(~((a&b)^(c&d)^(e&f)^(g&h))&((a&b)|(c&d)|(e&f)|(g&h)))))));
}


EDIT: The comment box is formatted with spaces at the beginnings of lines, but the [code] tags remove them. If the current formatting bothers anyone, just press the quote button and copy the original.
x₁=ηx
V ⃰_η=c²√(Λη)
K=(Λu²)/2
Pₐ=1−1/(∫^∞_t₀(p(t)ˡ⁽ᵗ⁾)dt)

$$x_1=\eta x$$
$$V^*_\eta=c^2\sqrt{\Lambda\eta}$$
$$K=\frac{\Lambda u^2}2$$
$$P_a=1-\frac1{\int^\infty_{t_0}p(t)^{l(t)}dt}$$

http://conwaylife.com/wiki/A_for_all

Aidan F. Pierce
User avatar
A for awesome
 
Posts: 1693
Joined: September 13th, 2014, 5:36 pm
Location: 0x-1

Re: Preliminary attempt at a zfind-like oscillator searcher

Postby wildmyron » May 30th, 2017, 5:47 am

I haven't had a look at the program yet, but based on what I presume are results from this program in the tlife thread I'm going to say: Nice work! :)
wildmyron
 
Posts: 926
Joined: August 9th, 2013, 12:45 am

Re: Preliminary attempt at a zfind-like oscillator searcher

Postby A for awesome » May 30th, 2017, 9:17 am

wildmyron wrote:I haven't had a look at the program yet, but based on what I presume are results from this program in the tlife thread I'm going to say: Nice work! :)

Thank you very much! I will say it's not very user-friendly yet...

Anyway, a few Life results:
x = 350, y = 29, rule = B3/S23
133b3o195bob2o9bob2o$15b2o96bo10b3o10bo191b2o4bo6b2o4bo$16b2o13bo32b3o
7bobo36bo11b2o5bo4bo20bo11b3obo10b3obo13bobo9b3o10b3o10b3o10bo52bob2o
7bo2bo9bo12bo$2o14b2o13bo41bo3bo20b2o13bo10b2o6bo3bo9b3o8bob2o12bobo
12bobo11bo3bo6bo18bo6bo14bo13bo11bo24b2o4bo6bobob2o7bob3o8bob3o$bob2o
12bo13b2o34bo6bo3bo5b2o3bo8bo4b2o7b2o10bob2o5bo16b2o5bo3b2o11bo14bo13b
o3bo5bo4bo8bo4bo6b2o13bo13bo10bob2o11b3o10bo10bo3b2o$4b3o8bo30b3o27b2o
6bobo3bo9b2obo20bo8bo2bo10bob3o4b2obo12bo15bo16b2o7bo2bobo7bo3bo10bobo
9b2o12bo10bo27bob3o10bo10bo12bo$2bo4bo7bo3bo11bo2bo29b2obo22bo8b2o8b2o
3bo9b3o7b3o10bo3bo7bo2bo10b4o9bo31bo9bo10b5obo22bo9b2o2bobo8bo25b2o10b
2o2bo8b2o2bo$6b2o8bobobo10bobo15bob2o9b3o2bo7bo9b2obo9bo3bo6bo11bo11bo
25bobo14bo9b2o16bo12bo10bo2bo6bo6bo7bo3b2o10b2o11b2obo7bo3b2o10bo20bo
5bo6bo4bo$2bobobo12bo15bo13bobo10bobobo8bo8bob2o10bo4bo6b4o7b5o9b4o6b
3obo21bobobo11b2o13bobo10b3o8bob4o7b3obob2o11bo7bo4b2o5b2obob2o9bobobo
8b2o10b3o9b3obo7bo3bo$b2o3b2o12bo9bob3ob2o9bo3bo9b3o2b2o6b2obo6b2o2bo
10b5o30b2o3bo9bo10bobo7bob2ob2o11b3o10bo3b2o19b2o13b2obo9b4o8bo3bo8bob
o10bobobo9bo11bo26bo$b2o3b2o12bo9bo3bo11bob2obob2o9bo12b2o9b3o21b3o6b
2o3bo6bo3bobo5bo4b2o11bo6bobobo11bo4bo9b2o3bo22bo14bo21bo4bo7bo11bobob
2o8bob2ob2o6bobo8b4o12bobo$2bobo12bo3bo9b2obobo9bo5bobo8bo10bo9b4o3bo
9bo9bo10bo2bobo4bobo2b2o7b2obo12b2o5b2obobo13bob2o12b2o9b3o8b3obo13b2o
7b3o11bo3bo8b3obo6bo5b2o6bo6bo16bo$17b4o11bob2o11b5o10b2o10b2o8bo2bo2b
2o8bobo9bo2bo4bo4bobo4bobo35bob2o10bobo13bob2o13bo8bo2bo26bo8b2o4bo11b
2o7b5o2bo6bobobobo6bobo8bo2bo12bobo$2bo2bo24bo3bo14bo23b2o26bo11bobo4b
2o4bo6bo36bo13b2o14b2obo13bo9b2o24bob2o10b2o11b2o12bo3b2o7b2ob2o8b2o9b
obo15bo$3bobo11b2o11b2o2bobo23bobo10b3o38bo54b2o45bobo32bobobo13bo10bo
51bo15b2o$4bo12b2o16b2o23b2o155bo33b2o2bo13bo11bo$255b2o12bo10b2o$185b
3obo79bo$188bobo$189bo$188bo$186bo$186b2o2b2o$187b2o2bo$188b3o$186bo$
188bo$184bobo$184b2o!

Just a bunch of relatively small p3s that may or may not be known. The smallest ones probably are. My favorite is the nearly-statorless p3 about four-fifths of the way to the right.
x₁=ηx
V ⃰_η=c²√(Λη)
K=(Λu²)/2
Pₐ=1−1/(∫^∞_t₀(p(t)ˡ⁽ᵗ⁾)dt)

$$x_1=\eta x$$
$$V^*_\eta=c^2\sqrt{\Lambda\eta}$$
$$K=\frac{\Lambda u^2}2$$
$$P_a=1-\frac1{\int^\infty_{t_0}p(t)^{l(t)}dt}$$

http://conwaylife.com/wiki/A_for_all

Aidan F. Pierce
User avatar
A for awesome
 
Posts: 1693
Joined: September 13th, 2014, 5:36 pm
Location: 0x-1

Re: Preliminary attempt at a zfind-like oscillator searcher

Postby Saka » June 19th, 2017, 11:56 pm

I need help compiling:
osrc.cpp: In function ‘void make_tables()’:
osrc.cpp:120:28: error: ‘nullptr’ was not declared in this scope
       table_of_tables[i] = nullptr;
                            ^
osrc.cpp:144:37: error: ‘nullptr’ was not declared in this scope
          if(table_of_tables[ind] == nullptr){
                                     ^
If you're the person that uploaded to Sakagolue illegally, please PM me.
x = 17, y = 10, rule = B3/S23
b2ob2obo5b2o$11b4obo$2bob3o2bo2b3o$bo3b2o4b2o$o2bo2bob2o3b4o$bob2obo5b
o2b2o$2b2o4bobo2b3o$bo3b5ob2obobo$2bo5bob2o$4bob2o2bobobo!

(Check gen 2)
User avatar
Saka
 
Posts: 2728
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

Re: Preliminary attempt at a zfind-like oscillator searcher

Postby Sokwe » June 20th, 2017, 1:47 am

Saka wrote:I need help compiling

I googled this error and this was the first result. It seems that you are not compiling with the C++11 standard. Try compiling with either the flag -std=c++0x or the flag -std=c++11. If that doesn't work, try replacing each instance of "nullptr" in the code with "0".
-Matthias Merzenich
Sokwe
Moderator
 
Posts: 1384
Joined: July 9th, 2009, 2:44 pm


Return to Scripts

Who is online

Users browsing this forum: No registered users and 1 guest