LATEST CODINGS

Added 14 Oct 2010
"Quick Math" My First SDP Mobile Application

heheheh....in da rush of finals..grrrrrrr..Duras first Industry standard mobile Application...yeah nw its working properly through Etisalate Network..No grabbing credits in dis Testings period..its 100% Free!!!
So friends dont hesitate..jst do a try!!!! >> ex: qm sqrt 4 >> 4499
thanx for testing...Refer da link for further info...
Read More

FACEBOOK Community Page : Join




 

                      Added 25 Sep 2010
My 1st Java ME : Hello World Project

yeah...its very very simple..cant believe...ya its working banzz

__________________

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class Hello extends MIDlet
{
   public Hello() {}
   public void pauseApp() {}
   public void destroyApp(boolean ignore) {}
   public void startApp()
   {
      Display.getDisplay(this).setCurrent(
         new TextBox("Hello", "The End", 9, 0));
   }
}

Added 13 Sep 2010
SICO LOVE CALCULATOR 1.0



[ Sico Preview :) ]
/*
(c) Dura Solutions. 13 Sep 2010

Sico Love Calculator 1.0  :)

Note :
hahahh..spending boring days..
just did dis for fun..
pls i beg your pardon if you have
any problems with those calculations..lol
few Pre-defined couple sets feeded to code.:D
so no harm done.calc 4 them is differ frm others..:)

Thanx a lot for Navodth Banuka for the idea.
Guys i need new ideas for programming..pls help me out.
thanx..elazzz....tc
*/

//_________Driver Class_____________

import java.util.Scanner;
class DriverDura{
    public static void main(String[]args){
    Scanner in=new Scanner(System.in);
  
    System.out.println("\n\n______________________________");
    System.out.println("\nSICO LOVE CALCULATOR 1.0");
    System.out.println("\tDura Solutions");
    System.out.println("______________________________\n\n");
      
    System.out.print("Enter the Boy's Name : ");
    String b=in.nextLine();
  
    System.out.print("\nEnter the Girl's Name : ");
    String g=in.nextLine();
  
    Algo A1=new Algo(b);
    int bv=A1.Calc();

    Algo A2=new Algo(g);
    int gv=A2.Calc();
  
    double iluv=(bv/(double)gv)*100;
  
    if(iluv>100){
        iluv=iluv/10;
        if(iluv>100) iluv=iluv/10;
    }
  
    // Pre-defined sliit couples...Im very sorry if i missed any couple..lol
  
    b=b.toLowerCase();g=g.toLowerCase();
  
    if (b.equals("madusha")    && g.equals("navodya")) iluv=100;
    if (b.equals("udesh")    && g.equals("geethika")) iluv=100;
    if (b.equals("kulitha")    && g.equals("janani")) iluv=100;
    if (b.equals("hansaja")    && g.equals("nirushi")) iluv=100;
    if (b.equals("dilshan")    && g.equals("udeshi" )) iluv=100;
      
    System.out.println("\n\nhahah...\nLove Calc of "+b+" and "+g+" is = "+(int)iluv);
  
    if(iluv>50)
    System.out.println("\nits Ok puthala..karan yan ohoma..:)\n");
    if(iluv<50)
    System.out.println("\naiiooo....puthala oya wade nam hariyanne na..:(\n");
    if(iluv==100)
    System.out.println("\noyala nam perfect aaah..:D\n");

    }
}

_________Algorithm Class_____________

class Algo{
String name;
   
public Algo(String na)
{
name=na;
}

public Algo()
{
name="";
}

public int Calc()
{
    int l=name.length();
    int v,tot=0;
   
    name=name.toLowerCase();
   
    for(int i=0;i<l;i++){
       
        char x=name.charAt(i);
   
        switch (x){
        case 'a' : v=1;break;
        case 'b' : v=2;break;
        case 'c' : v=3;break;
        case 'd' : v=4;break;
        case 'e' : v=5;break;
        case 'f' : v=6;break;
        case 'g' : v=7;break;
        case 'h' : v=8;break;
        case 'i' : v=9;break;
        case 'j' : v=10;break;
        case 'k' : v=11;break;
        case 'l' : v=12;break;
        case 'm' : v=13;break;
        case 'n' : v=14;break;
        case 'o' : v=15;break;
        case 'p' : v=16;break;
        case 'q' : v=17;break;
        case 'r' : v=18;break;
        case 's' : v=19;break;
        case 't' : v=20;break;
        case 'u' : v=21;break;
        case 'v' : v=22;break;
        case 'w' : v=23;break;
        case 'x' : v=24;break;
        case 'y' : v=25;break;
        case 'z' : v=26;break;
        default  : v=10;break;   
        }
   
    tot=tot+v;
    }
   
return tot;
}

}



Added 12 Sep 2010

C++ Coding Challenge @ Elakiri.com

Getting all the Partitions of any given Number (Note: contain repetition problem)

1.A partition of a positive integer n is a sequence of positive integers that sum to n. Implement the algorithm (in C) to print all non-increasing partitions of n.
eg. If n=4
4
3 1
2 2
2 1 1
1 1 1 1

Duras Solution.. :)

#include<iostream>
using namespace std;

int main(){

int x;
Begin:
cout<<"\n\nEnter a No : ";
cin>>x;

cout<<endl<<x<<endl;

int i,j,k,m;

for(i=x;i>0;i--){
    for(j=1;j<x;j++){

        if((i+j)==x)
        {
        cout<<i<<" "<<j<<endl;

        for(k=2;k<j;k++){
        for(m=j;m>0;m--){
        if((k+m)==j)
        cout<<i<<" "<<k<<" "<<m<<endl;
        }
        }

        if(j>1){
        cout<<i<<" ";
        for(k=0;k<j;k++) cout<<"1 ";
        cout<<endl; }

        }

    }
}

goto Begin;

} 

 

Tuck Tik Took (Version 2.0) Released. [More Powerful nw]

by Harsha සංජීව Siriwardena on Saturday, June 19, 2010 at 6:29pm

/*
All Rights Reserved.
Copyright(c) 2010 June 18
dURA Solutions.

Tuck Tik Took (Version 2.0)

Note :
Updated Version.Thanx Navodth Bhanuka,Dr.PHP and Pera 4 da ideas
May be the program looks crazy now.(with da effects of timers)
Now dURA can Offend and Defend :)
Consist with most of move lists.

TTT game have atleast 3!x8=3x2x1x8=48 Combinations in total.may be Even more.
still im trying to program all da moves lists and powerful da coding..
*/

#include<iostream>
#include <time.h>
#include <stdlib.h>

using namespace std;

int Check(char Ar[3][3]);
int checkLoss(char Ar[3][3]);
int checkAggMove(char Ar[3][3]);
void Wait(int seconds);
void Progress();
void ShowBoard(char Ar[3][3]);
void ComsMove(char Ar[3][3]);
void PlayerMove(char Ar[3][3]);
void RandomMove(char Ar[3][3]);
void AShowBoard(char Ar[3][3]);

int main()
{
Start:
cout<<"===================================\n";
cout<<" << Tuck Tik Took >> \n";
cout<<" [Version 2.0] \n";
cout<<"-----------------------------------\n";
cout<<" dURA(R) Solutions(C) 2010 June \n";
cout<<"===================================\n\n";
cout<<" dURA-O | Player-X\n\n";

char y;
char Ar[3][3]={'1','2','3','4','5','6','7','8','9'};

ShowBoard(Ar);

Begin:
int x=0;

//Players Move Functions
if (!(Ar[0][0]=='1' || Ar[0][1]=='2' || Ar[0][2]=='3' || Ar[1][0]=='4' || Ar[1][1]=='5' || Ar[1][2]=='6' || Ar[2][0]=='7' || Ar[2][1]=='8' || Ar[2][2]=='9'))
{cout<<"\nMatch Ends Up in a Draw !!!\n";
goto Last;}

PlayerMove(Ar);
cout<<"\n\n----- Players Move -------\n\n";
ShowBoard(Ar);

x=Check(Ar);
if(x==1 || x==2)
goto Last;

if (!(Ar[0][0]=='1' || Ar[0][1]=='2' || Ar[0][2]=='3' || Ar[1][0]=='4' || Ar[1][1]=='5' || Ar[1][2]=='6' || Ar[2][0]=='7' || Ar[2][1]=='8' || Ar[2][2]=='9'))
{cout<<"\nMatch Ends Up in a Draw !!!\n";
goto Last;}

Progress();

//Coms Move Functions
ComsMove(Ar);
cout<<"------- dURAs Move -------\n\n";
AShowBoard(Ar);
x=Check(Ar);
if(x==1 || x==2)
goto Last;

goto Begin;

Last:
cout<<"\n\nGame Over !! \n";
cout<<"\n\nDo Want to Play Again (y/n) : ";
cin>>y;
if(y=='y')
{system("cls");goto Start;}
else
return 0;
}

