Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Сообщения за день
 

Вернуться   Форум Flasher.ru > Архив Flasher.ru > Flash > ActionScript

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему  
Старый 07.12.2001, 22:13
Countach вне форума Посмотреть профиль Отправить личное сообщение для Countach Найти все сообщения от Countach
  № 1  
Countach
 
Аватар для Countach

Регистрация: Mar 2001
Адрес: Cyprus, Nicosia
Сообщений: 795
Отправить сообщение для Countach с помощью ICQ
По умолчанию Блин не слишком ли нагружено для флешки?? :(

Есть прога, не законченая, но алгоритм виден
Код:
//##### BANKER'S ALGORITHM SOURCE CODE ##### 

//Declaration of data structures
NoResources=6;
NoProcesses=5;

//total number of resources
AvailI = new Array();
AvailI [NoResources];
AvCons = new Array();
AvCons [4,5,16,2,12,64];

//fill up the array for the number of max resources
MaxI=new Array();
for (i=0; i<NoProcesses; i++) {
MaxI[i]=new Array();
   for (j=0; j<NoResources; j++) {
      MaxI[i][j]=Random(AvailI[j]);
   }
}

//fill up the array with the allocated resources
AllocI=new Array();
for (i=0; i<NoProcesses; i++) {
AllocI[i]=new Array();
   for (j=0; j<NoResources; j++) {
      AllocI[i][j]=Random(Max[j][i]);
   }
}

//fill up the array with how many resources each process may request
NeedI=new Array();
for (i=0; i<NoProcesses; i++) {
NeedI[i]=new Array();
   for (j=0; j<NoResources; j++) {
      NeedI[j][i]=MaxI[j][i]-AllocI[j][i];
   }
}



//Main
AvailI=AvCons; //initialization of available resources in the system

// Request
Row=Random(NoProcesses);
Column=Random(NoResources);
Cell=Random(Need[Row][Column]);
Request=Random(Cell); 

if ((Request<=NeedI[Row][Column]) && (Request<=AvailI[Column])) {
   AvailI[Column]=AvailI[Column]-Request;
   AllocI[Row][Column]=AllocI[Row][Column]+Request;
   NeedI[Row][Column]=NeedI[Row][Column]-Request;
}

Finish = new Array();
Finish [NoResources];
for (i=0; i<NoResources; i++) {
   Finish[i]=false;
}

Status = new Array();
Status [NoProcesses];
for (i=0; i<NoProcesses; i++) {
   Status[i]=false;
}

counter=0;
precounter=0;
repeat
   for (Row=0; Row<NoProcesses; Row++) {
      for (Column=0; Column<NoResources; Column++) {
         if ((NeedI[Row][Column]<=AvailI[Column]) && (Status[Row]==false)) {
            AvailI[Column]+=AllocI[Row][Column];
            Finish[Column]=True;
         }
      }
      Pid=true;
      for(Column=0; Column<NoResources; Column++) {
         if (Finish[Column]==false) {
            Pid=false;
         }
      }
      Status[Row]=Pid;
      if (Pid==true) {
         counter++;
      }
   }
   Pst=true;
   for (Row=0; Row<NoProcesses; Row++) {
      if (Status[Row]==false) {
         Pst=false;
      }
   }
   if Pst==true {
      gotoAndPlay ("SAFE");
   }
   Signal=false;
   if counter>precounter {
      precounter=counter;
      signal=true;
   }
until signal==false;
// You are in the UNSAFE state
Блин просто на флешке не превычно такое видеть, кто-нить еще этим страдал )
__________________
Кто рано встает, тому... спать весь день хочется.

Старый 07.12.2001, 22:44
Countach вне форума Посмотреть профиль Отправить личное сообщение для Countach Найти все сообщения от Countach
  № 2  
Countach
 
Аватар для Countach

Регистрация: Mar 2001
Адрес: Cyprus, Nicosia
Сообщений: 795
Отправить сообщение для Countach с помощью ICQ
Мужики ну хоть скажите стоит такое в С++ перетаскивать? Иль во флешке покатит намана
ЗЫ это не весь скрипт, тока оснавная часть. И не важно что он делает
__________________
Кто рано встает, тому... спать весь день хочется.

