Tuesday, May 6, 2014

Program C# : Games Tic Tac Toe

First , open application c# ex. visual basic , sharp develop . In this case , i use Sharp develop . You can search it google if you want to download it .

Second step, make a project ,choose File . . . . New . . . . Solution 
Third step , design it , choose View . . . . Tools (To show the tool box) ,
NB: Red line . . . . . . thats all the tool box u can insert it . ex like i use picturebox, radiobutton,checkbox ,group box , and button.
Blue line . . . . . thats all the properties , u can setting for the tool box , ex i can change the color of the window being blue , picturebox being black n etc .

Fourth step , make the code , fill in the event at specific place of the toolbox what have we choose, that it will effect hows that your program will work gonna do 

NB :
i use toolbox  button named New game,double click on the toolbox button  , it call reset game , so i make all the picturebox after showing the picture , we can put back at early time . i show it on red box . 


then, i have use 2 mode , radiobutton1 representative mode newbie , i make the code like this,

Its long code , i insert in , u can download here
otherwise , radiobutton2 representative mode veteran , i make the code like this , the effect we will hard to beat the computer .

Its long code , same , download here
As we can see , there cek(); it have effect to decide who the winner , so here its 
its long code to , download here
There's checkbox its representative of multiplayer , i have use boolean / bool and theres image will shown up at picturebox , i have put direct place the image , check this


Next ,make event on every each of the picturebox from 1 - 9, by double click on every each of it , then i fill the code like this on picturebox1 ,

NB: We can see there message show Attention Choose other box ! , its means the program works ,if you click the picturebox1 first time , and then you click again on picturebox1 , the message show , you cant choose the same box.

The concept of fill the next picturebox is same , because its to long ,here my code i have made, download here

And then , the code of the checkbox for multiplayer i made like this, if we check list the checkbox , radiobutton 1, 2 will unchecked , and then , the code of hows that the multiplayer work is by using bool .
check this
the code on box upper is on the picturebox9 , so its include on picturebox code before, you can check it

Sixth step , compile the program , check if there's still any error or not .

If already fix , no error , have fun with your own game tic tac toe . Its done 

To prove : check my video


No comments:

Post a Comment