NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <stdio.h>
#include <stdlib.h>


#include <time.h>

int puan=250; // Başlangıc puanı atadık.
int i; //Degişkenleri atadık.
int j;//Degişkenleri atadık.
int say; //Degişkenleri atadık.
int rs1,rs2,rs3,rs4; //bilgisayarin rastgele olusturacagı sayılar
int k1,k2,k3,k4;// kullanıcını girecegi sayılar

int cark_cevir(){ //cark_cevir fonksiyonu olusturduk.


srand(time(NULL));
int cark=rand()%6+1; //random sayi uretti. 0 değerinin de olamaması için 1 ekledik.
return cark; //Deger dondurduk
}
int sayi_uret(){ //sayi_uret fonksiyonu olusturuldu.

srand(time(NULL));
int cark=rand()%10+1; //random sayi uretti. 0 değerinin olamaması için 1 ekledik.
return cark; //Deger dondurduk.
}
int tahmin_gir(){ //4 tane deger aldık.

printf("1 ile 10 arasinda 4 tane deger giriniz:"); // kullanıcı 4 tane deger girdi.
scanf("%d" "%d" "%d" "%d",&k1,&k2,&k3,&k4); // kullanıcıdan girilen degerleri okuduk.
int kar;
if(k1==rs1 || k2==rs1 || k3==rs1 || k4==rs1){
kar++;// Kullanıcıdan girilen sayi ile bilgisayarın aldığı sayıları karşilaştirdik.
}
if(k1==rs2 || k2==rs2 || k3==rs2 || k4==rs2){
kar++;// Kullanıcıdan girilen sayi ile bilgisayarın aldığı sayıları karşilaştirdik.
}
if(k1==rs3 || k2==rs3 || k3==rs3 || k4==rs3){
kar++;// Kullanıcıdan girilen sayi ile bilgisayarın aldığı sayıları karşilaştirdik.
}
if(k1==rs4 || k2==rs4 || k3==rs4 || k4==rs4){ kar++;// Kullanıcıdan girilen sayi ile bilgisayarın aldığı sayıları karşilaştirdik.
}
}

int main(int argc, char *argv[]) {
int ortak;

char kontrol;
printf("Oyuna baslamak icin c ye, cikmak icin s ye bas. n");
scanf(" %c",& kontrol); // Kullanıcının girdigi degeri kontrol ettik.
while(kontrol=='c'){ // c girmisse oyuna devam etmesine verildi.


switch(cark_cevir()){ //carktaki degerleri atadık. 1 50 puanı,2 100 puanı,3 250 puanı, 4 pas, 5 iflas, 6 ise puan düşürmeyi temsil ediyor.
case 1:
ortak=1;
break;
case 2:
ortak=2;
break;
case 3:
ortak=3;
break;
case 4:
ortak=4;
break;
case 5:
ortak=5;
break;
case 6:
ortak=6;
break;
default:
puts("Yanlis secim! n");
}
if (ortak==4){
printf("Pas geldi n");
printf("Puaniniz %d n",puan);
}
else if(ortak==5){
printf("Gecmis olsun. iflas geldi n");
puan=0;
printf("Puaniniz %d n",puan);
}
else if(ortak==6){
printf("Puan azaltma geldi. Puaniniz azaltilacak.n");
puan=(puan*3.0)/4;
printf("Puaniniz %d n",puan);
}
else{ //pas,iflas ve puan azaltmanin disindaki durumlarda

puts("Yanlis secim! n");
}


if(say==1){
puan=puan+50;
printf("50 puan geldi n");
printf("Puaniniz %d n",puan);
}
else if(say==2){
puan=puan+100;
printf("100 puan geldi");
printf("Puaniniz %d n",puan);
}
else if(say==3){
puan=puan+250;
printf("250 puan geldi");
printf("Puaniniz %d n",puan);
}
else{
printf("tahminleriniz tutmadi. Puaniniz degismedi. n");
printf("Puaniniz %d n n",puan);
}



if(puan==0){

}
printf("Oyuna baslamak icin c ye, cikmak icin s ye bas. n");
scanf("%c",&kontrol); //Enter "i giris aldigi icin iki kere sorgulamak zorunda kaldik.
scanf("%c",&kontrol);
}

return 0;
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.