Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Прочее";
Текущий архив: 2006.10.22;
Скачать: [xml.tar.bz2];

Вниз

Глюки...   Найти похожие ветки 

 
MaRVeL   (2006-10-03 22:49) [0]

function doit(y,x:integer):boolean;
var i:integer;
good:boolean;
begin
doit:=false;
good:=false;
for i:=1 to 8 do
begin
if ((x+xs[i])<=m)and((y+ys[i])<=n)
and ((x+xs[i])>0)and((y+ys[i])>0)
and ((a[(y+ys[i]),(x+xs[i])]=".")or((a[(y+ys[i]),(x+xs[i])]="s")))
and (a[(y+ys[i]),(x+xs[i])]<>"+")
and ((m*(y+ys[i]-1)+(x+xs[i])-1) in b)
 then
  begin
   q:=false;
   if (i>0)and(i<3)
    then
     begin
      if (a[y-1,x]<>"*")and(a[y-2,x]<>"*")
       then
        q:=true;
      if (a[y,x+xs[i]]<>"*")and(a[y-1,x+xs[i]]<>"*")
       then
        q:=true;
     end
      else
       if (i>2)and(i<5)
        then
         begin
          if (a[y,x+1]<>"*")and(a[y,x+2]<>"*")
           then
            q:=true;
          if (a[y+ys[i],x]<>"*")and(a[y+ys[i],x+1]<>"*")
           then
            q:=true;
         end
          else
           if (i>4)and(i<7)
            then
             begin
              if (a[y+1,x]<>"*")and(a[y+2,x]<>"*")
               then
                q:=true;
              if (a[y,x+xs[i]]<>"*")and(a[y+1,x+xs[i]]<>"*")
               then
                q:=true;
             end
              else
               begin
                if (a[y,x-1]<>"*")and(a[y,x-2]<>"*")
                 then
                  q:=true;
                if (a[y+ys[i],x]<>"*")and(a[y+ys[i],x-1]<>"*")
                 then
                  q:=true;
               end;
   if (q=true)
    then
     begin
      x:=x+xs[i];
      y:=y+ys[i];
      inc(l);
      good:=true;
      b:=b-[m*(y-1)+x-1];
      if (a[y,x]="s")
       then
        begin
         doit:=true;
         if l<best
          then
           best:=l;
         doit:=true;
         b:=b+[(n-1)*y+x-1];
         dec(l);
         exit;
        end
         else
          doit(y,x)
     end;
  end;
end;
if good
then
 begin
  b:=b+[m*(y-1)+x-1];
  dec(l);
 end;
end;


 
Alx2 ©   (2006-10-03 22:55) [1]

const Pi=
3.141592653589793238462643383279502884197169399375105820974944592307
81640628620899862803482534211706798214808651328230664709384460955058
22317253594081284811174502841027019385211055596446229489549303819644
28810975665933446128475648233786783165271201909145648566923460348610
45432664821339360726024914127372458700660631558817488152092096282925
40917153643678925903600113305305488204665213841469519415116094330572
70365759591953092186117381932611793105118548074462379962749567351885
7527248912279381830119491298336733624;


 
Loginov Dmitry ©   (2006-10-03 22:58) [2]

И точно глюки...

... у автора


 
Zeqfreed ©   (2006-10-03 23:01) [3]

Это все можно было заменить на

function doit(y,x:integer) : boolean
const
 res : array[0..1] of Boolean = (true, false);
begin
 Result := res[Random(2)];
end;


без потери функциональности.



Страницы: 1 вся ветка

Форум: "Прочее";
Текущий архив: 2006.10.22;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.041 c
15-1159468057
Virgo_Style
2006-09-28 22:27
2006.10.22
ИИ. Каким бы вы хотели его видеть?


15-1159342380
Александр Иванов
2006-09-27 11:33
2006.10.22
Прогрнамка для выбора файлов из VSS


2-1159853469
Mamochka
2006-10-03 09:31
2006.10.22
Ошибка "Invalid floating point operation"


6-1147666748
lka
2006-05-15 08:19
2006.10.22
Обзор компьютеров в домене, GetObject


6-1148482306
LINde
2006-05-24 18:51
2006.10.22
Можна ли перезагрузить комп"ютер в сети?





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский