#include <iostream>
#include <cstdlib>
#include <time.h>
#include <conio.h>
#include <stdlib.h>
using namespace std;
int angka;
int kocokdadu()
{
srand (time(NULL));
angka = rand() % 6;
}
int main()
{
int tebak;
char pilihan;
do
{
system("cls");
cout<<"-----dadu------\n\n";
kocokdadu();
cout<<"Dice ready, guess number of dice : ";
cin>>tebak;
if (angka == tebak)
{
cout<<"Congragulation !\nYour guess correct!\n";
cout<<"\nTry Again ? (y/n)";
cin>>pilihan;
}
else
{
cout<<"You Wrong !\n";
cout<<"\nTry Again ? (y/n) : ";
cin>>pilihan;
}
}
while(pilihan=='y');
getch();
}
Aplikasi bisa di download
Klik Download
Tutorialnya
Download Tutorial
Download Tutorial