1. 1.
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    5. include<stdio.h>
    6. include<conio.h>
    7. include<stdlib.h>
    8. include<time.h>

    struct yilan{
    int x,y;
    };
    int len=4;
    int score=0;
    int col=20,row=10;
    char map[20][40];
    int tamammi_devammi(struct yilan snake[]){
    int i,k1=0,k2=0;
    if(snake[0].x

    0||snake[0].x

    19||snake[0].y

    0||snake[0].y

    39){
    k1=1;
    }
    for(i=1;i<len;i++){
    if(snake[0].x

    snake[i].x&&snake[0].y

    snake[i].y){
    k2=1;
    break;
    }
    }
    if(k1

    1||k2

    1) return 1;
    else return 0;
    }

    void yemleme(){
    srand(time(NULL));
    row=rand()%18+1;
    col=rand()%38+1;
    }
    void yem(char dizi[20][40],struct yilan snake[]){
    if(snake[len-1].x

    row&&snake[len-1].y

    col){
    snake[len].x=row;
    snake[len].y=col;
    len++;
    score=score+100;
    yemleme();
    printf("a");

    }
    }
    void duvar(char dizi[20][40]){
    int i,j;
    for(i=0;i<20;i++){
    if(i

    0||i

    19){
    for(j=0;j<40;j++){
    dizi[i][j]='=';
    }
    }
    else{
    dizi[i][0]='|';
    for(j=1;j<39;j++){
    dizi[i][j]=' ';
    }
    dizi[i][39]='|';
    }

    }
    map[row][col]='x';
    }
    void ciz(char dizi[20][40]){
    system("CLS");
    printf("Score: %dn",score);
    int i,j;
    for(i=0;i<20;i++){
    for(j=0;j<40;j++){
    printf("%c",dizi[i][j]);
    }
    printf("n");
    }

    }
    void baslangic(struct yilan yil[]){
    yil[0].x=1;
    yil[0].y=4;
    yil[1].x=1;
    yil[1].y=3;
    yil[2].x=1;
    yil[2].y=2;
    yil[3].x=1;
    yil[3].y=1;
    }
    void yilan (char dizi[20][40],struct yilan yil[]){
    yem(map,yil);
    int i;
    for(i=0;i<len;i++){
    dizi[yil[i].x][yil[i].y]='*';
    }
    }
    void sag(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].y++;
    }
    void sol(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].y--;
    }
    void yukari(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].x--;
    }
    void asagi(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].x++;

    }




    int main(){

    char right='d';
    char left='a';
    char up='w';
    char down='s';
    char yon;
    long i;
    int kontrol=0;
    struct yilan snake[100];

    duvar(map);
    baslangic(snake);
    yilan(map, snake);
    ciz(map);

    while(1){
    yon=getch();
    i=0;

    if(yon

    right){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    ciz(map);
    kontrol=1;
    break;

    }

    sag(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }

    }
    else if(yon

    left){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    ciz(map);
    kontrol=1;
    break;
    }
    sol(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }
    }
    else if(yon

    up){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    ciz(map);
    kontrol=1;
    break;
    }
    yukari(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }
    }
    else if(yon

    down){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    kontrol=1;
    ciz(map);
    kontrol=1;
    break;
    }
    asagi(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }
    }
    if(kontrol==1) break;


    }



    getch();
    ···
  1. 2.
    0
    vay amk kalmayacak artık böyle başlıklar
    ···
  2. 3.
    0
    c++ kodu mu veriyon amk
    ···
  3. 4.
    +1
    ananın amından zahmet edip çıktın gönlün olsun diye kopyala yapıştır yapıyorum al

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    9. include<stdio.h>
    10. include<conio.h>
    11. include<stdlib.h>
    12. include<time.h>

    struct yilan{
    int x,y;
    };
    int len=4;
    int score=0;
    int col=20,row=10;
    char map[20][40];
    int tamammi_devammi(struct yilan snake[]){
    int i,k1=0,k2=0;
    if(snake[0].x

    0||snake[0].x

    19||snake[0].y

    0||snake[0].y

    39){
    k1=1;
    }
    for(i=1;i<len;i++){
    if(snake[0].x

    snake[i].x&&snake[0].y

    snake[i].y){
    k2=1;
    break;
    }
    }
    if(k1

    1||k2

    1) return 1;
    else return 0;
    }

    void yemleme(){
    srand(time(NULL));
    row=rand()%18+1;
    col=rand()%38+1;
    }
    void yem(char dizi[20][40],struct yilan snake[]){
    if(snake[len-1].x

    row&&snake[len-1].y

    col){
    snake[len].x=row;
    snake[len].y=col;
    len++;
    score=score+100;
    yemleme();
    printf("a");

    }
    }
    void duvar(char dizi[20][40]){
    int i,j;
    for(i=0;i<20;i++){
    if(i

    0||i

    19){
    for(j=0;j<40;j++){
    dizi[i][j]='=';
    }
    }
    else{
    dizi[i][0]='|';
    for(j=1;j<39;j++){
    dizi[i][j]=' ';
    }
    dizi[i][39]='|';
    }

    }
    map[row][col]='x';
    }
    void ciz(char dizi[20][40]){
    system("CLS");
    printf("Score: %dn",score);
    int i,j;
    for(i=0;i<20;i++){
    for(j=0;j<40;j++){
    printf("%c",dizi[i][j]);
    }
    printf("n");
    }

    }
    void baslangic(struct yilan yil[]){
    yil[0].x=1;
    yil[0].y=4;
    yil[1].x=1;
    yil[1].y=3;
    yil[2].x=1;
    yil[2].y=2;
    yil[3].x=1;
    yil[3].y=1;
    }
    void yilan (char dizi[20][40],struct yilan yil[]){
    yem(map,yil);
    int i;
    for(i=0;i<len;i++){
    dizi[yil[i].x][yil[i].y]='*';
    }
    }
    void sag(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].y++;
    }
    void sol(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].y--;
    }
    void yukari(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].x--;
    }
    void asagi(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].x++;

    }




    int main(){

    char right='d';
    char left='a';
    char up='w';
    char down='s';
    char yon;
    long i;
    int kontrol=0;
    struct yilan snake[100];

    duvar(map);
    baslangic(snake);
    yilan(map, snake);
    ciz(map);

    while(1){
    yon=getch();
    i=0;

    if(yon

    right){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    ciz(map);
    kontrol=1;
    break;

    }

    sag(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }

    }
    else if(yon

    left){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    ciz(map);
    kontrol=1;
    break;
    }
    sol(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }
    }
    else if(yon

    up){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    ciz(map);
    kontrol=1;
    break;
    }
    yukari(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }
    }
    else if(yon

    down){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    kontrol=1;
    ciz(map);
    kontrol=1;
    break;
    }
    asagi(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }
    }
    if(kontrol==1) break;


    }



    getch();
    Tümünü Göster
    ···
  4. 5.
    0
    yılan oyunu programı mı lan o :D yanlız ekran yamuk dıbına koduğum
    ···
  5. 6.
    0
    şimdi kodunu al ve gibtir git
    ···
  6. 7.
    0
    allah razı olsun pampa yılan falan görünce pek ihtimal vermemiştim amaişe yarıomuş ya lan OBAAAAAAAAAAAAAAAAAAAAAAA
    ···
  7. 8.
    0
    1. NESiL OLDUM YA LAAAAAAAAN!
    ···
  8. 9.
    0
    herif snake kodunu yazmıs lan ahahahaha
    ···
  9. 10.
    0
    nereye yapıştırıyoruz lan bunu
    ···
  10. 11.
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    13. include<stdio.h>
    14. include<conio.h>
    15. include<stdlib.h>
    16. include<time.h>

    struct yilan{
    int x,y;
    };
    int len=4;
    int score=0;
    int col=20,row=10;
    char map[20][40];
    int tamammi_devammi(struct yilan snake[]){
    int i,k1=0,k2=0;
    if(snake[0].x

    0||snake[0].x

    19||snake[0].y

    0||snake[0].y

    39){
    k1=1;
    }
    for(i=1;i<len;i++){
    if(snake[0].x

    snake[i].x&&snake[0].y

    snake[i].y){
    k2=1;
    break;
    }
    }
    if(k1

    1||k2

    1) return 1;
    else return 0;
    }

    void yemleme(){
    srand(time(null));
    row=rand()%18+1;
    col=rand()%38+1;
    }
    void yem(char dizi[20][40],struct yilan snake[]){
    if(snake[len-1].x

    row&&snake[len-1].y

    col){
    snake[len].x=row;
    snake[len].y=col;
    len++;
    score=score+100;
    yemleme();
    printf("a");

    }
    }
    void duvar(char dizi[20][40]){
    int i,j;
    for(i=0;i<20;i++){
    if(i

    0||i

    19){
    for(j=0;j<40;j++){
    dizi[i][j]='=';
    }
    }
    else{
    dizi[i][0]='|';
    for(j=1;j<39;j++){
    dizi[i][j]=' ';
    }
    dizi[i][39]='|';
    }

    }
    map[row][col]='x';
    }
    void ciz(char dizi[20][40]){
    system("cls");
    printf("score: %dn",score);
    int i,j;
    for(i=0;i<20;i++){
    for(j=0;j<40;j++){
    printf("%c",dizi[i][j]);
    }
    printf("n");
    }

    }
    void baslangic(struct yilan yil[]){
    yil[0].x=1;
    yil[0].y=4;
    yil[1].x=1;
    yil[1].y=3;
    yil[2].x=1;
    yil[2].y=2;
    yil[3].x=1;
    yil[3].y=1;
    }
    void yilan (char dizi[20][40],struct yilan yil[]){
    yem(map,yil);
    int i;
    for(i=0;i<len;i++){
    dizi[yil[i].x][yil[i].y]='*';
    }
    }
    void sag(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].y++;
    }
    void sol(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].y--;
    }
    void yukari(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].x--;
    }
    void asagi(struct yilan snake[],int uzunluk){
    int i;
    for(i=uzunluk-1;i>0;i--){
    snake[i].x=snake[i-1].x;
    snake[i].y=snake[i-1].y;
    }
    snake[0].x++;

    }

    int main(){

    char right='d';
    char left='a';
    char up='w';
    char down='s';
    char yon;
    long i;
    int kontrol=0;
    struct yilan snake[100];

    duvar(map);
    baslangic(snake);
    yilan(map, snake);
    ciz(map);

    while(1){
    yon=getch();
    i=0;

    if(yon

    right){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    ciz(map);
    kontrol=1;
    break;

    }

    sag(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }

    }
    else if(yon

    left){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    ciz(map);
    kontrol=1;
    break;
    }
    sol(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }
    }
    else if(yon

    up){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    ciz(map);
    kontrol=1;
    break;
    }
    yukari(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }
    }
    else if(yon

    down){
    while(i<100000){
    if(i%2000

    0){
    if(tamammi_devammi(snake)){
    kontrol=1;
    ciz(map);
    kontrol=1;
    break;
    }
    asagi(snake,len);
    duvar(map);
    yilan(map, snake);
    ciz(map);
    }
    i++;
    if(kbhit()) break;
    }
    }
    if(kontrol==1) break;

    }

    getch();
    Tümünü Göster
    ···