int Check(char Ar[3][3])
{
int x=0;

if (Ar[0][0]=='X' && Ar[0][1]=='X' && Ar[0][2]=='X') x=1;
if (Ar[1][0]=='X' && Ar[1][1]=='X' && Ar[1][2]=='X') x=1;
if (Ar[2][0]=='X' && Ar[2][1]=='X' && Ar[2][2]=='X') x=1;
if (Ar[0][0]=='X' && Ar[1][0]=='X' && Ar[2][0]=='X') x=1;
if (Ar[0][1]=='X' && Ar[1][1]=='X' && Ar[2][1]=='X') x=1;
if (Ar[0][2]=='X' && Ar[1][2]=='X' && Ar[2][2]=='X') x=1;
if (Ar[0][0]=='X' && Ar[1][1]=='X' && Ar[2][2]=='X') x=1;
if (Ar[2][0]=='X' && Ar[1][1]=='X' && Ar[0][2]=='X') x=1;

if (Ar[0][0]=='O' && Ar[0][1]=='O' && Ar[0][2]=='O') x=2;
if (Ar[1][0]=='O' && Ar[1][1]=='O' && Ar[1][2]=='O') x=2;
if (Ar[2][0]=='O' && Ar[2][1]=='O' && Ar[2][2]=='O') x=2;
if (Ar[0][0]=='O' && Ar[1][0]=='O' && Ar[2][0]=='O') x=2;
if (Ar[0][1]=='O' && Ar[1][1]=='O' && Ar[2][1]=='O') x=2;
if (Ar[0][2]=='O' && Ar[1][2]=='O' && Ar[2][2]=='O') x=2;
if (Ar[0][0]=='O' && Ar[1][1]=='O' && Ar[2][2]=='O') x=2;
if (Ar[2][0]=='O' && Ar[1][1]=='O' && Ar[0][2]=='O') x=2;

if(x==1)
cout<<"\n\nPlayer Wins the Game!!! \n";
else if(x==2)
cout<<"\n\ndURA Wins the Game!!! \n";

return x;
}

void RandomMove(char Ar[3][3])
{int i,j;

if(Ar[1][1]=='5')
{Ar[1][1]='O';
goto last;}

for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
if (Ar[i][j]=='1' || Ar[i][j]=='2' || Ar[i][j]=='3' || Ar[i][j]=='4' || Ar[i][j]=='5' || Ar[i][j]=='6' || Ar[i][j]=='7' || Ar[i][j]=='8' || Ar[i][j]=='9')
{Ar[i][j]='O';
goto last;}
}
}
last:
cout<<"";
}

void Progress()
{
cout<<"\n\dURA is Thinking... ";
for(int i=0;i<5;i++)
{cout<<">";
Wait(1);}
cout<<"\n\nOK!! Friend";
Wait(1);
cout<<"\ndURA got the Point..!!\n";
Wait(2);
}

void ComsMove(char Ar[3][3])
{
int Ans;

Ans=checkAggMove(Ar);
if (Ans==1)
goto skip;

Ans=checkLoss(Ar);
if (Ans==1)
goto skip;

RandomMove(Ar);

skip:
cout<<"\n";
}

void Wait(int seconds)
{//BTW I dont know WTF Process :(
clock_t endwait;
endwait = clock () + seconds * CLK_TCK ;
while (clock() < endwait) {}
}

