Jump to content

Akış Şeması Veya C Hakkında Bilgi


GokhanArilik
 Share

Recommended Posts

turtle = top
2 rabbit = top
3
4 steps_taken = 0
5 step_limit = 2
6
7 forever:
8 if rabbit == end:
9 return 'No Loop Found'
10 rabbit = rabbit.next
11
12 steps_taken += 1
13
14 if rabbit == turtle:
15 return 'Loop found'
16
17 if steps_taken == step_limit:
18 steps_taken = 0
19 step_limit *= 2
20 // teleport the turtle
21 turtle = rabbit

Link to comment
Share on other sites

Tamam oyunun kodları şöyle olacak:

#include <stdio.h>
#include <stdlib.h>
char turtlefonksiyon(int);
int main(int argc, char** argv) {

char rbosluk1[81]=" ";
char rbosluk2[81]=" ";
char rbosluk3[81]=" ";
char rbosluk6[81]=" ";
char b[2]="r";
int z=0;

printf(turtlefonksiyon(z));



return (EXIT_SUCCESS);
}
char turtlefonksiyon(int z)
{
char a[2]="t";
char tbosluk1[81]=" ";
char tbosluk2[81]=" ";
char tbosluk3[81]=" ";
int count=0;
for(count;count<15;count++)
{
z=rand()%6+1;
printf("%i",z);
if (z==1)
{
printf("%s",tbosluk1);
}
if (z==2)
{
printf("%s",tbosluk2);
}
if (z==3)
{
printf("%s",tbosluk3);
}
}
printf("%s\n",a);
return z;
}

Link to comment
Share on other sites

Bende üniversite 1. sınıftayken gördüm bu dersi fazla da hatırlamıyorum ama bundan basit nasıl yazarım bilemedim. Yazdığım kodlar alıntı bu arada.

tavşan i, turtle j, i=j=0 ile başla. 
zar at. ör. tavşan için 3 geldiyse:
rabbit[i]=' '; 
i=i+3; 
rabbit[i]='r';
sırayla yapacaksın bunu. ta ki i veya j'den hangisi önce 80 olursa. 
bu kadar
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...