1: #include "old.h"
   2: 
   3: int *
   4: statl()
   5: {
   6:     int *p1, *p2, *p3;
   7: 
   8:     p1 = p2 = lmp;
   9:     stage();
  10:     mantom? bagen(): wagen();
  11:     if(lmp == p1+1)
  12:         return(p1);
  13:     while(p2 != lmp) {
  14:         p3 = p2++;
  15:         if(mantom) {
  16:             bmove(*p2++);
  17:             *p3 = bstatic(0);
  18:             bremove();
  19:         } else {
  20:             wmove(*p2++);
  21:             *p3 = wstatic(0);
  22:             wremove();
  23:         }
  24:     }
  25:     qsort(p1, lmp);
  26:     return(p1);
  27: }
  28: 
  29: wstatic(f)
  30: {
  31:     int i, j, h, (*p)();
  32: 
  33:     h = i = 0;
  34:     while(p = wheur[h++]) {
  35:         j = (*p)();
  36:         if(f)
  37:             printf("%4d ", j);
  38:         i += j;
  39:     }
  40:     if(f)
  41:         printf("=%4d ", i);
  42:     return(-i);
  43: }
  44: 
  45: bstatic(f)
  46: {
  47:     int i, j, h, (*p)();
  48: 
  49:     h = i = 0;
  50:     while(p = bheur[h++]) {
  51:         j = (*p)();
  52:         if(f)
  53:             printf("%4d ", j);
  54:         i += j;
  55:     }
  56:     if(f)
  57:         printf("=%4d ", i);
  58:     return(-i);
  59: }
  60: 
  61: xheur(ploc)
  62: int ploc;
  63: {
  64:     int *p1, *p2, from, to, pie;
  65: 
  66:     pie = board[ploc];
  67:     p1 = lmp;
  68:     p2 = p1;
  69:     mantom? wgen(): bgen();
  70:     while(p2 != lmp) {
  71:         p2++;
  72:         to = *p2++ & 0377;
  73:         if(to == ploc) {
  74:             from = p2[-1] >> 8;
  75:             if(abs(board[from]) < abs(pie)) {
  76:                 lmp = p1;
  77:                 return((pval+6)[pie]/60);
  78:             }
  79:         }
  80:     }
  81:     lmp = p1;
  82:     return(0);
  83: }
  84: 
  85: srnd(p)
  86: int p;
  87: {
  88: 
  89:     srnd1(p, uleft, -9);
  90:     srnd1(p, uright, -7);
  91:     srnd1(p, dleft, 7);
  92:     srnd1(p, dright, 9);
  93:     srnd1(p, up, -8);
  94:     srnd1(p, left, -1);
  95:     srnd1(p, right, 1);
  96:     srnd1(p, down, 8);
  97:     srnd1(p, 0, 0);
  98: }
  99: 
 100: srnd1(p, m, o)
 101: int p, m, o;
 102: {
 103: 
 104:     if((dir[p]&m) == 0)
 105:         control[p+o] += 10;
 106: }

Defined functions

bstatic defined in line 45; used 2 times
srnd defined in line 85; used 2 times
srnd1 defined in line 100; used 9 times
statl defined in line 3; used 2 times
wstatic defined in line 29; used 2 times
xheur defined in line 61; used 4 times
Last modified: 1994-01-07
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2712
Valid CSS Valid XHTML 1.0 Strict