int checkAggMove(char Ar[3][3])
{
int Flag=0;

if (Ar[0][0]=='O' && Ar[1][0]=='O' && Ar[2][0]=='7') {Ar[2][0]='O';Flag=1;goto last;}
if (Ar[0][0]=='O' && Ar[2][0]=='O' && Ar[1][0]=='4') {Ar[1][0]='O';Flag=1;goto last;}
if (Ar[1][0]=='O' && Ar[2][0]=='O' && Ar[0][0]=='1') {Ar[2][0]='O';Flag=1;goto last;}

if (Ar[0][1]=='O' && Ar[1][1]=='O' && Ar[2][1]=='8') {Ar[2][1]='O';Flag=1;goto last;}
if (Ar[0][0]=='O' && Ar[2][1]=='O' && Ar[1][1]=='5') {Ar[1][1]='O';Flag=1;goto last;}
if (Ar[1][1]=='O' && Ar[2][1]=='O' && Ar[0][1]=='2') {Ar[0][1]='O';Flag=1;goto last;}

if (Ar[0][2]=='O' && Ar[1][2]=='O' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}
if (Ar[0][2]=='O' && Ar[2][2]=='O' && Ar[1][2]=='6') {Ar[1][2]='O';Flag=1;goto last;}
if (Ar[1][2]=='O' && Ar[2][2]=='O' && Ar[0][2]=='3') {Ar[0][2]='O';Flag=1;goto last;}

//Columns
if (Ar[0][0]=='O' && Ar[0][1]=='O' && Ar[0][2]=='3') {Ar[0][2]='O';Flag=1;goto last;}
if (Ar[0][0]=='O' && Ar[0][2]=='O' && Ar[0][1]=='2') {Ar[0][1]='O';Flag=1;goto last;}
if (Ar[0][1]=='O' && Ar[0][2]=='O' && Ar[0][0]=='1') {Ar[0][0]='O';Flag=1;goto last;}

if (Ar[1][0]=='O' && Ar[1][1]=='O' && Ar[1][2]=='6') {Ar[1][2]='O';Flag=1;goto last;}
if (Ar[1][0]=='O' && Ar[1][2]=='O' && Ar[1][1]=='5') {Ar[1][1]='O';Flag=1;goto last;}
if (Ar[1][1]=='O' && Ar[1][2]=='O' && Ar[1][0]=='4') {Ar[1][0]='O';Flag=1;goto last;}

if (Ar[2][0]=='O' && Ar[2][1]=='O' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}
if (Ar[2][0]=='O' && Ar[2][2]=='O' && Ar[2][1]=='8') {Ar[2][1]='O';Flag=1;goto last;}
if (Ar[2][1]=='O' && Ar[2][2]=='O' && Ar[2][0]=='7') {Ar[2][0]='O';Flag=1;goto last;}

//Axels
if (Ar[0][0]=='O' && Ar[1][1]=='O' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}
if (Ar[0][0]=='O' && Ar[2][2]=='O' && Ar[1][1]=='5') {Ar[1][1]='O';Flag=1;goto last;}
if (Ar[1][1]=='O' && Ar[2][2]=='O' && Ar[0][0]=='1') {Ar[0][0]='O';Flag=1;goto last;}

if (Ar[0][2]=='O' && Ar[1][1]=='O' && Ar[2][0]=='7') {Ar[2][0]='O';Flag=1;goto last;}
if (Ar[0][2]=='O' && Ar[2][0]=='O' && Ar[1][1]=='5') {Ar[1][1]='O';Flag=1;goto last;}
if (Ar[2][0]=='O' && Ar[1][1]=='O' && Ar[0][2]=='3') {Ar[0][2]='O';Flag=1;goto last;}

last:
return Flag;
}

