www.fatihkabakci.com

Personal Website and Computer Science TUR EN

Domino Game

Last update:2/13/2012 1:53:00 PM

Owner and writer:Fatih KABAKCI

The purpose of this project is to examine concept of tree that commonly used in computer science and write Domino game in C programming language by this model of data structure.Domino is mental game that can be played between 2 or n person by 28 the flat stones.

domino

1.)Introduction

Firstly,arrival to Europe of the Domino which started to play in Chine on the 3rd century is the base on 18th century.At Domino which plays by the 28 stones,every player starts by 7 stones.Other stones remain in the bank.if the user has no stone that should play,it can take from the bank.The beginning of the game,the player who has the highest precious stone starts the game.And then every player put to continue the stone on the table.The stones which located on the table, at least one double-face,must match.

For example,if a player plays 2:1,next to 2:1 which the next player will put the stone must be 1 or 2.if the user has no stone that should put,it must take from the bank.if the bank has not stone and if the player can not play,it loses the right.if any player gains 7 score the game ends.if a player or a team win the game,a group that wins the game gains 50,100,250 or 500 score and the game ends.

Sample image of the program is shown as below


Implementation

application of the project file can be downloaded here as described above
node *oyunAgaci(node *tree,node *bas,int sol,int sag) { // bilgisayarin hamlelerini yapmasini sagladigi fonksiyon
    
     while(tree!=NULL) {  
     if(tree->sol==sol && tree->sag==sag) {
     tree->konum=1;
     break;
     }
     else if(tree->sol > sol)
     tree=tree->left;
     else
     tree=tree->right;
     }
     if(tree!=NULL && tree->konum==1) 
     return tree;
     tree=bas;
     while(tree!=NULL) {
     if((tree->sol==sol && tree->sag==sol) || (tree->sol==sag && tree->sag==sag)) {
     tree->konum=1;
     break;
     }
     else if(tree->sol > sol)
     tree=tree->left;
     else
     tree=tree->right;
     }
     if(tree!=NULL && tree->konum==1)
     return tree; 
     tree=bas;
     while(tree!=NULL) {
     if(tree->sag==sag || tree->sol==sol || tree->sag==sol || tree->sol==sag) {
     tree->konum=1;
     return tree;
     }
     else if(tree->sol > sol)
     tree=tree->left;
     else
     tree=tree->right;
     }
     return bas;
     }

Integration of artificial intelligence of Computer which the rival of user is given as above by tree of game.The project code of one of The tree algorithms that there are lots of artificial intelligence problems are shared for is an important milestone in the literature for you.


The Topics in Computer Science

Search this site for





 

Software & Algorithms

icon

In mathematics and computer science, an algorithm is a step-by-step procedure for calculations. Algorithms are used for calculation, data processing, and automated reasoning.

Programming Languages

icon

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. It can be used to create programs to control the behavior of a machine. Java,C, C++,C#

Database

icon

A database is an organized collection of data. The data are typically organized to model aspects of reality in a way that supports processes requiring information.

Hardware

icon

Computer hardware is the collection of physical elements that constitutes a computer system. Computer hardware refers to the physical parts or components of a computer such as the monitor, memory, cpu.

Web Technologies

icon

Web development is a broad term for the work involved in developing a web site for the Internet or an intranet. Html,Css,JavaScript,ASP.Net,PHP are one of the most popular technologies. J2EE,Servlet, JSP,JSF, ASP

Mobile Technologies

icon

Mobile application development is the process by which application software is developed for low-power handheld devices, such as personal digital assistants, enterprise digital assistants or mobile phones. J2ME

Network

icon

A computer network or data network is a telecommunications network that allows computers to exchange data. In computer networks, networked computing devices pass data to each other along data connections.

Operating Systems

icon

An operating system is software that manages computer hardware and software resources and provides common services for computer programs. The OS is an essential component of the system software in a computer system. Linux,Windows

Computer Science

icon

Computer science is the scientific and practical approach to computation and its applications.A computer scientist specializes in the theory of computation and the design of computational systems.