ApeScript

ApeScript is an interpreted procedural dynamic-typed language. It was developed for the Noble Ape Simulation through mid-2005 by Tom Barbalet. ApeScript was designed with the following specifications;

  • simple language,
  • stable memory footprint,
  • minimal crashes, and,
  • small code size.

ApeScript is defined in the Noble Ape Simulation manual.

Additional ApeScript tutorials are on the Noble Ape site.

Example

Some example ApeScript from the tutorials includes;

function ( actual_one ){
   run ( actual_two );
   number_a = number_a + 26;
}

function ( actual_two ){
   number_a = number_b * 234;
}

function ( actual_three ){
   number_a = number_b - 10;
   number_a = number_a * 21;
   number_a = number_a + 127;
}

function ( actual_four ){
   run ( actual_one);
   number_a = number_a * 20;
}

function ( direct_one ){ run ( actual_one ); }
function ( direct_two ){ run ( actual_two ); }
function ( direct_three ){ run ( actual_three ); }
function ( direct_four ){ run ( actual_four ); }

function ( being ){

   number_b = time;

   which_function = time & 3;
   offset_function = direct_two - direct_one;
   which_function = which_function * offset_function;
   which_function = which_function + direct_one;

   run( which_function );
   number_result = number_a;
}

Debug

ApeScript also has the option of debug output. This shows the values and the variables in a single cycle run of ApeScript. The above example produced the following debug output;

function( being ){
   number_b = 942 ;
   which_function = 2 ;
   offset_function = 15 ;
   which_function = 30 ;
   which_function = 151 ;
   run( which_function ){
      run( actual_three ){
         number_a = 932 ;
         number_a = 19572 ;
         number_a = 19699 ;
         }
      }
      number_result = 19699 ;
   }

Through the latter part of 2005, Tom Barbalet continued to develop ApeScript as modular code that could be removed and easily ported to other applications.

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.