int checkLoss(char Ar[3][3])
{
int Flag=0;
//Duras Combinations Of TTT

if(Ar[1][1]=='5')
{Ar[1][1]='O';Flag=1;goto last;}

//Rows
if (Ar[0][0]=='X' && Ar[1][0]=='X' && Ar[2][0]=='7') {Ar[2][0]='O';Flag=1;goto last;}
if (Ar[0][0]=='X' && Ar[2][0]=='X' && Ar[1][0]=='4') {Ar[1][0]='O';Flag=1;goto last;}
if (Ar[1][0]=='X' && Ar[2][0]=='X' && Ar[0][0]=='1') {Ar[2][0]='O';Flag=1;goto last;}

if (Ar[0][1]=='X' && Ar[1][1]=='X' && Ar[2][1]=='8') {Ar[2][1]='O';Flag=1;goto last;}
if (Ar[0][0]=='X' && Ar[2][1]=='X' && Ar[1][1]=='5') {Ar[1][1]='O';Flag=1;goto last;}
if (Ar[1][1]=='X' && Ar[2][1]=='X' && Ar[0][1]=='2') {Ar[0][1]='O';Flag=1;goto last;}

if (Ar[0][2]=='X' && Ar[1][2]=='X' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}
if (Ar[0][2]=='X' && Ar[2][2]=='X' && Ar[1][2]=='6') {Ar[1][2]='O';Flag=1;goto last;}
if (Ar[1][2]=='X' && Ar[2][2]=='X' && Ar[0][2]=='3') {Ar[0][2]='O';Flag=1;goto last;}

//Columns
if (Ar[0][0]=='X' && Ar[0][1]=='X' && Ar[0][2]=='3') {Ar[0][2]='O';Flag=1;goto last;}
if (Ar[0][0]=='X' && Ar[0][2]=='X' && Ar[0][1]=='2') {Ar[0][1]='O';Flag=1;goto last;}
if (Ar[0][1]=='X' && Ar[0][2]=='X' && Ar[0][0]=='1') {Ar[0][0]='O';Flag=1;goto last;}

if (Ar[1][0]=='X' && Ar[1][1]=='X' && Ar[1][2]=='6') {Ar[1][2]='O';Flag=1;goto last;}
if (Ar[1][0]=='X' && Ar[1][2]=='X' && Ar[1][1]=='5') {Ar[1][1]='O';Flag=1;goto last;}
if (Ar[1][1]=='X' && Ar[1][2]=='X' && Ar[1][0]=='4') {Ar[1][0]='O';Flag=1;goto last;}

if (Ar[2][0]=='X' && Ar[2][1]=='X' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}
if (Ar[2][0]=='X' && Ar[2][2]=='X' && Ar[2][1]=='8') {Ar[2][1]='O';Flag=1;goto last;}
if (Ar[2][1]=='X' && Ar[2][2]=='X' && Ar[2][0]=='7') {Ar[2][0]='O';Flag=1;goto last;}

//Axels
if (Ar[0][0]=='X' && Ar[1][1]=='X' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}
if (Ar[0][0]=='X' && Ar[2][2]=='X' && Ar[1][1]=='5') {Ar[1][1]='O';Flag=1;goto last;}
if (Ar[1][1]=='X' && Ar[2][2]=='X' && Ar[0][0]=='1') {Ar[0][0]='O';Flag=1;goto last;}

if (Ar[0][2]=='X' && Ar[1][1]=='X' && Ar[2][0]=='7') {Ar[2][0]='O';Flag=1;goto last;}
if (Ar[0][2]=='X' && Ar[2][0]=='X' && Ar[1][1]=='5') {Ar[1][1]='O';Flag=1;goto last;}
if (Ar[2][0]=='X' && Ar[1][1]=='X' && Ar[0][2]=='3') {Ar[0][2]='O';Flag=1;goto last;}

//checkUpsetMoves

//Salutes 4 Navodth Bhanuka.... :)
if (Ar[0][0]=='X' && Ar[2][2]=='X' && Ar[2][0]=='7') {Ar[2][0]='O';Flag=1;goto last;}
if (Ar[0][0]=='X' && Ar[2][2]=='X' && Ar[0][2]=='3') {Ar[0][2]='O';Flag=1;goto last;}

if (Ar[2][0]=='X' && Ar[0][2]=='X' && Ar[0][0]=='1') {Ar[0][0]='O';Flag=1;goto last;}
if (Ar[2][0]=='X' && Ar[0][2]=='X' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}

if (Ar[0][0]=='X' && Ar[0][2]=='3') {Ar[0][2]='O';Flag=1;goto last;}
if (Ar[0][0]=='X' && Ar[2][0]=='7') {Ar[2][0]='O';Flag=1;goto last;}
if (Ar[2][2]=='X' && Ar[0][2]=='3') {Ar[0][2]='O';Flag=1;goto last;}
if (Ar[2][2]=='X' && Ar[2][0]=='7') {Ar[2][0]='O';Flag=1;goto last;}

if (Ar[0][2]=='X' && Ar[0][0]=='1') {Ar[0][0]='O';Flag=1;goto last;}
if (Ar[0][2]=='X' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}
if (Ar[2][0]=='X' && Ar[0][0]=='1') {Ar[0][0]='O';Flag=1;goto last;}
if (Ar[2][0]=='X' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}

/////////////////////

if (Ar[0][0]=='O' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}
if (Ar[0][2]=='O' && Ar[2][0]=='7') {Ar[2][0]='O';Flag=1;goto last;}
if (Ar[2][0]=='O' && Ar[0][2]=='3') {Ar[0][2]='O';Flag=1;goto last;}
if (Ar[2][2]=='O' && Ar[0][0]=='1') {Ar[0][0]='O';Flag=1;goto last;}

/*
00 01 02 | 1 2 3
10 11 12 | 4 5 6
20 21 22 | 7 8 9
*/

if (Ar[0][0]=='X' && Ar[2][2]=='X' && Ar[2][1]=='8') {Ar[2][1]='O';Flag=1;goto last;}
if (Ar[0][0]=='X' && Ar[2][2]=='X' && Ar[0][1]=='2') {Ar[0][1]='O';Flag=1;goto last;}
if (Ar[0][0]=='X' && Ar[2][2]=='X' && Ar[1][0]=='4') {Ar[1][0]='O';Flag=1;goto last;}
if (Ar[0][0]=='X' && Ar[2][2]=='X' && Ar[1][2]=='6') {Ar[1][0]='O';Flag=1;goto last;}

if (Ar[2][0]=='O' && Ar[0][2]=='O' && Ar[2][2]=='9') {Ar[2][2]='O';Flag=1;goto last;}
if (Ar[2][0]=='O' && Ar[0][2]=='O' && Ar[0][0]=='1') {Ar[0][0]='O';Flag=1;goto last;}

// ............

last:
return Flag;
}