Старый 08.12.2001, 20:54
Countach вне форума Посмотреть профиль Отправить личное сообщение для Countach Найти все сообщения от Countach
  № 3  
Countach
 
Аватар для Countach

Регистрация: Mar 2001
Адрес: Cyprus, Nicosia
Сообщений: 795
Отправить сообщение для Countach с помощью ICQ
Ребят что никто совсем такое не делал во флешке, вот поправил ошибки в первой половине проги
она растет и растет, как не будет ли тормозить ???
Код:
//##### BANKER'S ALGORITHM SOURCE CODE #####

// Declaration of data structures
NoResources = 6;
NoProcesses = 5;
// total number of resources
AvailI = new Array(NoResources);
AvCons = new Array(4, 5, 16, 2, 12, 64);
AvailI = AvCons;
// initialization of available resources in the system
// fill up the array for the number of max resources
MaxI = new Array();
for (i=0; i<NoProcesses; i++) {
	MaxI[i] = new Array();
	for (j=0; j<NoResources; j++) {
        temp=AvailI[j];
		MaxI[i][j] = random(temp);
		trace (MaxI[i][j]);
	}
}
separate='----------------------------------';
trace(separate);
// fill up the array with the allocated resources
AllocI = new Array();
for (i=0; i<NoProcesses; i++) {
	AllocI[i] = new Array();
	for (j=0; j<NoResources; j++) {
		AllocateI = MaxI[i][j];
                Allocate = random(AllocateI);
		AllocI[i][j] = Allocate;
		if (Allocate>AvailI[j]) {
	           j--;
		} else if (AvailI[j] == 0) {
	             AllocI[i][j] = 0;
		   } else if (Allocate<=AvailI[j]) {
			AvailI[j] = AvailI[j]-Allocate;
                        trace (AllocI[i][j]);
		     }
	}
}
separate='----------------------------------';
trace(separate);
// fill up the array with how many resources each process may request
NeedI = new Array();
for (i=0; i<NoProcesses; i++) {
	NeedI[i] = new Array();
	for (j=0; j<NoResources; j++) {
		NeedI[i][j] = MaxI[i][j]-AllocI[i][j];
                trace (NeedI[i][j]);
	}
}


//------------end of initialization-------------------


//-------------------request--------------------------


Row=Random(NoProcesses);
Column=Random(NoResources);
Request=Random(Need[Row][Column]); 

if ((Request<=NeedI[Row][Column]) && (Request<=AvailI[Column])) {
   AvailI[Column]=AvailI[Column]-Request;
   AllocI[Row][Column]=AllocI[Row][Column]+Request;
   NeedI[Row][Column]=NeedI[Row][Column]-Request;
}

Finish = new Array();
Finish [NoResources];
for (i=0; i<NoResources; i++) {
   Finish[i]=false;
}

Status = new Array();
Status [NoProcesses];
for (i=0; i<NoProcesses; i++) {
   Status[i]=false;
}

counter=0;
precounter=0;
repeat
   for (Row=0; Row<NoProcesses; Row++) {
      for (Column=0; Column<NoResources; Column++) {
         if ((NeedI[Row][Column]<=AvailI[Column]) && (Status[Row]==false)) {
            AvailI[Column]+=AllocI[Row][Column];
            Finish[Column]=True;
         }
      }
      Pid=true;
      for(Column=0; Column<NoResources; Column++) {
         if (Finish[Column]==false) {
            Pid=false;
         }
      }
      Status[Row]=Pid;
      if (Pid==true) {
         counter++;
      }
   }
   Pst=true;
   for (Row=0; Row<NoProcesses; Row++) {
      if (Status[Row]==false) {
         Pst=false;
      }
   }
   if Pst==true {
      gotoAndPlay ("SAFE");
   }
   Signal=false;
   if counter>precounter {
      precounter=counter;
      signal=true;
   }
