55 if ((carrying != 0) &&
106 if (graph[index].friend_foe>1) graph[index].
friend_foe-=2;
119 if (carrying & INVENTORY_BRANCH)
127 if (carrying & INVENTORY_ROCK)
172 if (graph[index].friend_foe<255) graph[index].
friend_foe++;
176 if (graph[index].friend_foe>0) graph[index].
friend_foe--;
201 if (carrying & INVENTORY_BRANCH)
233 (carrying2 & INVENTORY_SPEAR))
236 n_vect2 location_vector,facing_vector,slope_vector;
248 if (carrying & INVENTORY_SPEAR)
272 if ((carrying & INVENTORY_ROCK) && (carrying2 & INVENTORY_ROCK))
278 if (((carrying & INVENTORY_ROCK) && (carrying2 &
INVENTORY_NUT)) ||
279 ((carrying & INVENTORY_NUT) && (carrying2 & INVENTORY_ROCK)))
282 if (carrying & INVENTORY_NUT)
294 ((carrying & INVENTORY_SCRAPER) && (carrying2 & INVENTORY_BRANCH)))
297 if (carrying & INVENTORY_BRANCH)
308 if (((carrying & INVENTORY_BRANCH) && (carrying2 & INVENTORY_NUT)) ||
309 ((carrying & INVENTORY_NUT) && (carrying2 & INVENTORY_BRANCH)))
312 if (carrying & INVENTORY_NUT)
345 if ((carrying & INVENTORY_GRASS) ||
346 (carrying & INVENTORY_TWIG) ||
347 (carrying & INVENTORY_FISH) ||
348 (carrying & INVENTORY_BIRD_EGGS) ||
349 (carrying & INVENTORY_LIZARD_EGGS) ||
350 (carrying & INVENTORY_NUT_CRACKED))
358 if (carrying & INVENTORY_GRASS)
366 if (carrying & INVENTORY_FISH)
374 if (carrying & INVENTORY_NUT_CRACKED)
382 if (carrying & INVENTORY_BIRD_EGGS)
390 if (carrying & INVENTORY_LIZARD_EGGS)
464 n_vect2 location_vector,facing_vector,slope_vector;
475 n_int grass, trees, bush;
479 if ((grass>bush) && (grass>trees))
484 if ((trees>grass) && (trees>bush))
497 if ((bush>grass) && (bush>trees))
540 body_action_jab(sim, local, carrying, hand);
543 body_action_bash_objects(sim, local, carrying, hand);
546 body_action_chew(sim, local, carrying, hand);
549 body_action_hand_object(sim, local, carrying, hand,
EVENT_BRANDISH);
552 body_action_hand_object(sim, local, carrying, hand,
EVENT_DRAG);
555 body_action_swap_hands(sim, local, carrying, hand);
558 body_action_drop(sim, local, carrying, hand);
561 body_action_pickup(sim, local, carrying, hand);
596 body_action_bash(sim, local, other, carrying);
599 body_action_give(sim, local, other, carrying);
617 if (genetics_a[loop] != genetics_b[loop])
636 genetics_a[loop] = genetics_b[loop];
650 genetics_a[loop] = 0;
668 while (loop < number)
692 n_int child_gene = 0;
698 switch(mutation_type)
762 n_int deletion_point = 16;
775 point = point2 = crossover_point - 8;
779 if (loop == deletion_point) point2 -= 2;
788 if (point2 > 15) point2 -= 16;
803 result |= ( genetics_child_gene(parent, point2, prob, local) << point );
822 n_int deletion_point = 16;
834 if (loop == deletion_point)
842 if (point > 15) point -= 16;
869 n_byte source_offset = (local_random0>>8)&31;
870 n_byte dest_offset = local_random1&31;
872 n_byte inversion = (local_random0>>13) & 1;
875 n_int ctr1 = source_offset;
886 ctr2=(
n_int)(dest_offset+p);
891 ctr2=(
n_int)dest_offset-p+32;
895 if ((genetics[dest_ch] & (1<<ctr2)) != 0)
897 genetics[dest_ch] ^= (1 << ctr2);
900 if ((genetics[source_ch] & (1<<ctr1)) != 0)
902 genetics[dest_ch] |= (1 << ctr2);
926 genetics[ch] = genetics_crossover(mother_genetics[ch], father_genetics[ch], local);
940 genetics_transpose(genetics, local);
945 while (genetics_unique(beings, number, genetics) == 0);
959 n_byte nucleotide[] = {
'A',
'T',
'C',
'G' };
967 while (gene_point < 16)
979 genome_str[string_point++] = nucleotide[value];
983 genome_str[string_point] = 0;