This is HRadio.m in view mode; [Download] [Up]
#include <macro.h> #include <hex.h> #define rednode 0 #define redphoton 1 #define obsticle 2 #define bluephoton 3 #define bluenode 4 #import "Creature.h" @implementation Rule:Creature { float theta; int i; } #include <hex.m> -init { (theta=(((( (random() % 1000)) / 1000.0) * 3.14159) * 2)); return self; } -step:nextgeneration n:(int *)neighbours g:graveyard { if( (( type==redphoton ) || ( type==bluephoton )) ) { if( ((random() % 20) ==0) ) { DIE;} if( (CANSEE( obsticle ) >( (random() % 3))) ) { if( ((random() % 2) ==0) ) { DIE;} else { (theta=(((( (random() % 1000)) / 1000.0) * 3.14159) * 2)); } } if( 1==1 ) { (i=( ((((theta / ( (2 * 3.14159265))) * 6) + (( (random() % 1000)) * 0.001)) + 1)));} if( 1==1 ) { (i=(i - 1));} if( ((i ==0) || (i ==6)) ) { RIGHT;} if( (i ==1) ) { UPRIGHT;} if( (i ==2) ) { UPLEFT;} if( (i ==3) ) { LEFT;} if( (i ==4) ) { DOWNLEFT;} if( ((i ==5) || (i ==(0 - 1))) ) { DOWNRIGHT;} if( 1==1 ) { ALERT( "1" );} } if( ( type==obsticle ) ) { CENTER;} if( ( type==bluenode ) ) { if( CANSEE( redphoton ) ) { ALERT( "2" );} if( ((random() % 200) ==0) ) { {int _i; for(_i=0;_i<400;_i++) BIRTH( bluephoton ); }} if( 1==1 ) { CENTER;} } if( ( type==rednode ) ) { if( CANSEE( bluephoton ) ) { ALERT( "2" );} if( ((random() % 200) ==0) ) { {int _i; for(_i=0;_i<400;_i++) BIRTH( redphoton ); }} if( 1==1 ) { CENTER;} } if( 1==1 ) { ALERT( "1" ); DIE;} ALERT("Terminal Action not specified"); return self; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.