until signal==false;
gotoAndPlay ("UNSAFE");
__________________
Кто рано встает, тому... спать весь день хочется.

Старый 09.12.2001, 04:51
nme вне форума Посмотреть профиль Отправить личное сообщение для nme Найти все сообщения от nme
  № 4  
nme

Регистрация: Mar 2001
Адрес: Саров
Сообщений: 112
Отправить сообщение для nme с помощью ICQ
Ну ты даёшь ... Вот как всё сделаешь, расскажешь как это будет работать!
__________________
_____________
Best regards . . .
Домой

Старый 09.12.2001, 07:17
CyberMax вне форума Посмотреть профиль Отправить личное сообщение для CyberMax Найти все сообщения от CyberMax
  № 5  
CyberMax
 
Аватар для CyberMax

Регистрация: Dec 2000
Адрес: Moscow, Russia
Сообщений: 204
Отправить сообщение для CyberMax с помощью ICQ
Дааа... ну ты наворотил ...

А если тормозить будет, то пооптимизируй немного. Если совсем туго будет, то -- FLASM.

Hint : Конструкции вида (n==false), где n -- булева переменная совершенно бессмысленны. Лучше такие конструкции заменить на более прямые типа : (!n)

Или вот такой кусок :
Код:
      Pid=true;
      for(Column=0; Column<NoResources; Column++) {
         if (Finish[Column]==false) {
            Pid=false;
         }
      }
Зачем продолжать крутить цикл после нахождения первого (Finish[Column]==false) ?

Код:
      Pid=true;
      for(Column=0; Column<NoResources; Column++) {
         if (!Finish[Column]) {
            Pid=false;
            break;
         }
      }
Побыстрее в ряде случаев будет.

Ну и всякие

Код:
if (Pst==true) {
      gotoAndPlay ("SAFE");
   }
лучше сразу переписать как :

Код:
if (Pst) {
      gotoAndPlay ("SAFE");
   }
Ты же в реальной жизни не говориш "Если красное яблоко красного цвета то ..."
__________________
Wbr, CyberMax

Старый 09.12.2001, 14:56
Countach вне форума Посмотреть профиль Отправить личное сообщение для Countach Найти все сообщения от Countach
  № 6  
Countach
 
Аватар для Countach

Регистрация: Mar 2001
Адрес: Cyprus, Nicosia
Сообщений: 795
Отправить сообщение для Countach с помощью ICQ
2nme
OK могу тебе исходник прислать, это вообщем простая фишка. Типа эмуляция алгоритма операционок, который отвечает за то, чтобы комп не завис, те не попал в тупик (deadlock). Там как ты заметил два выхода
1. Safe state
2. Unsafe state
В safe ты точно не попадешь в тупик, но для этого надо расчитывать и предсказывать скока каждый процесс в системе может потребовать ресурсов (типа порты, видео память, DMA, ну и так далее). Те прежде чем дать ресурс надо просчитать, если ты даш ресурс процессу, все ли процессы могут завершиться. Те надо найти такую последовательность, чтобы все процессы могли завершиться.

ЗЫ в виндовс ВАЩЕ это так наворочено, что просто понять не смог пока

2CyberMax
Пасиба огромное
Но вот ту часть пока не смотрел и не поправлял, хотя про break не знал, что в флешке есть такая классная вещь как break, continue.

Всем пасиба, на следущей недели закончу покажу
__________________
Кто рано встает, тому... спать весь день хочется.

Старый 10.12.2001, 13:17
Big_J_ вне форума Посмотреть профиль Отправить личное сообщение для Big_J_ Найти все сообщения от Big_J_
  № 7  
Big_J_
 
Аватар для Big_J_

Регистрация: May 2001
Адрес: Ukraine Kiev
Сообщений: 157
Отправить сообщение для Big_J_ с помощью ICQ
Это канечно изврат но кто сказал что изврат это плохо...

а что касается тормазов то алгоритмы флеша просчитывает на ура и тормозит только лиш при обработке изображений ну вот вам к примеру кусок проги для построения графиков работает без тормазов хоть и сдаровенная ...

