Chess Game program in C language

Chess Game program in C language

Chess Game program in C language   #include<stdio.h> #include<conio.h> #include<graphics.h> void blk(int,int); void display(); //enum bool{TRUE,FALSE}; /*void main() //MAIN FUNCTION { display(); getch(); } */ void display() //DISPLAY TO SHOW THE BOARD { int gd=DETECT,gm,i,j,l,m,b; char pattern[]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; int arrodd[32][2]={ {0,0},{100,0},{200,0},{300,0},{50,50},{150,50} ,{250,50},{350,50},{0,100},{100,100},{200,100},{300,100} ,{50,150},{150,150},{250,150},{350,150},{0,200},{100,200} ,{200,200},{300,200},{50,250},{150,250},{250,250},{350,250}, {0,300},{100,300},{200,300},{300,300},{50,350},{150,350}, {250,350},{350,350} }; int arrevn[33][2]={{50,0},{150,0},{250,0},{350,0},{0,50},{100,50},{200,50}, {300,50},{50,100},{150,100},{250,100},{350,100},{0,150}, {100,150},{200,150},{300,150},{50,200},{150,200},{250,200}, {350,200},{0,250},{100,250},{200,250},{300,250},{50,300}, {150,300},{250,300},{350,300},{0,350},{100,350},{200,350}, {300,350}}; clrscr(); initgraph(&gd,&gm,””); … Read more

Egg Game Program in C Langauage

C Programming Tutorial

Egg Game Program in C Langauage   #include<dos.h> #include<graphics.h> #include<stdio.h> #include<conio.h> #include<process.h> #include<dos.h> #include<stdlib.h> #include<iostream.h> union REGS i,o; main() { int initmouse(); int restrictmouseptr(int,int,int,int); int getmousepos(int *,int *,int *); int showmouseptr(); int gd=DETECT,gm,maxx,maxy,x,y,button; initgraph(&gd,&gm,””); int count=0; maxx=getmaxx(); maxy=getmaxy(); setbkcolor(1); setviewport(0,0,maxx,maxy,1); gotoxy(26,1); if(initmouse()==0) { closegraph(); restorecrtmode(); //to go back to normal graphics mode or deleting viewport. … Read more

Basics of file handling in C language

C Programming Tutorial

Basics of file handling in C language There are two types of files, which can be handled through C programming language: Character Oriented File Handling/Text files Binary Oriented File Handling/Binary files For file handling, we use a structure named “FILE” which is declared in stdio.h header file. Some important and most useful file handling functions: … Read more

C program to print Fibonacci series

C Programming Tutorial

C program to print Fibonacci series Fibonacci series is a series of number in which each number is the sum of preceding two numbers. for example: 0 1 1 2 3 5 8 13 21  … The next number is found by adding up the two numbers before it as : The 2 is found … Read more

an algorithm to check prime number

algorithm

An algorithm to check prime number A number that is divisible only by itself and 1, is prime number Example of prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23…. etc Algorithm Step 1: Start Step 2: Declare variables n,i,flag. Step 3: Initialize variables flag←1 i←2 Step 4: Read n from user. Step … Read more

Bubble Sort Algorithm

algorithm

Bubble Sort : Overview Bubble sort is considered the simplest sorting algorithm. Bubble Sort is used to sort a given set of n elements provided in form of an array with n number of elements. Bubble Sort compares all the element one by one and sort them based on their values. It is known as … Read more

an algorithm for making a cup of tea

algorithm

What is algorithm An algorithm is step by step description of the method to solve a problem. It is an effective procedure for solving a problem in a finite number of steps an algorithm to find the factorial of a number How to start writing algorithm : Step by Step solve the problem Problem Description … Read more

an algorithm to find the factorial of a number

What is algorithm An algorithm is step by step description of the method to solve a problem. It is an effective procedure for solving a problem in a finite number of steps an algorithm to find the factorial of a number How to start writing algorithm : Step by Step solve the problem Problem Description … Read more

An algorithm to find the largest among three different numbers

algorithm

How to start writing algorithm : Step by Step solve the problem Problem Description – Find description of the problem. Problem Analysis – Analyze the problem. Start writing steps to resolve the problem in your language. Re-analyze the steps and try to add more details. Final Review   An algorithm to find the largest among three … Read more

Basic of Algorithm : Start Writing Algorithm

algorithm

Basic of Algorithm : Start Writing Algorithm Algorithm are the set of well defined instruction in sequence to solve a problem. This is a instruction written in English language,  step by step to solve the problem An algorithm should always have a clear stopping point. Inputs and outputs should be defined precisely. Each steps in … Read more