Description: These changes were previously applied directly to source
Author: David William Richmond Davies-Jones <david@exultantmonkey.co.uk>
Forwarded: no
Last-Update: 2017-08-31

--- achilles-2.orig/energy.cc
+++ achilles-2/energy.cc
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suit
 #include"vector.h"
 #include"defines.h"
 #include<stdio.h>
-#include<iostream.h>
+#include<iostream>
 
 EnergyClass::EnergyClass() :
   food(0),
@@ -89,8 +89,8 @@ double EnergyClass::Regen(double meta) {
 
 bool EnergyClass::EatFood(double f) {
   food+=f;
-  if(f>fcap) f=fcap;
-  if(f<0) f=0;
+  if(food>fcap) food=fcap;
+  if(food<0) food=0;
   return true;
 }
 
--- achilles-2.orig/gene.cc
+++ achilles-2/gene.cc
@@ -24,6 +24,7 @@ using namespace std;
 #include"braininfo.h"
 #include"defines.h"
 #include<stdio.h>
+#include<cstdlib>
 
 GeneClass::GeneClass() { // randomly generate one
   int i;
--- achilles-2.orig/hebbian.cc
+++ achilles-2/hebbian.cc
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suit
 // Hebbian neural network simulator
 // This is a stand-alone class btw :)
 using namespace std;
-#include<iostream.h>
+#include<iostream>
 #include<time.h>
 #include<stdlib.h>
 #include<string.h>
@@ -118,20 +118,20 @@ float NeuralNet::RunNeurode(int n) {
   }
   return sum;
 }
-#define E 2.7182818285
 
 // lc is the Hebbian learning constant
 // alpha is a logistic coefficient.  seems to work best when <0
 
 int NeuralNet::Learn(float lc,float alpha) {
   int i,j;
+  const double E = 2.7182818285;
   for(i=0;i<num_inner;i++) {
     if(i<num_per_layer) {
       for(j=0;j<inner[i].num_inputs;j++)
-	inner[i].weights[j]+=lc*(1/(1+pow(E,-alpha*inner[i].output))-0.5)*(input[inner[i].inputs[j]]-0.5); // Yaeger's model
+	inner[i].weights[j]+=lc*(1/(1+pow(E,double(-alpha*inner[i].output)))-0.5)*(input[inner[i].inputs[j]]-0.5); // Yaeger's model
     } else {
       for(j=0;j<inner[i].num_inputs;j++)
-	inner[i].weights[j]+=lc*(1/(1+pow(E,-alpha*inner[i].output))-0.5)*(inner[i-num_per_layer+inner[i].inputs[j]].output-0.5); // Yaeger's model
+	inner[i].weights[j]+=lc*(1/(1+pow(E,double(-alpha*inner[i].output)))-0.5)*(inner[i-num_per_layer+inner[i].inputs[j]].output-0.5); // Yaeger's model
       
     }
   }
--- achilles-2.orig/license.cc
+++ achilles-2/license.cc
@@ -1,4 +1,5 @@
-#include<iostream.h>
+using namespace std;
+#include<iostream>
 #include"defines.h"
 
 bool ShowLicense() {
--- achilles-2.orig/main.cc
+++ achilles-2/main.cc
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suit
 
 
 using namespace std;
-#include<iostream.h>
+#include<iostream>
 #include<stdio.h>
 #include"universe.h"
 #include<time.h>
--- achilles-2.orig/opengl.cc
+++ achilles-2/opengl.cc
@@ -23,7 +23,7 @@ using namespace std;
 #include<GL/glu.h>
 //#include<SDL/SDL.h>
 #include<math.h>
-#include<iostream.h>
+#include<iostream>
 #include"org.h"
 #include"vector.h"
 #include"gene.h"
--- achilles-2.orig/org.cc
+++ achilles-2/org.cc
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suit
 
 */
 using namespace std;
-#include<iostream.h>
+#include<iostream>
 #include"org.h"
 #include"id.h"
 #include"energy.h"
--- achilles-2.orig/orglist.cc
+++ achilles-2/orglist.cc
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suit
 
 */
 using namespace std;
-#include<iostream.h>
+#include<iostream>
 #include"orglist.h"
 #include"id.h"
 #include"org.h"
--- achilles-2.orig/quicksort.cc
+++ achilles-2/quicksort.cc
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suit
 
 */
 using namespace std;
-#include<iostream.h>
+#include<iostream>
 #include<vector>
 #include"quicksort.h"
 
--- achilles-2.orig/screenshot.cc
+++ achilles-2/screenshot.cc
@@ -85,7 +85,7 @@ bool PNGScreenShot(char *filename) {
   png_write_info(png_ptr, info_ptr);
 
   /* get pointers */
-  row_pointers = (png_byte**) new (png_byte*)[height];
+  row_pointers = (png_byte**) new png_byte*[height];
   for(i = 0; i < height; i++)
     row_pointers[i] = data + (height - i - 1) 
       * 3 * width;
--- achilles-2.orig/universe.cc
+++ achilles-2/universe.cc
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suit
 
 */
 using namespace std;
-#include<iostream.h>
+#include<iostream>
 #include<stdio.h>
 #include<math.h>
 #include"universe.h"