[code]
// ======== INVISIBILITI COMPONENT ========= //
setProperty (line_graf, _visible, "0");
setProperty (stolb, _visible, "0");
setProperty (line_vert, _visible, "0");
setProperty (zero, _visible, "0");
setProperty (text_var, _visible, "0");
setProperty (line_step, _visible, "0");
setProperty (info_grafic, _visible, "0");
setProperty (box_graf, _visible, "0");
setProperty (step_info, _visible, "0");
setProperty (mashtabing, _visible, "0");
setProperty (graf_stolb, _visible, "0");
setProperty (fon_region, _visible, "0");
setProperty (hr_inf, _visible, "0");
setProperty (mashtab, _visible, "0");
setProperty (clear1, _visible, "0");

for (no_dr=0; no_dr<=15; no_dr++) {
setProperty (eval("video_"+no_dr), _visible, "0");
setProperty (eval("gal"+no_dr), _visible, "0");
}
N_layer = 0;
color1 = 1;
function clear_video (All_X, All_Y) {
N_layer += 1;
cls = "cl" add N_layer;
duplicateMovieClip (clear, cls, N_layer);
setProperty (cls, _x, 0);
setProperty (cls, _y, 0);
setProperty (cls, _xscale, All_X+5);
setProperty (cls, _yscale, All_Y+5);
}
function draw_all () {
for (k=0; k<=N_layer; k++) {
cls = "c" add k;
duplicateMovieClip (clear1, cls, k);
}
N_layer = 0;


// ====== READ ALL VAR ====== //
/* var diapason = 0;
var All_X = Number(instance1.width); // ALL REGION _X_
var All_Y = Number(instance1.height); // ALL REGION _Y_
var x_first_pos = Number(instance1.x_first); // DISTANCE X FROM ZERO
var y_first_pos = Number(instance1.y_first); // DISTANCE Y FROM ZERO
var info_diap_x = 100; // DISTANCE _X_ FOR INFO
var info_diap_y = 30; // DISTANCE _Y_ FOR INFO
n = Number(instance1.array_n); // AMOUNT N
m = Number(instance1.array_m); // AMOUNT M

for (i = 0; i<=m; i++){
var_array[i] = new Array();
menu[i] = eval("_level0.instance1.Zxn"+i)
for (j = 0; j <= n; j++){
var_array[i][j] = Number(eval("instance1."+array_name+i+'t'+j));
}
}
for (dr=0; dr<=m-1; dr++) {
setProperty (eval("video_"+dr), _visible, "1");
setProperty (eval("gal"+dr), _visible, "1");
}

*/
// ===[=== TEST ARRAY ===]=== //
diapason = 0;
All_X = 800;
All_Y = 300;
x_first_pos = 10;
y_first_pos = 10;
n = 13;
m = 10;
result = new Array();
var_array = new Array();
name_array = new Array(name1,name2,name3,name4,name5,name6,name7,name8);

var_array[0] = new Array(10,20,30,10,50,20,15,30,20,20,40,15,20);
var_array[1] = new Array(20,30,30,10,10,20,20,30,25,0, 30,35,15);
var_array[2] = new Array(10,11,12,13,14,15,16,17,18,19,20,21,22);
var_array[3] = new Array(0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10,11,12);
var_array[4] = new Array(10,20,30,40,50,60,70,80,90,10,20,30,40);
var_array[5] = new Array(40,30,20,10,90,80,70,60,50,40,30,20,10);
var_array[6] = new Array(10,15,20,25,30,35,40,45,50,55,60,65,70);
var_array[7] = new Array(70,65,60,55,50,45,40,35,30,25,20,15,10);
var_array[8] = new Array(20,20,10,10,50,50,30,30,20,20,40,40,0 );
var_array[9] = new Array(-60,-60,-70,-70,-80,-80,-90,-90,-50,-50,-40,-40,-30);

menu = new Array(1,2,3,4,5,6,7,8,9,10);


// ====== COLC TEMP ====== //
temp_max = 0;
temp_max = 0;
for (c = 0 ; c <= n ; c++){
s_min = 0;s_max = 0;
for (r = 0 ; r <= m ; r++){
if (menu[r]!= 0){ // <--------- RESULT ARRAY ===== //
result[c] += var_array[r][c];
}
if (temp_max< result[c]){ temp_max = result[c]; }
if (temp_min> result[c]){ temp_min = result[c]; }
if (var_array[r][c]<0){s_min+=var_array[r][c];
if (temp_min >s_min){temp_min = s_min}
}else{s_max+=var_array[r][c];
if (temp_max <s_max){temp_max = s_max}
}
}
}

diapason = temp_max+Math.abs(temp_min);

// COLCULATE LOGO SCALE//
num = 0;
num_x = n;
step_col = 1;
while (num_x>10) {
step_col *= 10;
num_x /= step_col;
num += 1;
}
var_ddd = n;
array_name = instance1.array_name;
// STEP [1] ============[=== DRAW FON ===]====================//
mp = 0;
mx = 0;
mo = 0;
/*for (r=0; r<=15; r++) {
if (eval("_level0.instance1.Zxn"+r) == "1") {
tellTarget (eval("gal"+r)) {
gotoAndStop (2);
}
for (c=1; c<=n; c++) {
temp = var_array[r][c];
if (mp<temp) {
mp = temp;
}
if (mx>temp) {
mx = temp;
}
}
mo = Math.abs(mx);
}
}
diapason = mp+mo;*/ // ALL DIAPASON
// ============ REGION DRAW GRAPHICS ============= //
region_graf_x = All_X-x_first_pos-20; // REGION _X_
region_graf_y = All_Y-y_first_pos-30; // REGION _Y_
x = region_graf_x+x_first_pos+10; // X_INFO
y = y_first_pos; // Y_INFO
// ============ COLCULAT DIAPASON BIDS-OFFERS =========== //
// COLCULATE DELENIYA Y
delenie_y = 10;
zero_koef = z_koef(diapason);
delenie_y = d_y(diapason);

aser = zero_koef+"____"+delenie_y;

// while (all_diap>10) {zero_koef *= 10; all_diap = diapason/zero_koef;}
// if (int(all_diap) == 1) { delenie_y = 2; }
// if (int(all_diap) == 2 or int(all_diap) == 3 or int(all_diap) == 4) {delenie_y = 5; }

mo_num = int(mo/(zero_koef*delenie_y/10))+1;
mp_num = int(mp/(zero_koef*delenie_y/10))+1;
num_grid_y = mo_num+mp_num;
REGION_X = x_first_pos;

Старый 10.12.2001, 13:21
Big_J_ вне форума Посмотреть профиль Отправить личное сообщение для Big_J_ Найти все сообщения от Big_J_
  № 8  
Big_J_
 
Аватар для Big_J_

Регистрация: May 2001
Адрес: Ukraine Kiev
Сообщений: 157
Отправить сообщение для Big_J_ с помощью ICQ
ПРОДОЛЖЕНИЕ

// STEP [1] =============== DRAW FON ======================//
x_step = int(region_graf_x/n);
y_step = int(region_graf_y/num_grid_y);
region_draf_x = int(x_step*n);
region_graf_y = int(y_step*num_grid_y);
draw_pole(n, region_graf_x, region_graf_y, x_first_pos, y_first_pos);
// STEP [2] ===== DRAW VERTIKAL LINE FOR GRID ===== //
draw_vert_logo(n, region_graf_x, region_graf_y, x_first_pos, y_first_pos, REGION_X);
// ===== DRAW MASHTAB ===== //
static_mas = "";
stimul = zero_koef;
while (stimul>100) {static_mas += "'"+'000'; stimul /= 1000;}
x_mst = region_graf_x+x_first_pos+2;
y_mst = 80;
mashtab_(static_mas, x_mst, y_mst);
// ===== DRAW HORISONTAL LINE FOR GRID ===== //
draw_horr(n, zero_koef, num_grid_y, diapason, x_first_pos, y_first_pos, region_graf_y, REGION_Y, delenie_y, stimul, mp_num);
// =--=--= DRAW ZERO LINE =--=--= \\
draw_zero(x_first_pos, y_first_pos, y_step, mp_num, diapason, mo, num_grid_y, region_graf_x);
// === DRAW GRAPHICS === //

graf_number = 0;//
diap_x = 10;//
diap_y = 0;//
x_pos = region_graf_x;//
y_pos = region_graf_y;//
x_masht = x_grid_step;
ten = 10;
y_zerro = y_first_pos+y_step*mp_num;
x_zerro = x_first_pos;
dis_x = All_X-60;
dis_y += 25;
n_steping = 1;
delenie_n = 1;
del_step = 1;
x_masht = x_grid_step;
y_masht = region_graf_y/(delenie_y*num_grid_y*zero_koef/10);
x0 = x_zerro;
ten = 10;
draw_grafik(m, n, x_masht, y_masht, x_zerro, y_zerro, delenie_y, num_grid_y, zero_koef);
setProperty (preloader, _visible, "0");
}
// ===== DRAW POLE ===== //
function draw_grafik (m, n, x_masht, y_masht, x_zerro, y_zerro, delenie_y, num_grid_y, zero_koef) {
for (r=0; r<=m-1; r++) {
name = eval("instance1."+array_name+r+'head');
color = eval("instance1."+array_name+r+'c');
eval("text"+r) = name;
if (menu[r] != 0){
x0 = x_zerro;
y0 = y_zerro;

}
if (eval("instance1."+array_name+"n"+r) == "1") {
vid = Number(eval("instance1."+array_name+r+'0'));
if (vid == 0) {
x0 = x_zerro;
y0 = y_zerro;
for (c=1; c<=n; c++) {
y_pos = var_array[r][c];
if (y_pos*0 != 0) { y_pos = 0; }
// y_masht = region_graf_y/(delenie_y*num_grid_y*zero_koef/10);
x_scale = x_masht;
y_scale = y_pos*y_masht;
gistogr(x0, y0, y_scale, x_scale, color);
x0 += x_masht;
}
}
if (vid == 1) {
x0 = x_zerro;
y0 = y_zerro;
for (c=1; c<=n; c++) {
y_pos = var_array[r][c];
if (y_pos*0 != 0) { y_pos = 0; }
// y_masht = region_graf_y/(delenie_y*num_grid_y*zero_koef/10);
x_scale = x_masht;
y_scale = y_pos*y_masht;
gistogr(x0, y0, y_scale, x_scale, color);
x0 += x_masht;
}
}
if (vid == 2) {
x0 = x_zerro;
y0 = y_zerro;
y_last = 0;
posit_x = 0;
for (c=1; c<=n; c++) {
y_pos = var_array[r][c];
if (y_pos*0 != 0) { y_pos = 0; }
// y_masht = region_graf_y/(delenie_y*num_grid_y*zero_koef/10);
x_scale = x_masht;
y_scale = (y_pos-y_last)*y_masht;
gistogr(x0, y0, y_scale, x_scale, color);
x0 += x_masht;
posit_x++;
y_last = y_pos;
}
}
if (vid == 3) {
x0 = x_zerro;
y0 = y_zerro;
y_last = 0;
posit_x = 0;
for (c=1; c<=n; c++) {
y_pos = var_array[r][c];
if (y_pos*0 != 0) {
y_pos = 0;
}
// y_masht = region_graf_y/(delenie_y*num_grid_y*zero_koef/10);
x_scale = x_masht;
y_scale = y_pos*y_masht;
gistogr(x0, y0, y_scale, x_scale, color);
x0 += x_masht;
posit_x++;
y_last = y_pos;
}
}
} // if
} // for
}
function draw_pole (n, region_graf_x, region_graf_y, x_first_pos, y_first_pos) {
// region_graf_x = int(region_graf_x/n)*n;
x = x_first_pos-2;
y = y_first_pos-2;
diap_x = region_graf_x+4;
diap_y = region_graf_y+4;
n_pos = 5;
draw_fon(x, y, diap_x, diap_y, n_pos);
x = x_first_pos-2;
y = y_first_pos-2;
diap_x = region_graf_x+3;
diap_y = region_graf_y+3;
n_pos = 1;
draw_fon(x, y, diap_x, diap_y, n_pos);
x = x_first_pos-1;
y = y_first_pos-1;
diap_x = region_graf_x+2;
diap_y = region_graf_y+2;
n_pos = 4;
draw_fon(x, y, diap_x, diap_y, n_pos);
x = x_first_pos-1;
y = y_first_pos-1;
diap_x = region_graf_x+1;
diap_y = region_graf_y+1;
n_pos = 2;
draw_fon(x, y, diap_x, diap_y, n_pos);
x = x_first_pos;
y = y_first_pos;
diap_x = region_graf_x;
diap_y = region_graf_y;
n_pos = 3;
draw_fon(x, y, diap_x, diap_y, n_pos);
}
// ===== DRAW FON ===== //
function draw_fon (x, y, diap_x, diap_y, n_pos) {
N_layer += 1;
fon_name = "fon" add N_layer;
duplicateMovieClip (fon_region, fon_name, N_layer);
setProperty (fon_name, _x, x);
setProperty (fon_name, _y, y);
setProperty (fon_name, _xscale, diap_x);
setProperty (fon_name, _yscale, diap_y);
tellTarget (fon_name) { gotoAndStop (n_pos);}
}
// ============== DRAW ALL ===================//
// =--=--= SHOW ALL INFO FOR GRAFIK =--=--= \\
function draw_zero (x_first_pos, y_first_pos, y_step, mp_num, diapason, mo, num_grid_y, region_graf_x) {
y_zerro = y_first_pos+y_step*mp_num;
x_zerro = x_first_pos;
zero_line = int((diapason-mo)/diapason*(num_grid_y-2))+1;
y_zero = zero_line*y_step+y_first_pos;
N_layer += 1;
zerro = "z" add N_layer;
duplicateMovieClip (zero, zerro, N_layer);
setProperty (zerro, _rotation, 90);
setProperty (zerro, _x, x_zerro);
setProperty (zerro, _y, y_zerro);
setProperty (zerro, _yscale, region_graf_x);
}
function mashtab_ (static_mas, x, y) {
eval(mst).mashtab = "";
N_layer += 1;
mst = "ms" add N_layer;
duplicateMovieClip (mashtab, mst, N_layer);
setProperty (SaveButton, _x, x);
setProperty (mst, _x, x);
setProperty (mst, _y, y);
eval(mst).mashtab += '1 : '+1+static_mas;
}
function draw_horr (n, zero_koef, num_grid_y, diapason, x_first_pos, y_first_pos, region_graf_y, REGION_Y, delenie_y, stimul, mp_num) {
// region_graf_x = int(region_graf_x/n)*n;
power_d = zero_koef*num_grid_y;
next_step = diapason/num_grid_y;
REGION_Y = y_first_pos;
show = mp_num*stimul*delenie_y/10;
while (REGION_Y<=region_graf_y+y_first_pos) {
N_layer += 1;
horisontal = "horr" add N_layer;
duplicateMovieClip (line_vert, horisontal, N_layer);
setProperty (horisontal, _rotation, 90);
setProperty (horisontal, _x, x_first_pos);
setProperty (horisontal, _y, REGION_Y);
setProperty (horisontal, _yscale, region_graf_x);
N_layer += 1;
horr_inf = "inf_hor" add N_layer;
duplicateMovieClip (hr_inf, horr_inf, N_layer);
setProperty (horr_inf, _x, x_first_pos-3);
setProperty (horr_inf, _y, REGION_Y);
REGION_Y += y_step;
if (show<0.2 and show>-0.2) { show = 0; }
eval(horr_inf).horr_info = show;
// aser += show+';';
show -= stimul*delenie_y/10;
}
}
function draw_vert_logo (n, region_graf_x, region_graf_y, x_first_pos, y_first_pos, REGION_X) {
x_grid_step = region_graf_x/n;
step_10 = 0;
log_x = 1;
hight_pos = 0;
while (REGION_X<=region_graf_x+x_first_pos) {
N_layer += 1;
vertikal = "vert" add N_layer;
duplicateMovieClip (line_vert, vertikal, N_layer);
setProperty (vertikal, _x, REGION_X);
setProperty (vertikal, _y, y_first_pos+region_graf_y+hight_pos);
setProperty (vertikal, _yscale, region_graf_y+hight_pos);

position_v = step_10;
N_layer += 1;
info = "inf" add N_layer;
duplicateMovieClip (info_grafic, info, N_layer);
setProperty (info, _x, REGION_X);
setProperty (info, _y, y_first_pos+region_graf_y+hight_pos);
if (position_v>0) {
eval(info).information = eval("instance1."+array_name+'x'+position_v);
} else {eval(info).information = "0"; }
step_10 += 1;
REGION_X += x_grid_step;
x_now += 1;
hight_pos += 10;
if (hight_pos == 30) {
hight_pos = 0;
}
}
}
function draw_line (x0, y0, Y, X, color) {
N_layer += 1;
new_name = "line" add N_layer;
duplicateMovieClip (line_graf, new_name, N_layer);
setProperty (new_name, _x, x0);
setProperty (new_name, _y, y0);
setProperty (new_name, _yscale, Y);
setProperty (new_name, _xscale, X);
tellTarget (new_name) {
gotoAndStop (color);
}
}
function draw_step (x0, y0, Y, X, color) {
N_layer += 1;
new_name = "line" add N_layer;
duplicateMovieClip (line_step, new_name, N_layer);
setProperty (new_name, _x, x0);
setProperty (new_name, _y, y0);
setProperty (new_name, _yscale, Y);
setProperty (new_name, _xscale, X);
tellTarget (new_name) {
gotoAndStop (color);
}
}
function gistogr (x0, y0, Y, X, color) {
N_layer += 1;
new_name = "gistogr" add N_layer;
duplicateMovieClip (stolb, new_name, N_layer);
setProperty (new_name, _x, x0);
setProperty (new_name, _y, y0);
setProperty (new_name, _yscale, Y*100);
setProperty (new_name, _xscale, X*100);
tellTarget (new_name) {
gotoAndStop (color);
}
}
function stolbik (x0, y0, Y, X, color) {
N_layer += 1;
new_name = "stolb" add N_layer;
X_delta = X/10;
duplicateMovieClip (stolb, new_name, N_layer);
setProperty (new_name, _x, x0+(2*X_delta));
setProperty (new_name, _y, y0);
setProperty (new_name, _yscale, Y*100);
setProperty (new_name, _xscale, X*60);
tellTarget (new_name) {
gotoAndStop (color);
}
}
function z_koef(d){
z = 1;
all = d;
while(all>10){
z *= 10;
all = d/z;
}
return z;
}
function d_y(d){
all_d = d/z_koef(d);
if (int(all_d)==1){de_y = 2;}
if (int(all_d)==2 or int(all_d)==3 or int(all_d)==4){de_y = 5;}
return de_y;
}
[/code]

Старый 10.12.2001, 17:01
Countach вне форума Посмотреть профиль Отправить личное сообщение для Countach Найти все сообщения от Countach
  № 9  
Countach
 
Аватар для Countach

Регистрация: Mar 2001
Адрес: Cyprus, Nicosia
Сообщений: 795
Отправить сообщение для Countach с помощью ICQ

Наша взяла
__________________
Кто рано встает, тому... спать весь день хочется.

Старый 10.12.2001, 18:57
fmsmith вне форума Посмотреть профиль Отправить личное сообщение для fmsmith Найти все сообщения от fmsmith
  № 10  
fmsmith

Регистрация: Nov 2001
Адрес: и провыплёвывает
Сообщений: 26
По умолчанию ТолстЫе есть?

Парни, "Войну и мир" никто не собирается кодировать?:-)

Создать новую тему   Часовой пояс GMT +4, время: 00:12.
Быстрый переход
  « Предыдущая тема | Следующая тема »  

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 00:12.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.