Untitled

                Never    
C++
       
#include <iostream>
#include <conio.h>
#include <time.h>
#include <windows.h>
using namespace std;

void gotoxy(int x, int y)
{
    COORD coord; // coordinates
    coord.X = x; coord.Y = y; // X and Y coordinates
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}

void cerceve(int x1, int y1, int x2, int y2)
{
    int i,j;
    for(i=x1;i<=x2;i++)
    {
        gotoxy(i,y1); cout<<"-", 196;
        gotoxy(i,y2); cout<<"-", 196;
    }

    for(j=y1;j<=y2;j++)
    {
        gotoxy(x1,j); cout<<"|", 179;
        gotoxy(x2,j); cout<<"|", 179;
    }

    gotoxy(x1,y1); cout<<"-", 218;
    gotoxy(x1,y2); cout<<"-", 192;
    gotoxy(x2,y1); cout<<"-", 191;
    gotoxy(x2,y2); cout<<"-", 217;
}

void jackpot(int sans)
{
    cerceve(5,5,75,22);
    cerceve(10,10,25,20);
    cerceve(30,10,45,20);
    cerceve(50,10,65,20);

    int seed = time(NULL);
    srand(seed);
    int a=rand()%8+1;
    int b=rand()%8+1;
    int c=rand()%8+1;

    gotoxy(18,15); cout<<""<< a;
    gotoxy(38,15); cout<<""<< b;
    gotoxy(58,15); cout<<""<< c;

    if((a==b)&&(b==c))
    {
        gotoxy(30,7); cout<<"  !JACKPOT!->%d"<< sans;
    }
    else if((a==b)||(b==c)||(a==c))
    {
        gotoxy(30,7); cout<<"   iyi deneme";
    }
    else
    {
        gotoxy(30,7); cout<<"   kotu sans!";
    }
    ++sans;
}

main()
{
    char tus;
    void jackpot(int sans);
    int sans = 1;

    do
    {
        jackpot(sans);
        ++sans;
        tus=getch();
    }
    while(tus!=27);
}

Raw Text