23 5
11111111111111111111111
11111111111111111111111
12121212121212121212121
10101010101010101010101
11111111111011111111111
0.8 2.15 1.5 2.15 1.5 2.15 1.5 2.15 1.5 2.15
31 Aralık 2010 Cuma
girdi.txt
7 7
1 1 1 1 1 1 1
1 2 1 3 3 3 1
1 2 1 1 1 1 1
1 2 1 5 1 6 1
1 1 1 5 1 6 1
1 4 1 5 1 6 1
1 1 1 1 1 1 1
0.2 3.5 0.2 2.0 0.2 2.0 0.2
0.2 2.0 0.2 2.0 0.2 3.8 0.2
1 1 1 1 1 1 1
1 2 1 3 3 3 1
1 2 1 1 1 1 1
1 2 1 5 1 6 1
1 1 1 5 1 6 1
1 4 1 5 1 6 1
1 1 1 1 1 1 1
0.2 3.5 0.2 2.0 0.2 2.0 0.2
0.2 2.0 0.2 2.0 0.2 3.8 0.2
Processing de fibonacci dizisi
void setup()
{
size(400,400);
noLoop();
}
void draw()
{
float[] fibonacci = new float[40];
fibonacci[0] = 1;
fibonacci[1] = 1;
fibonacci[2] = 2;
for(int i=3 ; i<40 ; i++)
{
fibonacci[i] = fibonacci[i-1] + fibonacci[i-2];
}
println(fibonacci);
}
{
size(400,400);
noLoop();
}
void draw()
{
float[] fibonacci = new float[40];
fibonacci[0] = 1;
fibonacci[1] = 1;
fibonacci[2] = 2;
for(int i=3 ; i<40 ; i++)
{
fibonacci[i] = fibonacci[i-1] + fibonacci[i-2];
}
println(fibonacci);
}
Processing: diziler elips çizme
void setup()
{
size(400,400);
noLoop();
}
void draw()
{
int X1, Y1, X2, Y2;
int Xartis, Yartis;
X1=50; Y1=50;
X2=300; Y2=400;
int[] Xler = new int [10];
int[] Yler = new int [10];
//Xler =array[1,,10] of INTEGER;
ellipse (X1, Y1, 5,5);
ellipse (X2, Y2, 15,15);
Xartis = (abs (X2 - X1)) / 10;
Yartis = (abs (Y2 - Y1)) / 10;
for (int i =0; i < 10; i++)
{
Xler[i] = X1 + Xartis * i;
Yler[i] = Y1 + Yartis * i;
}
for (int k =0; k < 10; k++)
{
ellipse ( Xler[k], Yler[k], 5*k, 5*(k+5));
}
}
{
size(400,400);
noLoop();
}
void draw()
{
int X1, Y1, X2, Y2;
int Xartis, Yartis;
X1=50; Y1=50;
X2=300; Y2=400;
int[] Xler = new int [10];
int[] Yler = new int [10];
//Xler =array[1,,10] of INTEGER;
ellipse (X1, Y1, 5,5);
ellipse (X2, Y2, 15,15);
Xartis = (abs (X2 - X1)) / 10;
Yartis = (abs (Y2 - Y1)) / 10;
for (int i =0; i < 10; i++)
{
Xler[i] = X1 + Xartis * i;
Yler[i] = Y1 + Yartis * i;
}
for (int k =0; k < 10; k++)
{
ellipse ( Xler[k], Yler[k], 5*k, 5*(k+5));
}
}
Processing: diziler
void setup()
{
size (400,400);
noLoop();
}
void draw()
{
int[] sayilar= {432, 322, 345, 654, 4535};
for (int j = 0; j < 4; j++)
{
for ( int i= 0;i < 4-j; i= i+1)
{
if (sayilar[i] < sayilar[i+1])
{
int temp = sayilar[i];
sayilar[i] = sayilar[i+1];
sayilar[i+1] = temp;
}
}
}
for ( int i= 0; i < 5 ; i++)
{
println(sayilar[i]);
}
}
{
size (400,400);
noLoop();
}
void draw()
{
int[] sayilar= {432, 322, 345, 654, 4535};
for (int j = 0; j < 4; j++)
{
for ( int i= 0;i < 4-j; i= i+1)
{
if (sayilar[i] < sayilar[i+1])
{
int temp = sayilar[i];
sayilar[i] = sayilar[i+1];
sayilar[i+1] = temp;
}
}
}
for ( int i= 0; i < 5 ; i++)
{
println(sayilar[i]);
}
}
Processing-Dizi sayı yazdırma
void setup()
{
size(400,400);
noLoop();
}
void draw()
{
int[] sayilar = { 432, 322, 345,654,4535 };
for (int i=0; i < 5; i++)
//i=i + 1
{
println(sayilar[i]);
}
}
{
size(400,400);
noLoop();
}
void draw()
{
int[] sayilar = { 432, 322, 345,654,4535 };
for (int i=0; i < 5; i++)
//i=i + 1
{
println(sayilar[i]);
}
}
Processing: draw shape..
void setup()
{
size (400,400);
}
void draw()
{
beginShape();
if (mouseX < width/2)
{
vertex(mouseX, mouseY+20);
vertex(mouseX, 20);
}
else
{
vertex(mouseX/2, mouseY+20/2);
vertex(mouseX/2, 20);
}
vertex(40, 40);
vertex(60, 40);
vertex(60, 60);
vertex(20, 60);
endShape(CLOSE);
}
{
size (400,400);
}
void draw()
{
beginShape();
if (mouseX < width/2)
{
vertex(mouseX, mouseY+20);
vertex(mouseX, 20);
}
else
{
vertex(mouseX/2, mouseY+20/2);
vertex(mouseX/2, 20);
}
vertex(40, 40);
vertex(60, 40);
vertex(60, 60);
vertex(20, 60);
endShape(CLOSE);
}
24 Aralık 2010 Cuma
MARIO AMCA
PROGRAM MARIOVERI ;
VAR i, j, k, t, ls, js, T1, T2, T3, T4, T5 : INTEGER;
mario : ARRAY [ 1..20, 1..20] of INTEGER;
veri, marioson : text;
BEGIN
ASSIGN(veri, 'C:\mario.txt');
RESET(veri);
ASSIGN (marioson, 'C:\mariosonuc.txt');
REWRITE(marioson);
FOR k:= 1 TO 20 DO
FOR t :=1 TO 20 DO
BEGIN
mario[k][t] := 0;
END;
READ(veri, js, ls);
FOR i:= 1 TO ls DO
BEGIN
FOR j:= 1 TO js DO
BEGIN
READ ( veri, mario[i][j]);
WRITE ( marioson, mario[i][j]);
END;
READLN(veri);
WRITELN(marioson);
END;
T1 := 0; T2 :=0; T3:=0; T4:=0; T5:=0;
FOR i := 1 TO ls DO
BEGIN
FOR j := 1 TO js DO
BEGIN
CASE mario[i][j] OF
1: T1 := T1+1;
2: T2 := T2+1;
3: T3 := T3+1;
4: T4 := T4+1;
5: T5 := T5+1;
END;
END;
END;
WRITELN (marioson,'Kac kere 1 kullanilmis:', T1:8);
WRITELN (marioson,'Kac kere 2 kullanilmis:', T2:8);
WRITELN (marioson,'Kac kere 3 kullanilmis:', T3:8);
WRITELN (marioson,'Kac kere 4 kullanilmis:', T4:8);
WRITELN (marioson,'Kac kere 5 kullanilmis:', T5:8);
CLOSE (marioson);
READLN;
END.
VAR i, j, k, t, ls, js, T1, T2, T3, T4, T5 : INTEGER;
mario : ARRAY [ 1..20, 1..20] of INTEGER;
veri, marioson : text;
BEGIN
ASSIGN(veri, 'C:\mario.txt');
RESET(veri);
ASSIGN (marioson, 'C:\mariosonuc.txt');
REWRITE(marioson);
FOR k:= 1 TO 20 DO
FOR t :=1 TO 20 DO
BEGIN
mario[k][t] := 0;
END;
READ(veri, js, ls);
FOR i:= 1 TO ls DO
BEGIN
FOR j:= 1 TO js DO
BEGIN
READ ( veri, mario[i][j]);
WRITE ( marioson, mario[i][j]);
END;
READLN(veri);
WRITELN(marioson);
END;
T1 := 0; T2 :=0; T3:=0; T4:=0; T5:=0;
FOR i := 1 TO ls DO
BEGIN
FOR j := 1 TO js DO
BEGIN
CASE mario[i][j] OF
1: T1 := T1+1;
2: T2 := T2+1;
3: T3 := T3+1;
4: T4 := T4+1;
5: T5 := T5+1;
END;
END;
END;
WRITELN (marioson,'Kac kere 1 kullanilmis:', T1:8);
WRITELN (marioson,'Kac kere 2 kullanilmis:', T2:8);
WRITELN (marioson,'Kac kere 3 kullanilmis:', T3:8);
WRITELN (marioson,'Kac kere 4 kullanilmis:', T4:8);
WRITELN (marioson,'Kac kere 5 kullanilmis:', T5:8);
CLOSE (marioson);
READLN;
END.
MARİOMATRİS
PROGRAM MARIOVERI;
VAR i,j,ls,js,k,t : INTEGER;
mario : ARRAY [0..20,0..20] OF INTEGER;
marioson,veri:TEXT;
BEGIN
ASSIGN(veri,'C:/mariotext.txt');
RESET(veri);
ASSIGN (marioson , 'C:/mariosonuc.txt');
REWRITE(marioson);
FOR k:=1 TO 20 DO
FOR t :=1 TO 20 DO
BEGIN
mario[k][t] :=0;
END;
READ(veri, js, ls);
FOR i:=1 TO ls DO
BEGIN
FOR j:=1 TO js DO
BEGIN
READ(veri, mario[i][j]);
WRITE(marioson, mario[i][j]);
END;
READLN(veri);
WRITELN(marioson);
END;
FOR k:=1 TO 20 DO
BEGIN
FOR t :=1 TO 20 DO
BEGIN
WRITE( marioson,mario[k][t], ' ');
END;
WRITELN(marioson);
END;
READ(veri,i,j);
WRITELN(i);
WRITELN(j);
CLOSE(marioson);
READLN;
END.
VAR i,j,ls,js,k,t : INTEGER;
mario : ARRAY [0..20,0..20] OF INTEGER;
marioson,veri:TEXT;
BEGIN
ASSIGN(veri,'C:/mariotext.txt');
RESET(veri);
ASSIGN (marioson , 'C:/mariosonuc.txt');
REWRITE(marioson);
FOR k:=1 TO 20 DO
FOR t :=1 TO 20 DO
BEGIN
mario[k][t] :=0;
END;
READ(veri, js, ls);
FOR i:=1 TO ls DO
BEGIN
FOR j:=1 TO js DO
BEGIN
READ(veri, mario[i][j]);
WRITE(marioson, mario[i][j]);
END;
READLN(veri);
WRITELN(marioson);
END;
FOR k:=1 TO 20 DO
BEGIN
FOR t :=1 TO 20 DO
BEGIN
WRITE( marioson,mario[k][t], ' ');
END;
WRITELN(marioson);
END;
READ(veri,i,j);
WRITELN(i);
WRITELN(j);
CLOSE(marioson);
READLN;
END.
matriste alan hesabı (pascal)
PROGRAM alan;
TYPE kat = array[1..30,1..30] of INTEGER;
VAR m:kat;
Xler : array [1..30] of REAL;
Yler : array [1..30] of REAL;
i,j,ls,js,k,s,p :INTEGER;
t,top,t1,t2,t3,t4,t5,t6 : REAL;
girdi,alanlar : text;
BEGIN
ASSIGN(girdi, 'C:/girdi.txt');
RESET(girdi);
ASSIGN(alanlar, 'C:/alanlar.txt');
REWRITE(alanlar);
READ (girdi,ls,js);
WRITELN(alanlar,'sonuclar' );
WRITELN(alanlar,'matris says:' , ls, ',' , js);
FOR i:=1 TO ls DO
BEGIN
FOR j:=1 TO js DO
BEGIN
READ (girdi,m[i,j]);
WRITE (alanlar,m[i,j],' ');
END;
WRITELN(alanlar);
END;
FOR s:= 1 TO ls DO
BEGIN
READ(girdi , Xler[s]);
END;
READLN(girdi);
FOR k:=1 TO js DO
BEGIN
READ(girdi, Yler[k]);
END;
t1:= 0;
t2:= 0;
t3:= 0;
t4:= 0;
t5:= 0;
t6:= 0;
FOR s:= 1 TO ls DO
BEGIN
FOR i:=1 TO js DO
BEGIN
case m[i, s] of
1: t1 := t1 + Xler[i]*Yler[s];
2: t2 := t2 + Xler[i]*Yler[s];
3: t3 := t3 + Xler[i]*Yler[s];
4: t4 := t4 + Xler[i]*Yler[s];
5: t5 := t5 + Xler[i]*Yler[s];
6: t6 := t6 + Xler[i]*Yler[s];
{WRITELN(alanlar ,(Xler[i] * Yler[s]) : 4:2);}
end;
END;
END;
WRITELN(alanlar, 'Duvar alani=', t1:8:2);
WRITELN(alanlar, '2nolu mekan alani=', t2:8:2);
WRITELN(alanlar, '3nolu mekan alani=', t3:8:2);
WRITELN(alanlar, '4nolu mekan alani=', t4:8:2);
WRITELN(alanlar, '5nolu mekan alani=', t5:8:2);
WRITELN(alanlar, '6nolu mekan alani=', t6:8:2);
WRITELN(alanlar, 'Toplam alan=', (t1+t2+t3+t4+t5+t6):8:2);
CLOSE (alanlar);
READLN;
END.
TYPE kat = array[1..30,1..30] of INTEGER;
VAR m:kat;
Xler : array [1..30] of REAL;
Yler : array [1..30] of REAL;
i,j,ls,js,k,s,p :INTEGER;
t,top,t1,t2,t3,t4,t5,t6 : REAL;
girdi,alanlar : text;
BEGIN
ASSIGN(girdi, 'C:/girdi.txt');
RESET(girdi);
ASSIGN(alanlar, 'C:/alanlar.txt');
REWRITE(alanlar);
READ (girdi,ls,js);
WRITELN(alanlar,'sonuclar' );
WRITELN(alanlar,'matris says:' , ls, ',' , js);
FOR i:=1 TO ls DO
BEGIN
FOR j:=1 TO js DO
BEGIN
READ (girdi,m[i,j]);
WRITE (alanlar,m[i,j],' ');
END;
WRITELN(alanlar);
END;
FOR s:= 1 TO ls DO
BEGIN
READ(girdi , Xler[s]);
END;
READLN(girdi);
FOR k:=1 TO js DO
BEGIN
READ(girdi, Yler[k]);
END;
t1:= 0;
t2:= 0;
t3:= 0;
t4:= 0;
t5:= 0;
t6:= 0;
FOR s:= 1 TO ls DO
BEGIN
FOR i:=1 TO js DO
BEGIN
case m[i, s] of
1: t1 := t1 + Xler[i]*Yler[s];
2: t2 := t2 + Xler[i]*Yler[s];
3: t3 := t3 + Xler[i]*Yler[s];
4: t4 := t4 + Xler[i]*Yler[s];
5: t5 := t5 + Xler[i]*Yler[s];
6: t6 := t6 + Xler[i]*Yler[s];
{WRITELN(alanlar ,(Xler[i] * Yler[s]) : 4:2);}
end;
END;
END;
WRITELN(alanlar, 'Duvar alani=', t1:8:2);
WRITELN(alanlar, '2nolu mekan alani=', t2:8:2);
WRITELN(alanlar, '3nolu mekan alani=', t3:8:2);
WRITELN(alanlar, '4nolu mekan alani=', t4:8:2);
WRITELN(alanlar, '5nolu mekan alani=', t5:8:2);
WRITELN(alanlar, '6nolu mekan alani=', t6:8:2);
WRITELN(alanlar, 'Toplam alan=', (t1+t2+t3+t4+t5+t6):8:2);
CLOSE (alanlar);
READLN;
END.
ALANLAR
PROGRAM alan;
Type kat=array[1..30,1..30] of INTEGER;
VAR m : kat;
Xler : array[1..30] of REAL;
Yler : array[1..30] of REAL;
i,j,ls,js,s,p,k:INTEGER;
t,top,t1,t2,t3,t4,t5,t6 :REAL;
girdi,alanlar :text;
BEGIN
ASSIGN (girdi, 'C:\girdiler.txt');
RESET(girdi);
ASSIGN (alanlar, 'C:\alanlar.txt');
REWRITE(alanlar);
READ (girdi, ls, js);
WRITELN(alanlar, 'sonuclar');
WRITELN (alanlar, 'matris sayisi: ',ls,',',js);
FOR i:=1 to ls DO
BEGIN
FOR j:=1 to js DO
BEGIN
READ (girdi,m[i,j]);
WRITE (alanlar, m[i, j]);
END;
WRITELN (alanlar);
END;
FOR s:=1 TO ls DO
BEGIN
READ(girdi, Xler[s])
END ;
READLN(girdi);
FOR k:= 1 TO js DO
BEGIN
READ (girdi, Yler[k]);
END;
FOR s:=1 TO ls DO
BEGIN
FOR i:=1 TO js DO
BEGIN
WRITELN (alanlar, ( Xler[s] * Yler[i]): 4:2);
END;
END;
{
m[1,1] --> 2 --> 3,5 * 2=7
m[1,2] --> 2 --> 3,5* 0,2=0,7
m[1,3] --> 2 --> 3'5*2=7 }
CLOSE (alanlar);
READLN;
END.
PROGRAM alan;
Type kat=array[1..30,1..30] of INTEGER;
dizi=array[1..30] of REAL;
VAR m : kat;
VAR x,y : dizi;
i,j,ls,js:INTEGER;
t,top,t1,t2,t3,t4,t5,t6 :REAL;
girdi,alanlar :text;
BEGIN
ASSIGN (girdi, 'C:\girdiler.txt');
RESET(girdi);
ASSIGN (alanlar, 'C:\alanlar.txt');
REWRITE(alanlar);
READ (girdi, ls, js);
WRITELN(alanlar, 'sonuclar');
WRITELN (alanlar, 'matris sayisi: ',ls,',',js);
FOR i:=1 to ls DO
BEGIN
FOR j:=1 to js DO
BEGIN
READ (girdi,m[i,j]);
WRITE (alanlar, m[i, j]);
END;
WRITELN (alanlar);
END;
CLOSE (alanlar);
READLN;
END.
17 Aralık 2010 Cuma
matrisle tanim tekniği için text dosyasi..
7 7
1 1 1 1 1 1 1
1 2 1 1 3 3 1
1 2 1 1 1 1 1
1 2 1 5 1 6 1
1 1 1 5 1 6 1
1 4 1 5 1 6 1
1 1 1 1 1 1 1
0.2 3.5 0.2 2.0 0.2 2.0 0.2
0.2 2.0 0.2 2.0 0.2 3.8 0.2
1 1 1 1 1 1 1
1 2 1 1 3 3 1
1 2 1 1 1 1 1
1 2 1 5 1 6 1
1 1 1 5 1 6 1
1 4 1 5 1 6 1
1 1 1 1 1 1 1
0.2 3.5 0.2 2.0 0.2 2.0 0.2
0.2 2.0 0.2 2.0 0.2 3.8 0.2
Prosessing Nokta tanımı ve hareketi
void setup()
{
size(500,500);
background(200,225,0,100);
//noLoop();
}
void draw()
{
background(200,255,0,100);
int X1,Y1,X2,Y2;
int uzunluk;
int tekrar;
int yukseklik;
X1=0;
X2=mouseX;
Y1=0;
Y2=mouseY;
tekrar=15;
uzunluk=abs(X1-X2);
yukseklik=abs(Y1-Y2);
ellipse(X1,Y1,10,10);
ellipse(X2,Y2,10,10);
for (int t=1; t {
if(X1>X2)
{
ellipse(X1 - uzunluk/tekrar * t,Y1 + yukseklik/tekrar*t,5,5);
}
else
ellipse(X1 + uzunluk/tekrar * t,Y1+yukseklik/tekrar*t,5,5);
}
}
{
size(500,500);
background(200,225,0,100);
//noLoop();
}
void draw()
{
background(200,255,0,100);
int X1,Y1,X2,Y2;
int uzunluk;
int tekrar;
int yukseklik;
X1=0;
X2=mouseX;
Y1=0;
Y2=mouseY;
tekrar=15;
uzunluk=abs(X1-X2);
yukseklik=abs(Y1-Y2);
ellipse(X1,Y1,10,10);
ellipse(X2,Y2,10,10);
for (int t=1; t
if(X1>X2)
{
ellipse(X1 - uzunluk/tekrar * t,Y1 + yukseklik/tekrar*t,5,5);
}
else
ellipse(X1 + uzunluk/tekrar * t,Y1+yukseklik/tekrar*t,5,5);
}
}
elipsleri capraz dizdik
void setup()
{
size(500,200);
background(15,185,0,100);
noLoop();
}
void draw ()
{
int X1, Y1, X2, Y2;
int uzunluk, yukseklik;
int tekrar;
X1 = 0;
X2 = width*2/3;
Y1 = 0;
Y2 = height /2;
tekrar = 8;
uzunluk = abs(X1-X2) ;
yukseklik = abs (Y1-Y2);
ellipse (X1, Y1,10,10);
ellipse (X2, Y2,10,10);
for (int t = 1; t < tekrar; t++)
{
if (X1 > X2)
{
ellipse (X1 - uzunluk/tekrar * t, Y1 + yukseklik/ tekrar*t ,5,5);
}
else
{
ellipse (X1 + uzunluk/tekrar * t, Y1 + yukseklik/ tekrar*t ,5,5);
}
}
}
{
size(500,200);
background(15,185,0,100);
noLoop();
}
void draw ()
{
int X1, Y1, X2, Y2;
int uzunluk, yukseklik;
int tekrar;
X1 = 0;
X2 = width*2/3;
Y1 = 0;
Y2 = height /2;
tekrar = 8;
uzunluk = abs(X1-X2) ;
yukseklik = abs (Y1-Y2);
ellipse (X1, Y1,10,10);
ellipse (X2, Y2,10,10);
for (int t = 1; t < tekrar; t++)
{
if (X1 > X2)
{
ellipse (X1 - uzunluk/tekrar * t, Y1 + yukseklik/ tekrar*t ,5,5);
}
else
{
ellipse (X1 + uzunluk/tekrar * t, Y1 + yukseklik/ tekrar*t ,5,5);
}
}
}
rect_ellipse
void setup()
{
size(500,200);
background(200,255,0,100);
noLoop();
}
void draw()
{
int yatayBol =5;
int duseyBol;
duseyBol =4;
float yatayUz;
float duseyUz;
yatayUz = width / yatayBol;
duseyUz = height / duseyBol;
for(int i =0; i < 5; i++)
for(int j =0;j<4;j++)
{
fill(30+random(255),random(255),random(255),30);
rect(i*yatayUz,j*duseyUz,yatayUz,duseyUz);
noFill();
ellipse( i*yatayUz +yatayUz/2,j*duseyUz +duseyUz/2,yatayUz,duseyUz);
}
}
{
size(500,200);
background(200,255,0,100);
noLoop();
}
void draw()
{
int yatayBol =5;
int duseyBol;
duseyBol =4;
float yatayUz;
float duseyUz;
yatayUz = width / yatayBol;
duseyUz = height / duseyBol;
for(int i =0; i < 5; i++)
for(int j =0;j<4;j++)
{
fill(30+random(255),random(255),random(255),30);
rect(i*yatayUz,j*duseyUz,yatayUz,duseyUz);
noFill();
ellipse( i*yatayUz +yatayUz/2,j*duseyUz +duseyUz/2,yatayUz,duseyUz);
}
}
rect. with ellipse(1)
void setup()
{
size(500,200);
background(200,225,0,100);
noLoop();
}
void draw()
{
int yatayBol = 5;
int duseyBol;
duseyBol = 4;
float yatayUz;
float duseyUz;
yatayUz=width/yatayBol;
duseyUz=height/duseyBol;
for(int i=0 ; i {
for(int j=0; j
{
fill (random(255), random(255), random(255), random(255));
rect (i*yatayUz,j*duseyUz,yatayUz,duseyUz);
stroke(2);
ellipseMode (CORNER);
ellipse (i*yatayUz,j*duseyUz,yatayUz,duseyUz);
}
}
}
{
size(500,200);
background(200,225,0,100);
noLoop();
}
void draw()
{
int yatayBol = 5;
int duseyBol;
duseyBol = 4;
float yatayUz;
float duseyUz;
yatayUz=width/yatayBol;
duseyUz=height/duseyBol;
for(int i=0 ; i
for(int j=0; j
{
fill (random(255), random(255), random(255), random(255));
rect (i*yatayUz,j*duseyUz,yatayUz,duseyUz);
stroke(2);
ellipseMode (CORNER);
ellipse (i*yatayUz,j*duseyUz,yatayUz,duseyUz);
}
}
}
Processing Ekranı Bölme
void setup()
{
size(500,500);
background(200,225,0,100);
noLoop();
}
void draw()
{
int yatayBol = 5;
int duseyBol;
duseyBol = 4;
float yatayUz;
float duseyUz;
yatayUz=width/yatayBol;
duseyUz=height/duseyBol;
for(int i=0 ; i<5 ; i=i + 1)
{
for(int j=0;j<4;j++)
{
rect(i*yatayUz,j*duseyUz,yatayUz,duseyUz);
}
}
}
{
size(500,500);
background(200,225,0,100);
noLoop();
}
void draw()
{
int yatayBol = 5;
int duseyBol;
duseyBol = 4;
float yatayUz;
float duseyUz;
yatayUz=width/yatayBol;
duseyUz=height/duseyBol;
for(int i=0 ; i<5 ; i=i + 1)
{
for(int j=0;j<4;j++)
{
rect(i*yatayUz,j*duseyUz,yatayUz,duseyUz);
}
}
}
16 Aralık 2010 Perşembe
10 Aralık 2010 Cuma
processing -beginshape
void setup ()
{
size (400, 400);
background (250);
}
void draw ()
{
fill(250,100);
strokeWeight(8);
int koorBirX=mouseX;
int koorBirY=mouseY;
beginShape();
vertex(koorBirX, koorBirY);
vertex(koorBirX+20, koorBirY);
vertex(koorBirX, koorBirY+20);
vertex(koorBirX, koorBirY+20);
vertex(koorBirX+40, koorBirY+40);
vertex(koorBirX, koorBirY+40);
endShape(CLOSE);
}
{
size (400, 400);
background (250);
}
void draw ()
{
fill(250,100);
strokeWeight(8);
int koorBirX=mouseX;
int koorBirY=mouseY;
beginShape();
vertex(koorBirX, koorBirY);
vertex(koorBirX+20, koorBirY);
vertex(koorBirX, koorBirY+20);
vertex(koorBirX, koorBirY+20);
vertex(koorBirX+40, koorBirY+40);
vertex(koorBirX, koorBirY+40);
endShape(CLOSE);
}
Shape in Processing
void setup()
{
size (400,400);
background(250);
//noLoop();
}
void draw()
{
fill(250, 100);
rect(0,0,400,400);
strokeWeight(8);
int koorBirX;
int koorBirY;
koorBirX = mouseX;
koorBirY = mouseY;
beginShape();
vertex(koorBirX,koorBirY);
vertex(koorBirX+20,koorBirY);
vertex(koorBirX+20,koorBirY+20);
vertex(koorBirX+40,koorBirY+20);
vertex(koorBirX+40,koorBirY+40);
vertex(koorBirX,koorBirY+40);
endShape(CLOSE);
}
{
size (400,400);
background(250);
//noLoop();
}
void draw()
{
fill(250, 100);
rect(0,0,400,400);
strokeWeight(8);
int koorBirX;
int koorBirY;
koorBirX = mouseX;
koorBirY = mouseY;
beginShape();
vertex(koorBirX,koorBirY);
vertex(koorBirX+20,koorBirY);
vertex(koorBirX+20,koorBirY+20);
vertex(koorBirX+40,koorBirY+20);
vertex(koorBirX+40,koorBirY+40);
vertex(koorBirX,koorBirY+40);
endShape(CLOSE);
}
processing if-else
void setup ()
{
size (400, 400);
background (250);
}
void draw ()
{
fill(250,100);
rect(0,0,400,400);
noFill();
strokeWeight(3);
if ((mouseX<200)&&(mouseY<200))
{
ellipse(mouseX,mouseY,150,100);
}
else if ((mouseX>200)&&(mouseY<200))
{
ellipse(mouseX, mouseY,100,150);
}
else if ((mouseX<200)&&(mouseY>200))
{
ellipse(mouseX, mouseY,100,100);
}
else
{
ellipse(mouseX, mouseY,random (100), random (100));
}
}
{
size (400, 400);
background (250);
}
void draw ()
{
fill(250,100);
rect(0,0,400,400);
noFill();
strokeWeight(3);
if ((mouseX<200)&&(mouseY<200))
{
ellipse(mouseX,mouseY,150,100);
}
else if ((mouseX>200)&&(mouseY<200))
{
ellipse(mouseX, mouseY,100,150);
}
else if ((mouseX<200)&&(mouseY>200))
{
ellipse(mouseX, mouseY,100,100);
}
else
{
ellipse(mouseX, mouseY,random (100), random (100));
}
}
Ekranı Dörde Bölme (Processing) & Random
//{PROGRAM adı;}
/*backgroung{0-255};
background(R,G,B);
backgorund(R,G,B,A);*/
//BEGIN
//...
//READLN;
//END.
//REAL --> FLOAT , DOUBLE
//INTEGER --> int
void setup()
{
size (400,400);
background(250);
//noLoop();
}
void draw()
{
//noStroke();
fill(250,50);
rect(0,0,400,400);
noFill();
strokeWeight(3);
if ((mouseX < 200) && (mouseY < 200))
{
ellipse(mouseX,mouseY,150,100);
}
else if((mouseX > 200) && (mouseY < 200))
{
ellipse(mouseX,mouseY,100,150);
}
else if ((mouseX < 200) && (mouseY > 200))
{
ellipse(mouseX,mouseY,100,100);
}
else
{
ellipse(mouseX,mouseY,random(100),random(100));
}
}
/*backgroung{0-255};
background(R,G,B);
backgorund(R,G,B,A);*/
//BEGIN
//...
//READLN;
//END.
//REAL --> FLOAT , DOUBLE
//INTEGER --> int
void setup()
{
size (400,400);
background(250);
//noLoop();
}
void draw()
{
//noStroke();
fill(250,50);
rect(0,0,400,400);
noFill();
strokeWeight(3);
if ((mouseX < 200) && (mouseY < 200))
{
ellipse(mouseX,mouseY,150,100);
}
else if((mouseX > 200) && (mouseY < 200))
{
ellipse(mouseX,mouseY,100,150);
}
else if ((mouseX < 200) && (mouseY > 200))
{
ellipse(mouseX,mouseY,100,100);
}
else
{
ellipse(mouseX,mouseY,random(100),random(100));
}
}
processing deneme2
void setup ()
{
size (400, 400);
background (255,200,0);
noLoop();
}
void draw ()
{
for(int i=0;i<8;i++)
{
for(int j=0; j<8;j= j + 1)
{
fill(random(255), i+j*50,0);
rect(i*50,j*50,50,50);
}
}
}
{
size (400, 400);
background (255,200,0);
noLoop();
}
void draw ()
{
for(int i=0;i<8;i++)
{
for(int j=0; j<8;j= j + 1)
{
fill(random(255), i+j*50,0);
rect(i*50,j*50,50,50);
}
}
}
processing deneme1
void setup ()
{
size (400, 400);
background (255,200,0);
}
void draw ()
{
for(int i=0;i<8;i++)
{
for(int j=0; j<8;j= j + 1)
{
fill(i*j*50, i+j*50,0);
rect(i*50,j*50,50,50);
}
}
}
{
size (400, 400);
background (255,200,0);
}
void draw ()
{
for(int i=0;i<8;i++)
{
for(int j=0; j<8;j= j + 1)
{
fill(i*j*50, i+j*50,0);
rect(i*50,j*50,50,50);
}
}
}
3 Aralık 2010 Cuma
MARIO - MATRIS OLUŞTURMA
PROGRAM MARIOVERI;
VAR i,j,k,t : INTEGER;
mario : ARRAY [0..19,0..19] OF INTEGER;
marioson,veri:TEXT;
BEGIN
ASSIGN(veri,'C:/mariotext.txt');
RESET(veri);
ASSIGN (marioson , 'C:/mariosonuc.txt');
REWRITE(marioson);
FOR k:=0 TO 19 DO
FOR t :=0 TO 19 DO
BEGIN
mario[k][t] :=0;
END;
FOR k:=0 TO 19 DO
BEGIN
FOR t :=0 TO 19 DO
BEGIN
WRITE( marioson,mario[k][t], ' ');
END;
WRITELN(marioson);
END;
READ(veri,i,j);
WRITELN(i);
WRITELN(j);
CLOSE(marioson);
READLN;
END.
VAR i,j,k,t : INTEGER;
mario : ARRAY [0..19,0..19] OF INTEGER;
marioson,veri:TEXT;
BEGIN
ASSIGN(veri,'C:/mariotext.txt');
RESET(veri);
ASSIGN (marioson , 'C:/mariosonuc.txt');
REWRITE(marioson);
FOR k:=0 TO 19 DO
FOR t :=0 TO 19 DO
BEGIN
mario[k][t] :=0;
END;
FOR k:=0 TO 19 DO
BEGIN
FOR t :=0 TO 19 DO
BEGIN
WRITE( marioson,mario[k][t], ' ');
END;
WRITELN(marioson);
END;
READ(veri,i,j);
WRITELN(i);
WRITELN(j);
CLOSE(marioson);
READLN;
END.
mariosonuç
program mario;
uses crt;
var i,j: integer;
marioson,veri: TEXT;
begin
clrscr;
assign(veri, 'c:/mario.txt');
reset(veri);
assign(marioson, 'c:/mariosonuc.txt');
rewrite(marioson);
read(veri,i,j);
writeln(i);
writeln(j);
close(marioson);
readln;
end.
uses crt;
var i,j: integer;
marioson,veri: TEXT;
begin
clrscr;
assign(veri, 'c:/mario.txt');
reset(veri);
assign(marioson, 'c:/mariosonuc.txt');
rewrite(marioson);
read(veri,i,j);
writeln(i);
writeln(j);
close(marioson);
readln;
end.
DIZILERDE SIRALAMA VE REWRITE (DOSYAYA YAZDIRMA)
PROGRAM siralama2;
USES CRT;
VAR i,j,TEMP:INTEGER;
DIZI:ARRAY [0..4] OF INTEGER;
sonuc:TEXT;
BEGIN
CLRSCR;
ASSIGN (sonuc, 'C:/cikti.txt');
REWRITE(sonuc);
WRITELN('LUTFEN 5 ADET TAMSAYI YAZINIZ');
READLN(DIZI[0]);
READLN(DIZI[1]);
READLN(DIZI[2]);
READLN(DIZI[3]);
READLN(DIZI[4]);
FOR i:=1 TO 4 DO
IF (DIZI[0] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[0];
DIZI[0] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=1 TO 4 DO
IF (DIZI[1] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[1];
DIZI[1] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=2 TO 4 DO
IF (DIZI[2] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[2];
DIZI[2] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=3 TO 4 DO
IF (DIZI[3] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[3];
DIZI[3] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=4 TO 4 DO
IF (DIZI[4] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[4];
DIZI[4] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR j:=0 TO 4 DO
BEGIN
WRITELN(sonuc,DIZI[j]);
WRITELN(DIZI[j]:5);
END;
CLOSE(sonuc);
READLN;
END.
USES CRT;
VAR i,j,TEMP:INTEGER;
DIZI:ARRAY [0..4] OF INTEGER;
sonuc:TEXT;
BEGIN
CLRSCR;
ASSIGN (sonuc, 'C:/cikti.txt');
REWRITE(sonuc);
WRITELN('LUTFEN 5 ADET TAMSAYI YAZINIZ');
READLN(DIZI[0]);
READLN(DIZI[1]);
READLN(DIZI[2]);
READLN(DIZI[3]);
READLN(DIZI[4]);
FOR i:=1 TO 4 DO
IF (DIZI[0] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[0];
DIZI[0] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=1 TO 4 DO
IF (DIZI[1] < DIZI[i]) THE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MP := DIZI[2];
DIZI[2] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=3 TO 4 DO
IF (DIZI[3] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[3];
DIZI[3] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=4 TO 4 DO
IF (DIZI[4] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[4];
DIZI[4] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR j:=0 TO 4 DO
WRITELN(DIZI[j]:5);
READLN;
END.
USES CRT;
VAR i,j,TEMP:INTEGER;
DIZI:ARRAY [0..4] OF INTEGER;
BEGIN
CLRSCR;
WRITELN('LUTFEN 5 ADET TAMSAYI YAZINIZ');
READLN(DIZI[0]);
READLN(DIZI[1]);
READLN(DIZI[2]);
READLN(DIZI[3]);
READLN(DIZI[4]);
FOR i:=1 TO 4 DO
IF (DIZI[0] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[0];
DIZI[0] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=1 TO 4 DO
IF (DIZI[1] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[1];
DIZI[1] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=2 TO 4 DO
IF (DIZI[2] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[2];
DIZI[2] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=3 TO 4 DO
IF (DIZI[3] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[3];
DIZI[3] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR i:=4 TO 4 DO
IF (DIZI[4] < DIZI[i]) THEN
BEGIN
TEMP := DIZI[4];
DIZI[4] := DIZI[i];
DIZI[i] := TEMP;
END;
FOR j:=0 TO 4 DO
WRITELN(DIZI[j]:5);
READLN;
END.
tEK
PROGRAM ODEV;
USES CRT;
VAR i,j: INTEGER;
SIRA: ARRAY [0..4] OF INTEGER;
BEGIN
CLRSCR;
WRITELN('BES ADET TAM SAYI DEGERI GIRINIZ.');
FOR i:= 0 TO 4 DO
BEGIN
READLN(SIRA[i]);
END;
FOR i:=0 TO 4 DO
BEGIN
IF SIRA[i] MOD 2 = 0 THEN
BEGIN
WRITELN((SIRA[i]/2):4:2);
END
ELSE
BEGIN
WRITELN((SIRA[i]+1):4);
END;
END;
FOR i:= 0 TO 4 DO
BEGIN
WRITELN(I,'.ELEMAN=',SIRA[i]);
END;
FOR j:= i+1 TO 4 DO
BEGIN
WRITELN(I,'.ELEMAN=');
END;
READLN;
END.
sıralama
program siralama;
uses crt;
var i,j,temp: integer;
dizi : array[0..4] of integer;
begin
clrscr;
writeln('lütfen 5 adet tam sayi yaziniz');
readln(dizi[0]);
readln(dizi[1]);
readln(dizi[2]);
readln(dizi[3]);
readln(dizi[4]);
for i := 1 to 4 do
if (dizi[0] < dizi [i]) then
begin
temp := dizi[0];
dizi[0] := dizi[i];
dizi[i] := temp;
end;
for i := 2 to 4 do
if (dizi[1] < dizi [i]) then
begin
temp := dizi[1];
dizi[1] := dizi[i];
dizi[i] := temp;
end;
for i := 3 to 4 do
if (dizi[2] < dizi [i]) then
begin
temp := dizi[2];
dizi[2] := dizi[i];
dizi[i] := temp;
end;
for i := 4 to 4 do
if (dizi[3] < dizi [i]) then
begin
temp := dizi[3];
dizi[3] := dizi[i];
dizi[i] := temp;
end;
for j := 0 to 4 do
writeln(dizi[j]:4);
end.
uses crt;
var i,j,temp: integer;
dizi : array[0..4] of integer;
begin
clrscr;
writeln('lütfen 5 adet tam sayi yaziniz');
readln(dizi[0]);
readln(dizi[1]);
readln(dizi[2]);
readln(dizi[3]);
readln(dizi[4]);
for i := 1 to 4 do
if (dizi[0] < dizi [i]) then
begin
temp := dizi[0];
dizi[0] := dizi[i];
dizi[i] := temp;
end;
for i := 2 to 4 do
if (dizi[1] < dizi [i]) then
begin
temp := dizi[1];
dizi[1] := dizi[i];
dizi[i] := temp;
end;
for i := 3 to 4 do
if (dizi[2] < dizi [i]) then
begin
temp := dizi[2];
dizi[2] := dizi[i];
dizi[i] := temp;
end;
for i := 4 to 4 do
if (dizi[3] < dizi [i]) then
begin
temp := dizi[3];
dizi[3] := dizi[i];
dizi[i] := temp;
end;
for j := 0 to 4 do
writeln(dizi[j]:4);
end.
Kaydol:
Kayıtlar (Atom)