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]) 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.
mario.txt
15 16
1 1 1 1 2 2 2 2 2 2 1 1 1 1 1
1 1 1 2 2 2 2 2 2 2 2 2 2 1 1
1 1 1 3 3 3 3 4 4 3 4 1 1 1 1
1 1 3 3 4 3 4 4 4 3 4 4 4 1 1
1 1 3 3 4 3 3 4 4 4 3 4 4 4 1
1 1 3 3 3 4 4 4 4 3 3 3 3 1 1
1 1 1 1 4 4 4 4 4 4 4 4 1 1 1
1 1 1 3 3 3 5 3 3 3 1 1 1 1 1
1 1 3 3 3 3 5 3 3 5 3 3 3 1 1
1 3 3 3 3 3 5 5 5 5 3 3 3 3 1
1 4 4 4 3 5 4 5 5 4 5 3 4 4 1
1 4 4 4 4 5 5 5 5 5 5 4 4 4 1
1 4 4 4 5 5 5 5 5 5 5 5 4 4 1
1 1 1 5 5 5 5 1 5 5 5 5 1 1 1
1 1 3 3 3 3 1 1 1 3 3 3 3 1 1
1 3 3 3 3 3 1 1 1 3 3 3 3 3 1
1 1 1 1 2 2 2 2 2 2 1 1 1 1 1
1 1 1 2 2 2 2 2 2 2 2 2 2 1 1
1 1 1 3 3 3 3 4 4 3 4 1 1 1 1
1 1 3 3 4 3 4 4 4 3 4 4 4 1 1
1 1 3 3 4 3 3 4 4 4 3 4 4 4 1
1 1 3 3 3 4 4 4 4 3 3 3 3 1 1
1 1 1 1 4 4 4 4 4 4 4 4 1 1 1
1 1 1 3 3 3 5 3 3 3 1 1 1 1 1
1 1 3 3 3 3 5 3 3 5 3 3 3 1 1
1 3 3 3 3 3 5 5 5 5 3 3 3 3 1
1 4 4 4 3 5 4 5 5 4 5 3 4 4 1
1 4 4 4 4 5 5 5 5 5 5 4 4 4 1
1 4 4 4 5 5 5 5 5 5 5 5 4 4 1
1 1 1 5 5 5 5 1 5 5 5 5 1 1 1
1 1 3 3 3 3 1 1 1 3 3 3 3 1 1
1 3 3 3 3 3 1 1 1 3 3 3 3 3 1
plan.txt
6 6
1 1 1 1 1 1
1 2 2 1 3 3
1 2 2 1 1 1
1 2 2 1 1 6
1 1 1 5 1 6
1 4 1 1 1 1
0.2 4.5 0.2 2.0 1.2 2.0
0.2 0.5 0.2 2.0 1.2 7.0
1 1 1 1 1 1
1 2 2 1 3 3
1 2 2 1 1 1
1 2 2 1 1 6
1 1 1 5 1 6
1 4 1 1 1 1
0.2 4.5 0.2 2.0 1.2 2.0
0.2 0.5 0.2 2.0 1.2 7.0
DIZILERDE SIRALAMA1
PROGRAM siralama;
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.
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.
17 Kasım 2010 Çarşamba
başka faydalı adresler
http://www.biothing.org/wiki/doku.php?id=home
SIGGRAPH-SEMPOZYUMU:
http://www.siggraph.org/s2011/for_submitters/art-papers
SIGGRAPH-SEMPOZYUMU:
http://www.siggraph.org/s2011/for_submitters/art-papers
16 Kasım 2010 Salı
faydalı bağlantılardan bazıları..
http://processing.org
http://modelab.nu/
http://formandcode.com/
http://www.openprocessing.org/
http://www.codeproject.com/KB/architecture/
http://bocoup.com/processing-js/docs/index.php
http://www.creativeapplications.net/processing/the-afterparty-processing/
http://www.digitalcrafting.dk/
http://www.processingblogs.org/
AD: Programming Cultures: Architecture, Art and Science in the Age of Software Development (ITU kutuphanesi elektronik kaynaklardan ulaşılabilir)
http://modelab.nu/
http://formandcode.com/
http://www.openprocessing.org/
http://www.codeproject.com/KB/architecture/
http://bocoup.com/processing-js/docs/index.php
http://www.creativeapplications.net/processing/the-afterparty-processing/
http://www.digitalcrafting.dk/
http://www.processingblogs.org/
AD: Programming Cultures: Architecture, Art and Science in the Age of Software Development (ITU kutuphanesi elektronik kaynaklardan ulaşılabilir)
12 Kasım 2010 Cuma
Matris 1-15; II.Yöntem
program dizi4;
var i,j,k : integer;
begin
for j:= 1 to 15 do
begin
write(j:3);
if j mod 5=0 then
writeln;
end;
readln;
end.
var i,j,k : integer;
begin
for j:= 1 to 15 do
begin
write(j:3);
if j mod 5=0 then
writeln;
end;
readln;
end.
birdenonbeşekadar
PROGRAM bironbes;
VAR j: INTEGER;
BEGIN
..for j:=1 to 15 do
....begin
......if j mod 5=0 then
........begin
.........write(j:2);
.........writeln;
........end
......else
.......write(j:2);
......end;
READLN;
END.
VAR j: INTEGER;
BEGIN
..for j:=1 to 15 do
....begin
......if j mod 5=0 then
........begin
.........write(j:2);
.........writeln;
........end
......else
.......write(j:2);
......end;
READLN;
END.
Matris_1'den 15'e..
program dizi4;
var i,j,k : integer;
begin
k:=1;
for i := 1 to 3 do
begin
for j:= 1 to 5 do
begin
write(k:3);
k:=k+1;
end;
writeln;
end;
readln;
end.
var i,j,k : integer;
begin
k:=1;
for i := 1 to 3 do
begin
for j:= 1 to 5 do
begin
write(k:3);
k:=k+1;
end;
writeln;
end;
readln;
end.
12345
PROGRAM biriki;
VAR i,j: INTEGER;
BEGIN
j:=j+1;
for i:=1 to 3 do
..begin
.....for j:=1 to 5 do
.......begin
........write(j );
.......end;
..writeln;
..end;
READLN;
END.
VAR i,j: INTEGER;
BEGIN
j:=j+1;
for i:=1 to 3 do
..begin
.....for j:=1 to 5 do
.......begin
........write(j );
.......end;
..writeln;
..end;
READLN;
END.
dizi3
program diziler;
Var i,j, a: integer;
sira:ARRAY[0..4] of integer;
begin
writeln('sayi giriniz');
for j := 0 to 4 do
begin
readln(sira[j]);
end;
for j := 4 downto 0 do
begin
writeln('dizinin', j, 'inci elemani:', sira[j]);
end;
readln;
end.
Var i,j, a: integer;
sira:ARRAY[0..4] of integer;
begin
writeln('sayi giriniz');
for j := 0 to 4 do
begin
readln(sira[j]);
end;
for j := 4 downto 0 do
begin
writeln('dizinin', j, 'inci elemani:', sira[j]);
end;
readln;
end.
diziler_sayı yazdırma
PROGRAM diziler2;
VAR i,j:integer;
SIRA : ARRAY [0..4] of integer;
BEGIN
writeln ('bes tane tam say girin');
for i:=0 to 4 do
begin
READLN(SIRA[i]);
end;
for i:=4 downto 0 do
begin
writeln('SIRA= ', SIRA[i]);
end;
READLN;
END.
VAR i,j:integer;
SIRA : ARRAY [0..4] of integer;
BEGIN
writeln ('bes tane tam say girin');
for i:=0 to 4 do
begin
READLN(SIRA[i]);
end;
for i:=4 downto 0 do
begin
writeln('SIRA= ', SIRA[i]);
end;
READLN;
END.
Diziler_Downto
program diziler;
Var i,j: integer;
dizi:ARRAY[0..7] of integer;
a: integer;
begin
for i := 0 to 7 do
begin
dizi[i] := i*10;
end;
for j:= 0 to 7 do
writeln(dizi[j]:6);
for j:= 7 downto 0 do
writeln(dizi[j]:6);
readln;
end.
Var i,j: integer;
dizi:ARRAY[0..7] of integer;
a: integer;
begin
for i := 0 to 7 do
begin
dizi[i] := i*10;
end;
for j:= 0 to 7 do
writeln(dizi[j]:6);
for j:= 7 downto 0 do
writeln(dizi[j]:6);
readln;
end.
diziler1
PROGRAM diziler1;
VAR i:integer;
dizi : ARRAY [0..7] of integer;
BEGIN
for i:=0 to 7 do
begin
dizi[i] := i*10;
end;
WRITELN (dizi[0]:6);
WRITELN (dizi[1]:6);
WRITELN (dizi[2]:6);
WRITELN (dizi[3]:6);
WRITELN (dizi[4]:6);
WRITELN (dizi[5]:6);
WRITELN (dizi[6]:6);
WRITELN (dizi[7]:6);
READLN;
END.
VAR i:integer;
dizi : ARRAY [0..7] of integer;
BEGIN
for i:=0 to 7 do
begin
dizi[i] := i*10;
end;
WRITELN (dizi[0]:6);
WRITELN (dizi[1]:6);
WRITELN (dizi[2]:6);
WRITELN (dizi[3]:6);
WRITELN (dizi[4]:6);
WRITELN (dizi[5]:6);
WRITELN (dizi[6]:6);
WRITELN (dizi[7]:6);
READLN;
END.
5 Kasım 2010 Cuma
mod'suz katsayi programi
program bolunme;
var i,a,b,c,d:integer;
begin
writeln('Ust sayi siniri kac olsun?');
readln(b);
Writeln('Kacin katlari bulunsun?');
readln(d);
c:=b div d;
for i:=1 to b do
begin
for a:=1 to c do
begin
if d*a=i then Writeln(i);
end;
end;
readln;
end.
var i,a,b,c,d:integer;
begin
writeln('Ust sayi siniri kac olsun?');
readln(b);
Writeln('Kacin katlari bulunsun?');
readln(d);
c:=b div d;
for i:=1 to b do
begin
for a:=1 to c do
begin
if d*a=i then Writeln(i);
end;
end;
readln;
end.
LONGINT
PROGRAM repeat1;
USES CRT;
var i,toplam,a : LONGINT;
BEGIN
WRITELN('BIR TAM SAYI GIRINIZ ');
READLN(a);
i:=0;
toplam:=0;
CLRSCR;
REPEAT
IF i MOD 5 = 0 THEN
BEGIN
toplam:=toplam+i;
writeln(i);
END;
i:=i +1;
UNTIL i>a;
WRITELN (toplam);
READLN;
END.
USES CRT;
var i,toplam,a : LONGINT;
BEGIN
WRITELN('BIR TAM SAYI GIRINIZ ');
READLN(a);
i:=0;
toplam:=0;
CLRSCR;
REPEAT
IF i MOD 5 = 0 THEN
BEGIN
toplam:=toplam+i;
writeln(i);
END;
i:=i +1;
UNTIL i>a;
WRITELN (toplam);
READLN;
END.
5 kasım- repeat*until
program deneme1;
uses crt;
var i, toplam, toplam2, toplam3: integer;
begin
clrscr;
i:=0;
toplam:=0;
toplam2:=0;
toplam3:=0;
repeat
if i mod 5= 0 then
begin
toplam:=toplam+i;
end;
if i mod 7= 0 then
begin
toplam2:=toplam2+i;
end;
if i mod 3= 0 then
begin
toplam3:=toplam3+i;
end;
i:= i+1;
until i>50;
writeln(toplam);
writeln('7 nin katlarinin toplami: ', toplam2);
writeln('3 un katlarinin toplami:', toplam3);
readln;
end.
uses crt;
var i, toplam, toplam2, toplam3: integer;
begin
clrscr;
i:=0;
toplam:=0;
toplam2:=0;
toplam3:=0;
repeat
if i mod 5= 0 then
begin
toplam:=toplam+i;
end;
if i mod 7= 0 then
begin
toplam2:=toplam2+i;
end;
if i mod 3= 0 then
begin
toplam3:=toplam3+i;
end;
i:= i+1;
until i>50;
writeln(toplam);
writeln('7 nin katlarinin toplami: ', toplam2);
writeln('3 un katlarinin toplami:', toplam3);
readln;
end.
50'ye kadar sayılardan 5'in katlarının, 3'ün katlarının, 7'nin katarının ayrı ayrı toplamı - while ile
PROGRAM deneme5;
USES CRT;
VAR i, TOPLAM!, TOPLAM2, TOPLAM^3 : INTEGER;
BEGIN
CLRSCR;
i:=0;
TOPLAM1 := 0;
TOPLAM2 := 0;
TOPLAM3 := 0;
WHILE i < 50 DO
BEGIN
IF i MOD 5 = 0 THEN
BEGIN
TOPLAM1 := TOPLAM1 + i;
END;
IF i MOD 3 = 0 THEN
BEGIN
TOPLAM2 := TOPLAM2 + i;
END;
IF i MOD 7 = 0 THEN
BEGIN
TOPLAM3 := TOPLAM3 + i;
END;
i = i + 1;
END;
WRITELN (‘ BESIN KATLARININ TOPLAMI = ‘, TOPLAM1);
WRITELN (‘ UCUN KATLARININ TOPLAMI = ‘, TOPLAM2);
WRITELN (‘ YEDININ KATLARININ TOPLAMI = ‘, TOPLAM3);
READLN;
END;
USES CRT;
VAR i, TOPLAM!, TOPLAM2, TOPLAM^3 : INTEGER;
BEGIN
CLRSCR;
i:=0;
TOPLAM1 := 0;
TOPLAM2 := 0;
TOPLAM3 := 0;
WHILE i < 50 DO
BEGIN
IF i MOD 5 = 0 THEN
BEGIN
TOPLAM1 := TOPLAM1 + i;
END;
IF i MOD 3 = 0 THEN
BEGIN
TOPLAM2 := TOPLAM2 + i;
END;
IF i MOD 7 = 0 THEN
BEGIN
TOPLAM3 := TOPLAM3 + i;
END;
i = i + 1;
END;
WRITELN (‘ BESIN KATLARININ TOPLAMI = ‘, TOPLAM1);
WRITELN (‘ UCUN KATLARININ TOPLAMI = ‘, TOPLAM2);
WRITELN (‘ YEDININ KATLARININ TOPLAMI = ‘, TOPLAM3);
READLN;
END;
50'ye kadar 2'şer 2'şer artan olan sayılardan 5'in katları olanların toplanması - while kullanılarak
PROGRAM deneme4;
USES CRT;
VAR i : INTEGER;
BEGIN
CLRSCR;
i:=0;
WHILE i < 50 DO
BEGIN
IF i MOD 5 = 0 THEN
BEGIN
WRITELN(i);
END;
i = i + 2;
END;
READLN;
END.
USES CRT;
VAR i : INTEGER;
BEGIN
CLRSCR;
i:=0;
WHILE i < 50 DO
BEGIN
IF i MOD 5 = 0 THEN
BEGIN
WRITELN(i);
END;
i = i + 2;
END;
READLN;
END.
50'ye kadar sayılardan 5'in katlarının toplamı - for ile
PROGRAM deneme3;
{CONST}
USES CRT;
VAR i,toplam: INTEGER;
BEGIN
CLRSCR;
toplam := 0;
FOR i := 1 TO 50 DO
BEGIN
IF ( i MOD 5 = 0) THEN
BEGIN
WRITELN(i);
toplam := toplam + i;
END;
END;
WRITELN(toplam);
READLN;
END.
{CONST}
USES CRT;
VAR i,toplam: INTEGER;
BEGIN
CLRSCR;
toplam := 0;
FOR i := 1 TO 50 DO
BEGIN
IF ( i MOD 5 = 0) THEN
BEGIN
WRITELN(i);
toplam := toplam + i;
END;
END;
WRITELN(toplam);
READLN;
END.
50'ye kadar sayıların ekrana yazdırılması - for ile
PROGRAM deneme1;
USES CRT;
VAR i: INTEGER;
BEGIN
CLRSCR;
FOR i := 1 TO 50 DO
WRITELN(i);
READLN;
END;
USES CRT;
VAR i: INTEGER;
BEGIN
CLRSCR;
FOR i := 1 TO 50 DO
WRITELN(i);
READLN;
END;
22 Ekim 2010 Cuma
ucgen- tanım 2
PROGRAM UCGEN;
VAR A,B,C,TOPLAM,FARK:INTEGER;
BEGIN
WRITELN ('UCGENIN KENAR UZUNLUKLARINI GIRINIZ');
READLN (A,B,C);
IF ( (A <> ABS(B-C)) ) THEN
IF ( (B <> ABS(A-C)) ) THEN
IF ( (C <> ABS(A-B)) ) THEN
WRITELN ('UCGENDIR')
ELSE
ELSE
ELSE
WRITELN ('GIRILEN KENAR UZUNLUKLARINA GORE UCGEN TANIMLI DEGILDIR');
READLN;
END.
VAR A,B,C,TOPLAM,FARK:INTEGER;
BEGIN
WRITELN ('UCGENIN KENAR UZUNLUKLARINI GIRINIZ');
READLN (A,B,C);
IF ( (A <> ABS(B-C)) ) THEN
IF ( (B <> ABS(A-C)) ) THEN
IF ( (C <> ABS(A-B)) ) THEN
WRITELN ('UCGENDIR')
ELSE
ELSE
ELSE
WRITELN ('GIRILEN KENAR UZUNLUKLARINA GORE UCGEN TANIMLI DEGILDIR');
READLN;
END.
15 Ekim 2010 Cuma
15 EKIM DENEME 8
PROGRAM UYGULAMA7;
VAR A, B, C, EnBuyuk, enKucuk : INTEGER;
BEGIN
WRITELN('3 tam sayi yaziniz.');
READLN(A, B, C);
IF (A > B) THEN
BEGIN
IF (A > C) THEN
enBuyuk := A;
END
ELSE IF (B > C) THEN
enBuyuk := B
ELSE
enBuyuk := C;
WRITELN('yazdiginiz sayilardan enBuyuk olani=', enBuyuk :6);
IF (A < B) THEN
BEGIN
IF (A < C) THEN
enKucuk := A
ELSE
enKucuk := C;
END
ELSE IF (B < C) THEN
enKucuk := B
ELSE
enKucuk := C;
WRITELN('yazdiginiz sayilardan enKucuk olani=', enKucuk :6);
READLN;
END.
VAR A, B, C, EnBuyuk, enKucuk : INTEGER;
BEGIN
WRITELN('3 tam sayi yaziniz.');
READLN(A, B, C);
IF (A > B) THEN
BEGIN
IF (A > C) THEN
enBuyuk := A;
END
ELSE IF (B > C) THEN
enBuyuk := B
ELSE
enBuyuk := C;
WRITELN('yazdiginiz sayilardan enBuyuk olani=', enBuyuk :6);
IF (A < B) THEN
BEGIN
IF (A < C) THEN
enKucuk := A
ELSE
enKucuk := C;
END
ELSE IF (B < C) THEN
enKucuk := B
ELSE
enKucuk := C;
WRITELN('yazdiginiz sayilardan enKucuk olani=', enKucuk :6);
READLN;
END.
15 EKIM DENEME 6
PROGRAM deneme5;
VAR sayi1, sayi2, sayi3, sayi4, sayi5: INTEGER;
enBuyuk, enKucuk : REAL;
BEGIN
WRITELN('Lutfen 5 adet tam sayi yaziniz!');
READLN(sayi1, sayi2, sayi3, sayi4, sayi5);
enBuyuk := sayi1;
IF (enBuyuk < sayi2) THEN
BEGIN
enBuyuk :=sayi2;
END;
IF (enBuyuk < sayi3) THEN
BEGIN
enBuyuk :=sayi3;
END;
IF (enBuyuk < sayi4) THEN
BEGIN
enBuyuk :=sayi4;
END;
IF (enBuyuk < sayi5) THEN
BEGIN
enBuyuk :=sayi5;
END;
enKucuk := sayi1;
IF (enKucuk > sayi2) THEN
BEGIN
enKucuk :=sayi2;
END;
IF (enKucuk > sayi3) THEN
BEGIN
enKucuk :=sayi3;
END;
IF (enKucuk > sayi4) THEN
BEGIN
enKucuk :=sayi4;
END;
IF (enKucuk > sayi5) THEN
BEGIN
enKucuk :=sayi5;
END;
WRITELN('Girmis oldugunuz sayilardan en buyugu=',
enBuyuk:5:2,' enkucugu=', enKucuk:5:1);
READLN;
END.
VAR sayi1, sayi2, sayi3, sayi4, sayi5: INTEGER;
enBuyuk, enKucuk : REAL;
BEGIN
WRITELN('Lutfen 5 adet tam sayi yaziniz!');
READLN(sayi1, sayi2, sayi3, sayi4, sayi5);
enBuyuk := sayi1;
IF (enBuyuk < sayi2) THEN
BEGIN
enBuyuk :=sayi2;
END;
IF (enBuyuk < sayi3) THEN
BEGIN
enBuyuk :=sayi3;
END;
IF (enBuyuk < sayi4) THEN
BEGIN
enBuyuk :=sayi4;
END;
IF (enBuyuk < sayi5) THEN
BEGIN
enBuyuk :=sayi5;
END;
enKucuk := sayi1;
IF (enKucuk > sayi2) THEN
BEGIN
enKucuk :=sayi2;
END;
IF (enKucuk > sayi3) THEN
BEGIN
enKucuk :=sayi3;
END;
IF (enKucuk > sayi4) THEN
BEGIN
enKucuk :=sayi4;
END;
IF (enKucuk > sayi5) THEN
BEGIN
enKucuk :=sayi5;
END;
WRITELN('Girmis oldugunuz sayilardan en buyugu=',
enBuyuk:5:2,' enkucugu=', enKucuk:5:1);
READLN;
END.
15 EKIM DENEME5
PROGRAM deneme5;
VAR sayi1, sayi2, sayi3, sayi4, sayi5: INTEGER;
enBuyuk: REAL;
BEGIN
WRITELN('Lutfen 5 adet tam sayi yaziniz!');
READLN(sayi1, sayi2, sayi3, sayi4, sayi5);
enBuyuk := sayi1;
IF (enBuyuk < sayi2) THEN
BEGIN
enBuyuk :=sayi2;
END;
IF (enBuyuk < sayi3) THEN
BEGIN
enBuyuk :=sayi3;
END;
IF (enBuyuk < sayi4) THEN
BEGIN
enBuyuk :=sayi4;
END;
IF (enBuyuk < sayi5) THEN
BEGIN
enBuyuk :=sayi5;
END;
WRITELN('Girmis oldugubuz sayilardan en buyugu=', enBuyuk:5:2);
READLN;
END.
VAR sayi1, sayi2, sayi3, sayi4, sayi5: INTEGER;
enBuyuk: REAL;
BEGIN
WRITELN('Lutfen 5 adet tam sayi yaziniz!');
READLN(sayi1, sayi2, sayi3, sayi4, sayi5);
enBuyuk := sayi1;
IF (enBuyuk < sayi2) THEN
BEGIN
enBuyuk :=sayi2;
END;
IF (enBuyuk < sayi3) THEN
BEGIN
enBuyuk :=sayi3;
END;
IF (enBuyuk < sayi4) THEN
BEGIN
enBuyuk :=sayi4;
END;
IF (enBuyuk < sayi5) THEN
BEGIN
enBuyuk :=sayi5;
END;
WRITELN('Girmis oldugubuz sayilardan en buyugu=', enBuyuk:5:2);
READLN;
END.
8 Ekim 2010 Cuma
IF-THEN-ELSE- GOTO
program deneme4;
Label basla, sonuc;
var SAYI1, SAYI2, TOPLAM, CARPIM: real;
kontrol : char;
BEGIN
basla:
WRITELN ('IKI GERCEK SAYI YAZINIZ');
READLN (SAYI1);
READLN (SAYI2);
TOPLAM := SAYI1 + SAYI2;
CARPIM := SAYI1 * SAYI2;
IF TOPLAM > 50 THEN
BEGIN
WRITELN ('IKI SAYININ TOPLAMI= ', TOPLAM: 6: 2);
END
ELSE
BEGIN
WRITELN ('IKI SAYININ CARPIMI =', CARPIM: 6: 2);
END;
WRITELN ('DEVAM ETMEK ISTIYORMUSUNUZ? E-H');
READLN (kontrol);
IF (kontrol='E') THEN
BEGIN
GOTO basla;
END
ELSE GOTO sonuc;
sonuc:
READLN;
END.
Label basla, sonuc;
var SAYI1, SAYI2, TOPLAM, CARPIM: real;
kontrol : char;
BEGIN
basla:
WRITELN ('IKI GERCEK SAYI YAZINIZ');
READLN (SAYI1);
READLN (SAYI2);
TOPLAM := SAYI1 + SAYI2;
CARPIM := SAYI1 * SAYI2;
IF TOPLAM > 50 THEN
BEGIN
WRITELN ('IKI SAYININ TOPLAMI= ', TOPLAM: 6: 2);
END
ELSE
BEGIN
WRITELN ('IKI SAYININ CARPIMI =', CARPIM: 6: 2);
END;
WRITELN ('DEVAM ETMEK ISTIYORMUSUNUZ? E-H');
READLN (kontrol);
IF (kontrol='E') THEN
BEGIN
GOTO basla;
END
ELSE GOTO sonuc;
sonuc:
READLN;
END.
IF THEN ELSE
PROGRAM DENEME3;
Var sayi1, sayi2, toplam, carpim : real;
BEGIN
WRITELN('IKI GERCEK SAYI YAZINIZ');
READLN(sayi1);
READLN(sayi2);
toplam:= sayi1 + sayi2;
carpim:=sayi1 * sayi2;
If (toplam>50)
THEN
BEGIN
WRITELN('IKI SAYININ TOPLAMI='); END
ELSE
BEGIN
WRITELN('IKI SAYININ CARPIMI='); END;
READLN;
7 Ekim 2010 Perşembe
Faydalı Bağlantılar
http://www.freepascal.org
http://www.processing.org
http://formandcode.com/
http://dbn.media.mit.edu/
http://structuresynth.sourceforge.net/
http://www.processing.org
http://formandcode.com/
http://dbn.media.mit.edu/
http://structuresynth.sourceforge.net/
1 Ekim 2010 Cuma
uygulama
PROGRAM DENEME;
CONST PI = 3.14;
VAR a,b,c, HACIM: REAL
BEGIN
WRITELN('DIKDORTGENLER PRIZMASININ KENAR UZUNLUKLARINI GIRINIZ');
READLN(A);
READLN(B);
READLN(C);
HACIM := A * B * C;
WRITE(HACIM: 6:2);
READLN;
END
CONST PI = 3.14;
VAR a,b,c, HACIM: REAL
BEGIN
WRITELN('DIKDORTGENLER PRIZMASININ KENAR UZUNLUKLARINI GIRINIZ');
READLN(A);
READLN(B);
READLN(C);
HACIM := A * B * C;
WRITE(HACIM: 6:2);
READLN;
END
Kaydol:
Kayıtlar (Atom)