void AShowBoard(char Ar[3][3])
{
cout<<"-------------\n";Wait(1);
cout<<"| "<<Ar[0][0]<<" | "<<Ar[0][1]<<" | "<<Ar[0][2]<<" |\n";Wait(1);
cout<<"-------------\n";Wait(1);
cout<<"| "<<Ar[1][0]<<" | "<<Ar[1][1]<<" | "<<Ar[1][2]<<" |\n";Wait(1);
cout<<"-------------\n";Wait(1);
cout<<"| "<<Ar[2][0]<<" | "<<Ar[2][1]<<" | "<<Ar[2][2]<<" |\n";Wait(1);
cout<<"-------------\n";Wait(1);
}

void ShowBoard(char Ar[3][3])
{
cout<<"-------------\n";
cout<<"| "<<Ar[0][0]<<" | "<<Ar[0][1]<<" | "<<Ar[0][2]<<" |\n";
cout<<"-------------\n";
cout<<"| "<<Ar[1][0]<<" | "<<Ar[1][1]<<" | "<<Ar[1][2]<<" |\n";
cout<<"-------------\n";
cout<<"| "<<Ar[2][0]<<" | "<<Ar[2][1]<<" | "<<Ar[2][2]<<" |\n";
cout<<"-------------\n";
}

void PlayerMove(char Ar[3][3])
{
int r,c;
int move;

begin:
cout<<"\nPlayers Turn,\nEnter the Position : ";
cin>>move;

switch (move)
{
case 1 : r=0;c=0;break;
case 2 : r=0;c=1;break;
case 3 : r=0;c=2;break;
case 4 : r=1;c=0;break;
case 5 : r=1;c=1;break;
case 6 : r=1;c=2;break;
case 7 : r=2;c=0;break;
case 8 : r=2;c=1;break;
case 9 : r=2;c=2;break;
default : cout<<"\nIllegal move!!!\n";goto begin;break;
}

if (Ar[r][c]=='O' || Ar[r][c]=='X')
{cout<<"Illegal move,This Position is Reserved !!!!\n";
goto begin;}
else
Ar[r][c]='X';

}