Add to Favorites    Make Home Page 141 Online  

 Language Categories  
 Our Services  

Home » C++ Home » Games Home » Graphics Hangman

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Graphics Hangman
Author ANAND TS
Author Email ianandpoonu [at] yahoo.co.in
Description This is a graphics hangman with both human vs human and cpu
vs
human playing options. A very flexible game with lots of friendly user
interfaces. It is easy to handle.
NOTE:-
while copying some of the long sentences are broken and rest is placed
in
the next line.
this may cause compilation errors. So please
join the parts to avoid compilation errors.

Category C++ » Games
Hits 19523
Code Select and Copy the Code
#include<iostream.h> #include<conio.h> #include<stdio.h> #include<stdlib.h> #include<string.h> #include<dos.h> #include<graphics.h> int select(int mult) { union REGS inregs, outregs ; int bli=1,use=1,key=34,i; settextstyle(2,0,5); while(key!=28) { if(bli>0) { use=bli; setfillstyle(1,0); bli=0-bli; } else if(bli<0) { use=0-bli; setfillstyle(1,8); bli=0-bli; } floodfill(221,111+use*40,15); delay(100); if(bli<0) { key=kbhit(); if(kbhit()) { inregs.h.ah = 0 ; int86(22, &inregs, &outregs) ; key=outregs.h.ah; } } if((key==72)&&(use>1)) { bli=use-1; } if((key==80)&&(use<mult)) { bli=use+1; } } if(bli<0) bli=0-bli; return(bli); } void main() { int driver=DETECT,mode; initgraph(&driver,&mode,""); clrscr(); int score,cho,b[15],ana,hang,num,guess,remain,count=-1,mica; char a[15],h,le='?',ques[41][15]={"kuwait","giraffe","zebra","elephant","ostrit ch","mangoose","donkey","baseball","rugby","crocodile","camel","chimpanzee ","dolphin","scorpion","tarantula","rattlesnake","alligator","greatdain"," alsation","dalmatian","bulldog","boxer","srilanka","indonesia","norway","v ietnam","cameroon","zimbabwe","mexico","argentina","panama","singapore","s weden","portugal","austria","switzerland","yugoslavia","greece","woodpecke r","viper"}; char clue[40][30]={"a country","a wild animal","a wild animal","a wild/domestic animal","a wild bird","a wild animal","a domestic animal","a game","a game","a reptile","a wild/domestic animal","a wild animal","a sea mammal","an arthropod","an arthropod","a snake","a reptile","a dog","a dog","a dog","a dog","a dog","a country","a country","a country","a country","a country","a country","a country","a country","a country","a country","a country","a country","a country","a country","a country","a country","a bird","a snake"}; char option[3][20]={"Human v/s human"," Human v/s cpu"," Exit"}; char cue[30],loop; char d[15],inpu; randomize(); guess=int(rand()%1000); remain=guess%40; do { for(int i=0;i<15;i++) { d[i]='_'; a[i]='?'; } mica=0; loop='y'; score=0; ana=1; hang=0; strcpy(cue," "); cleardevice(); setcolor(15); rectangle(0,0,639,479); setfillstyle(1,8); floodfill(100,100,15); settextstyle(3,0,4); setcolor(15); outtextxy(230,70,"HANG MAN"); rectangle(10,400,630,470); settextstyle(2,0,5); for(i=0;i<120;i+=40) { rectangle(220,150+i,390,180+i); setviewport(221,151+i,389,179+i,1); clearviewport(); setviewport(0,0,639,479,1); outtextxy(247,157+i,option[i/40]); rectangle(240,155+i,370,175+i); } outtextxy(30,380,"About the game:-"); outtextxy(20,420,"This game is very familiar to you. We will be hiding a word and you have to find"); outtextxy(30,440,"it by guessing each of it's letters, a clue will be provided."); cho=select(3); if(cho==1) { cleardevice(); setcolor(15); rectangle(0,0,639,479); setfillstyle(1,8); floodfill(100,100,15); count++; b[count]=40; outtextxy(120,150,"Now one of you who is going to guess, type in your word"); outtextxy(180,170,"(a single word < 13 words).I will hide it for you."); setbkcolor(8); i=0; h=0; while(h!=13) { gotoxy(3,2); h=getche(); a[i]=h; gotoxy(3,2); cout<<" "; i++; } a[i-1]='

Related Source Codes

Script Name Author
Moving ball screen saver karlmarx
The Classic Game of Snake & Ladder Lakshmi Narayana .A
Railway seat reservation question which comes in sapient VyomWorld
To calculate percentile Ravi Mathur
Send to folder ANIMESH SAHU
Analog clock and calendar Nazia & Rida
HIGH/LOW GAME MOLLY ARORA
Data structure (stack Implimentation) Swapnil B Adsure
Memory Game AnirudhSanyal
Easy Calc Anirudh Sanyal
GK Quiz Anirudh Sanyal
Hangman Game Manish Jain
Snakeman Manish Jain
Full month Calendar Nigi
Cursor shapes nigi

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:


Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions
Copyright ©2003-2014 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=1103


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review