program ZarAtmaOyunu implicit none real :: oyuncuZar1, oyuncuZar2, sistemZar1, sistemZar2 integer :: toplamOyuncuZar, toplamSistemZar character(20) :: komut ! Oyuncu için rastgele iki zar at call random_seed() call random_number(oyuncuZar1) call random_number(oyuncuZar2) oyuncuZar1 = 1 + int(6 * oyuncuZar1) ! 1 ile 6 arasında bir sayı oyuncuZar2 = 1 + int(6 * oyuncuZar2) ! 1 ile 6 arasında bir sayı toplamOyuncuZar = oyuncuZar1 + oyuncuZar2 ! Sistem için rastgele iki zar at call random_number(sistemZar1) call random_number(sistemZar2) sistemZar1 = 1 + int(6 * sistemZar1) ! 1 ile 6 arasında bir sayı sistemZar2 = 1 + int(6 * sistemZar2) ! 1 ile 6 arasında bir sayı toplamSistemZar = sistemZar1 + sistemZar2 ! Oyuncunun komutunu al print *, "Komut girin (örn. /zarat): " read(*,*) komut ! Komut kontrolü if (trim(komut) == "zarat") then ! Sonuçları göster print *, "Oyuncu Zarları?:" print *, " ", oyuncuZar1 print *, " ", oyuncuZar2 print *, "Toplam: ", toplamOyuncuZar print *, "Sistem Zarları?:" print *, " ", sistemZar1 print *, " ", sistemZar2 print *, "Toplam: ", toplamSistemZar if (toplamOyuncuZar > toplamSistemZar) then print *, "KAZANDIN!!!" else if (toplamOyuncuZar < toplamSistemZar) then print *, "KAYBETTİN!!!" else print *, "Berabere!" end if else print *, "Geçersiz komut!" end if end program ZarAtmaOyunu