SlideShare a Scribd company logo
package Games; 
import java.util.*; 
import java.io.*; 
class Hangman 
{ 
public static void main()throws IOException 
{ 
Scanner in = new Scanner(System.in); 
BufferedReader br = new BufferedReader(new InputStreamReader 
(System.in)); 
String[][] arr={{"terminator","Beware, Skynet is coming"}, 
{"movie 43","I used to like burritos..."}, 
{"the amazing spiderman","Oscorp"}, 
{"harry potter and the half blood prince","godric hollows"}, 
{"eragon","Shade-slayer"}, 
{"the grand budapest hotel","M Gustave"}, 
{"pokemon destiny deoxys","Gotta catch em all"}, 
{"godzilla","Giant Lizard"}, 
{"the neighbours","Robert de Niro Impersonation"}, 
{"a million ways to die in the west","2014 comedy-Seth 
MacFarlane"}, 
{"superbad","Fogell McLovin"}, 
{"epic movie","spoof on narnia"}, 
{"superhero movie","The dragonfly"}, 
{"the it group","Information Technology"}, 
{"iron man","jarvis"}, 
{"death at a funeral","chris rock"}, 
{"superman","Kryptonite"}, 
{"the dark knight","Why So Serious?"}, 
{"star trek","Enterprise"}, 
{"star wars","May the force be with you"}, 
{"senna","race car driver"}, 
{"goodfellas","joe pesci won an oscar for his role"}, 
{"dunstin checks in","monkey"}, 
{"the exorcist","devil"}, 
{"wolf of wall street","jordan belfort"}, 
{"transformers","bumblebee"}, 
{"21 jump street","Channing Tatum, Jonah Hill"}, 
{"22 jump street","the Ghost"}, 
{"ted","stoners"}, 
{"how i met your mother","Legen-wait for it-dary"}, 
{"game of thrones","Winter is Coming!"}, 
{"the blacklist","james spader"}, 
{"boston legal","denny crane"}, 
{"breaking bad","Heisenberg"}, 
{"curb your enthusiasm","Comedy TV show starring Larry 
David"}, 
{"no country for old men","old revenge"}, 
{"saving mr banks","mary poppins"}, 
{"psych","you know that's right"}, 
{"forrest gump","life is like a box of chocolates"}, 
{"saving private ryan","military movie"},
{"homeland","i am not a terrorist"}, 
{"brooklyn nine nine","jake peralta"}, 
{"taxi driver","you talkin' to me"}, 
{"godfather",""i'll make him an offer he can't refuse""}, 
{"poseidon","trident"}, 
{"inception","dream"}, 
{"shutter island","leonardo di caprio"}, 
{"the incredible hulk","brazilian forward"}, 
{"her","falling in love with an operating system"}, 
{"anchorman the legend of ron burgundy","goodnight 
seattle"}, 
{"batman begins"," Ra's al Ghul"}, 
{"dark knight rises",""no one cared who i was until i put 
on the mask"}, 
{"moneyball","statistical analysis of baseball players"}, 
{"guardians of the galaxy","batista is the destroyer"}, 
{"django unchained","i like the way you die boy"}, 
{"american hustle","scamsters in USA"}, 
{"the hunger games catching fire","atlas"}, 
{"safe house","denzel washington"}, 
{"12 rounds 2 reloaded","Randy Orton"}, 
{"the marine","john cena"}, 
{"american psycho","Christian Bale as a guy who enjoys the 
kill"}, 
{"white house down","President under attack"}, 
{"pacific rim","Giant robot fighting"}, 
{"the family guy movie stewie griffins untold story","it 
seems these days, that all you see, is violence in movies and sex on 
tv"}, 
{"now you see me","3 magicians"}, 
{"catch me if you can","the best thief-leonardo di caprio"}, 
{"sybil","personality disorders"}, 
{"mrs doubtfire","nanny-robin williams"}, 
{"jumanji","Robin Williams"}, 
{"night at the museum","teddy roosevelt"}, 
{"my moms boyfriend","cops mom dates criminal"}, 
{"cars","route 66"}, 
{"planes","dusty"}, 
{"tangled","flynn rider"}, 
{"frozen","Let it go"}, 
{"enchanted","andrasia"}, 
{"127 hours","grand canyon"}, 
{"the conjuring","annabelle"}, 
{"one missed call","calls from the dead"}, 
{"final destination","premonition"}, 
{"kung fu panda","po"}, 
{"over the hedge","stacks"}, 
{"ice age","sid"}, 
{"oceans eleven","brad pitt"}, 
{"tower heist","ben stiller"}, 
{"guardians of the galaxy","marvel"}, 
{"x men","mutants"}, 
{"teenage mutant ninja turtles","micheal angelo and 
raphael"},
{"rebound","basketball"}, 
{"the wolverine","hugh jackman"}, 
{"about last night","comedy"}, 
{"bedtime stories","bugsy"}, 
{"50 first dates","amnesia"}, 
{"captain phillips","pirates"}, 
{"pirates of the caribbean dead mans chest","johnny depp"}, 
{"pulp fiction","samuel L jackson"}, 
{"charlie and the chocolate factory","augustus gloop"}, 
{"rv","vehicle"}, 
{"harry potter and the sorcerers stone","dudley"}, 
{"the social network","facebook"}, 
{"suits","patrick j adams"}, 
{"castle","esposito"}, 
{"les miserables","anne hathaway"}, 
{"orange is the new black","womans jail"}, 
{"despicable me","gru"}, 
{"everybody loves raymond","ray romano"}, 
{"seinfeld","jerry"}, 
{"that 70s show","fez"}, 
{"citizen khan","community leader"}, 
{"arrow","oliver queen"}, 
{"house of cards","US political drama"}, 
{"house md","eccentric doctor"}, 
{"doctor who","he's not a doctor"}, 
{"mind your language","mr. brown"}, 
{"south park","mrs. garrisson"}, 
{"key and peele","two black guys hosting a comedy show"}, 
{"outsourced","gupta"}, 
{"big bang theory","bazinga"}, 
{"saturday night live","weekly sitcom"}, 
{"whose line is it anyway","the show where everythings made 
up and the points dont matter"}, 
{"the simpsons","d'oh"}, 
}; 
System.out.println("Enter 1 For Movie/TV Show From Data 
Base(if you have no friends).nEnter 2 For Your Friend To Input A 
Movie/TV Show"); 
int q = in.nextInt(); 
String s =""; 
int r=0; 
String hint=""; 
if(q==1) 
{ 
r=randommovie(arr); 
s = arr[r][0]; 
hint=arr[r][1]; 
} 
else 
{ 
System.out.println("Enter Movie/TV Show "); 
s=br.readLine().toLowerCase(); 
System.out.println("Provide a hint"); 
hint =br.readLine();
System.out.println("f"); 
} 
ArrayList<Character> ch=new ArrayList<Character>(); 
for(int i=0;i<s.length();i++) 
{ 
char c=s.charAt(i); 
if(c!=' ') 
ch.add(c); 
for(int y=0;y<ch.size()-1;y++) 
{ 
if(c==ch.get(y)) 
ch.remove(ch.size()-1); 
} 
} 
boolean x = true; 
ArrayList<Character> RGuesses= new ArrayList<Character>(); 
ArrayList<Character> Guesses= new ArrayList<Character>(); 
int count =0; 
System.out.println("Remember To Guess In Lower Case!nnLet 
The Game Beginnn"); 
while(count<5) 
{ 
printHang(s,RGuesses,Guesses); 
System.out.println((5-count)+" Tries Left"); 
if(count==4) 
{ 
System.out.println("HINT: "+hint); 
} 
if(ch.size()==RGuesses.size()) 
{ 
System.out.println("nnnWell Done, You Win"); 
break; 
} 
System.out.println(); 
System.out.println("nEnter Your Guess:"); 
char c = in.next().toLowerCase().charAt(0); 
boolean check = true; 
System.out.print("f"); 
for(int i =0;i<Guesses.size();i++) 
{ 
if(Guesses.get(i)==c) 
{ 
check =false; 
break; 
} 
} 
if(check) 
{ 
Guesses.add(c); 
} 
else
{ 
System.out.println("nYou've Already Guessed This, 
Try Again."); 
continue; 
} 
boolean boo=false; 
for(int i =0;i<s.length();i++) 
{ 
if(s.charAt(i)==c) 
{ 
boo=true; 
System.out.println("nGood Guess"); 
RGuesses.add(c); 
break; 
} 
} 
if(boo==false) 
{ 
count++; 
System.out.println("nIncorrect Guess "); 
if(count==5) 
{ 
System.out.println("nnGame Over.nThe Correct 
Answer Is "+s); 
break; 
} 
} 
} 
System.out.println("Do You Want To Play Again?(y/n)"); 
char p=in.next().toLowerCase().charAt(0); 
if(p=='y') 
main(); 
else 
System.out.println("nnThanks for playing"); 
} 
public static int randommovie(String[][] arr) 
{ 
return (int)(Math.random()*arr.length); 
} 
public static void printHang(String s,ArrayList<Character> 
RG,ArrayList<Character> G) 
{ 
for(int i =0;i<s.length();i++) 
{ 
if(s.charAt(i)==' ') 
{ 
System.out.print("tt"); 
continue; 
} 
boolean b=false; 
for(int j=0;j<RG.size();j++) 
{
if(s.charAt(i)==RG.get(j)) 
{ 
System.out.print(s.charAt(i)+" "); 
b=true; 
break; 
} 
} 
if(b==false) 
System.out.print("__ "); 
} 
System.out.println("nLetters You Have Guessed: "+G); 
} 
}

More Related Content

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Hangman (Java Program written on Blue J Editor)

  • 1. package Games; import java.util.*; import java.io.*; class Hangman { public static void main()throws IOException { Scanner in = new Scanner(System.in); BufferedReader br = new BufferedReader(new InputStreamReader (System.in)); String[][] arr={{"terminator","Beware, Skynet is coming"}, {"movie 43","I used to like burritos..."}, {"the amazing spiderman","Oscorp"}, {"harry potter and the half blood prince","godric hollows"}, {"eragon","Shade-slayer"}, {"the grand budapest hotel","M Gustave"}, {"pokemon destiny deoxys","Gotta catch em all"}, {"godzilla","Giant Lizard"}, {"the neighbours","Robert de Niro Impersonation"}, {"a million ways to die in the west","2014 comedy-Seth MacFarlane"}, {"superbad","Fogell McLovin"}, {"epic movie","spoof on narnia"}, {"superhero movie","The dragonfly"}, {"the it group","Information Technology"}, {"iron man","jarvis"}, {"death at a funeral","chris rock"}, {"superman","Kryptonite"}, {"the dark knight","Why So Serious?"}, {"star trek","Enterprise"}, {"star wars","May the force be with you"}, {"senna","race car driver"}, {"goodfellas","joe pesci won an oscar for his role"}, {"dunstin checks in","monkey"}, {"the exorcist","devil"}, {"wolf of wall street","jordan belfort"}, {"transformers","bumblebee"}, {"21 jump street","Channing Tatum, Jonah Hill"}, {"22 jump street","the Ghost"}, {"ted","stoners"}, {"how i met your mother","Legen-wait for it-dary"}, {"game of thrones","Winter is Coming!"}, {"the blacklist","james spader"}, {"boston legal","denny crane"}, {"breaking bad","Heisenberg"}, {"curb your enthusiasm","Comedy TV show starring Larry David"}, {"no country for old men","old revenge"}, {"saving mr banks","mary poppins"}, {"psych","you know that's right"}, {"forrest gump","life is like a box of chocolates"}, {"saving private ryan","military movie"},
  • 2. {"homeland","i am not a terrorist"}, {"brooklyn nine nine","jake peralta"}, {"taxi driver","you talkin' to me"}, {"godfather",""i'll make him an offer he can't refuse""}, {"poseidon","trident"}, {"inception","dream"}, {"shutter island","leonardo di caprio"}, {"the incredible hulk","brazilian forward"}, {"her","falling in love with an operating system"}, {"anchorman the legend of ron burgundy","goodnight seattle"}, {"batman begins"," Ra's al Ghul"}, {"dark knight rises",""no one cared who i was until i put on the mask"}, {"moneyball","statistical analysis of baseball players"}, {"guardians of the galaxy","batista is the destroyer"}, {"django unchained","i like the way you die boy"}, {"american hustle","scamsters in USA"}, {"the hunger games catching fire","atlas"}, {"safe house","denzel washington"}, {"12 rounds 2 reloaded","Randy Orton"}, {"the marine","john cena"}, {"american psycho","Christian Bale as a guy who enjoys the kill"}, {"white house down","President under attack"}, {"pacific rim","Giant robot fighting"}, {"the family guy movie stewie griffins untold story","it seems these days, that all you see, is violence in movies and sex on tv"}, {"now you see me","3 magicians"}, {"catch me if you can","the best thief-leonardo di caprio"}, {"sybil","personality disorders"}, {"mrs doubtfire","nanny-robin williams"}, {"jumanji","Robin Williams"}, {"night at the museum","teddy roosevelt"}, {"my moms boyfriend","cops mom dates criminal"}, {"cars","route 66"}, {"planes","dusty"}, {"tangled","flynn rider"}, {"frozen","Let it go"}, {"enchanted","andrasia"}, {"127 hours","grand canyon"}, {"the conjuring","annabelle"}, {"one missed call","calls from the dead"}, {"final destination","premonition"}, {"kung fu panda","po"}, {"over the hedge","stacks"}, {"ice age","sid"}, {"oceans eleven","brad pitt"}, {"tower heist","ben stiller"}, {"guardians of the galaxy","marvel"}, {"x men","mutants"}, {"teenage mutant ninja turtles","micheal angelo and raphael"},
  • 3. {"rebound","basketball"}, {"the wolverine","hugh jackman"}, {"about last night","comedy"}, {"bedtime stories","bugsy"}, {"50 first dates","amnesia"}, {"captain phillips","pirates"}, {"pirates of the caribbean dead mans chest","johnny depp"}, {"pulp fiction","samuel L jackson"}, {"charlie and the chocolate factory","augustus gloop"}, {"rv","vehicle"}, {"harry potter and the sorcerers stone","dudley"}, {"the social network","facebook"}, {"suits","patrick j adams"}, {"castle","esposito"}, {"les miserables","anne hathaway"}, {"orange is the new black","womans jail"}, {"despicable me","gru"}, {"everybody loves raymond","ray romano"}, {"seinfeld","jerry"}, {"that 70s show","fez"}, {"citizen khan","community leader"}, {"arrow","oliver queen"}, {"house of cards","US political drama"}, {"house md","eccentric doctor"}, {"doctor who","he's not a doctor"}, {"mind your language","mr. brown"}, {"south park","mrs. garrisson"}, {"key and peele","two black guys hosting a comedy show"}, {"outsourced","gupta"}, {"big bang theory","bazinga"}, {"saturday night live","weekly sitcom"}, {"whose line is it anyway","the show where everythings made up and the points dont matter"}, {"the simpsons","d'oh"}, }; System.out.println("Enter 1 For Movie/TV Show From Data Base(if you have no friends).nEnter 2 For Your Friend To Input A Movie/TV Show"); int q = in.nextInt(); String s =""; int r=0; String hint=""; if(q==1) { r=randommovie(arr); s = arr[r][0]; hint=arr[r][1]; } else { System.out.println("Enter Movie/TV Show "); s=br.readLine().toLowerCase(); System.out.println("Provide a hint"); hint =br.readLine();
  • 4. System.out.println("f"); } ArrayList<Character> ch=new ArrayList<Character>(); for(int i=0;i<s.length();i++) { char c=s.charAt(i); if(c!=' ') ch.add(c); for(int y=0;y<ch.size()-1;y++) { if(c==ch.get(y)) ch.remove(ch.size()-1); } } boolean x = true; ArrayList<Character> RGuesses= new ArrayList<Character>(); ArrayList<Character> Guesses= new ArrayList<Character>(); int count =0; System.out.println("Remember To Guess In Lower Case!nnLet The Game Beginnn"); while(count<5) { printHang(s,RGuesses,Guesses); System.out.println((5-count)+" Tries Left"); if(count==4) { System.out.println("HINT: "+hint); } if(ch.size()==RGuesses.size()) { System.out.println("nnnWell Done, You Win"); break; } System.out.println(); System.out.println("nEnter Your Guess:"); char c = in.next().toLowerCase().charAt(0); boolean check = true; System.out.print("f"); for(int i =0;i<Guesses.size();i++) { if(Guesses.get(i)==c) { check =false; break; } } if(check) { Guesses.add(c); } else
  • 5. { System.out.println("nYou've Already Guessed This, Try Again."); continue; } boolean boo=false; for(int i =0;i<s.length();i++) { if(s.charAt(i)==c) { boo=true; System.out.println("nGood Guess"); RGuesses.add(c); break; } } if(boo==false) { count++; System.out.println("nIncorrect Guess "); if(count==5) { System.out.println("nnGame Over.nThe Correct Answer Is "+s); break; } } } System.out.println("Do You Want To Play Again?(y/n)"); char p=in.next().toLowerCase().charAt(0); if(p=='y') main(); else System.out.println("nnThanks for playing"); } public static int randommovie(String[][] arr) { return (int)(Math.random()*arr.length); } public static void printHang(String s,ArrayList<Character> RG,ArrayList<Character> G) { for(int i =0;i<s.length();i++) { if(s.charAt(i)==' ') { System.out.print("tt"); continue; } boolean b=false; for(int j=0;j<RG.size();j++) {
  • 6. if(s.charAt(i)==RG.get(j)) { System.out.print(s.charAt(i)+" "); b=true; break; } } if(b==false) System.out.print("__ "); } System.out.println("nLetters You Have Guessed: "+G); } }