3.1.x Extensions Database 3.1 / 3.2Hangman Game

<span class="qte-attr qte_31_32-qte">3.1.x &amp; 3.2.x</span>
User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 8 Firefox

Re: Hangman Game

Post by dmzx »

vla20071 wrote:Game in mobile version:
Slightly altered
:thumbup: will check it (update installed here)

User avatar

vla20071
Users
Users
Posts: 29
Joined: 28 Jun 2015, 20:26
    Mac OS X Chrome

Re: Hangman Game

Post by vla20071 »

dmzx wrote: (update installed here)
:thumbup:

User avatar

martin
Admin
Admin
Posts: 5105
Joined: 06 Apr 2014, 16:12
    Linux Chrome

Re: Hangman Game

Post by martin »

Maybe i should post my hangman too

Its more html 5 valid Showing results for hangman - Nu Html Checker this i s the updated version for mobiles
Last edited by martin on 11 Oct 2015, 19:02, edited 1 time in total.
Image

User avatar

Null
Users
Users
Posts: 125
Joined: 09 Oct 2015, 06:03
    Windows 7 Chrome

Re: Hangman Game

Post by Null »

In first post, its said "Extension Version: 0.0.2 added page." but in download page its said "Version 0.0.3".

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 8 Firefox

Re: Hangman Game

Post by dmzx »

Null wrote:In first post, its said "Extension Version: 0.0.2 added page." but in download page its said "Version 0.0.3".
Sharp spot :wink: changed :thumbup:

User avatar

Yerunad
Users
Users
Posts: 5
Joined: 14 Nov 2015, 23:44
    Windows 10 Firefox

Re: Hangman Game

Post by Yerunad »

How to modify keyboard?
I need polish signs.
Last edited by Yerunad on 16 Nov 2015, 00:19, edited 1 time in total.
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." Albert Einstein

User avatar

Null
Users
Users
Posts: 125
Joined: 09 Oct 2015, 06:03
    Windows 7 Chrome

Re: Hangman Game

Post by Null »

Yerunad wrote:How to modify keyboard?
I need polish signs.
To play in Portuguese, I used only words without special characters.

User avatar

Yerunad
Users
Users
Posts: 5
Joined: 14 Nov 2015, 23:44
    Windows 10 Firefox

Re: Hangman Game

Post by Yerunad »

There is too many words with special characters.

vla20071 do the russian keyboard, so it's possible.
I'm looking for tip if full instruction is not possible.

EDIT:

OK, I found it. :-)

So there is polish lang and polish keyboard, but without polish quotes yet.

But when I click New quotes I have a little problem with new characters.
characters.png
No clicked characters look like pressed on (red lines), clicked charecter is ok (green line).

Any ideas what to do with this?
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
Last edited by Yerunad on 16 Nov 2015, 02:13, edited 2 times in total.

User avatar

ninowebs
Users
Users
Posts: 29
Joined: 04 Jun 2015, 23:44
    Windows 7 Chrome

Re: Hangman Game

Post by ninowebs »

Where is this code?
peteetongman wrote:
martin wrote:post them here i'm sure there get used. :tumbsyes:
here's a file of movie titles if you want to switch things up. Most of these are US movies I think so I guess they may not be relevant in some areas of the world. I have another one with Zoo Animals and another with 1960's Songs also

Code: Select all

<script type="text/javascript">
//<![CDATA[
var alpha=new Array();
var alpha_index=0;

var bravo=new Array();
var bravo_index=0;

var running=0;
var failnum=0;
var advising=0;

var words = new Array("The Godfather",
					 "The Shawshank Redemption",
					 "Schindlers List",
					 "Raging Bull",
					 "Casablanca",
					 "One Flew Over the Cuckoos Nest",
					 "Gone with the Wind",
					 "Citizen Kane",
					 "The Wizard of Oz",
					 "Titanic",
					 "Lawrence of arabia",
					 "The Godfather Part II",
					 "Psycho",
					 "Sunset Blvd",
					 "Vertigo",
					 "On the Waterfront",
					 "Forrest Gump",
					 "The Sound of Music",
					 "West Side Story",
					 "Star Wars",
					 "E T The Extra Terrestrial",
					 "A Space Odyssey",
					 "The silence of the Lambs",
					 "Chinatown",
					 "The Bridge on the River Kwai",
					 "Singin in the Rain",
					 "Its a Wonderful Life",
					 "Some Like It Hot",
					 "Twelve Angry Men",
					 "Dr Strangelove",
					 "Amadeus",
					 "Apocalypse Now",
					 "Gandhi",
					 "The Lord of the Rings",
					 "Gladiator",
					 "From Here to Eternity",
					 "Saving Private Ryan",
					 "Unforgiven",
					 "Raiders of the Lost Ark",
					 "Rocky",
					 "A Streetcar Named Desire",
					 "The Philadelphia Story",
					 "To Kill a Mockingbird",
					 "An American in Paris",
					 "The Best Years of Our Lives",
					 "My Fair Lady",
					 "Ben Hur",
					 "Doctor Zhivago",
					 "Patton",
					 "Jaws",
					 "Braveheart",
					 "The Good the Bad and the Ugly",
					 "Butch Cassidy and the Sundance Kid",
					 "The Treasure of the Sierra Madre",
					 "The Apartment",
					 "Platoon",
					 "High noon",
					 "Dances with Wolves",
					 "The Pianist",
					 "Goodfellas",
					 "The Exorcist",
					 "The Deer Hunter",
					 "All Quiet on the Western Front",
					 "The French Connection",
					 "City Lights",
					 "The Kings Speech",
					 "It Happened One Night",
					 "A Place in the Sun",
					 "Midnight Cowboy",
					 "Mr Smith Goes to Washington",
					 "Rain Man",
					 "Annie Hall",
					 "Good Will Hunting",
					 "Terms of Endearment",
					 "Tootsie",
					 "Fargo",
					 "The Grapes of Wrath",
					 "The Green Mile",
					 "Close Encounters of the Third Kind",
					 "The Graduate",
					 "American Graffiti",
					 "Pulp Fiction",
					 "The African Queen",
					 "Bonnie and Clyde",
					 "Mutiny on the Bounty");

function pick()
{
	var choice="";
	var blank=0;

	for(i=0; i<words[index].length; i++)
	{
		t=0;
		for(j=0; j<=alpha_index; j++)
			if(words[index].charAt(i)==alpha[j] || words[index].charAt(i)==alpha[j].toLowerCase()) t=1;

		if(t) choice+=words[index].charAt(i)+" ";
		else
		{
		  if(words[index].charAt(i)==' ')
		  {
		  	choice += "  ";
		  }
		  else
		  {
				choice+="_ ";
			blank=1;
		  }
		}
	}

	document.frm.word.value=choice;

	if(!blank)
	{
		alert('{LA_HANGMAN_YOUWIN}');
		document.frm.score.value++;
		running=0;
		new_word(document.frm);
	}
}

function new_word(form)
{
	if(!running)
	{
		running=1;
		failnum=0;
		form.lives.value=failnum;
		form.tried.value="";
		form.correct.value="";
		form.word.value="";
		index=Math.round(Math.random()*10000) % 100;
		alpha[0]=words[index].charAt(0);
		alpha[1]=words[index].charAt(words[index].length-1);
		alpha_index=1;
		bravo[0]=words[index].charAt(0);
		bravo[1]=words[index].charAt(words[index].length-1);
		bravo_index=1;
		pick();
	}
	else
		advise("{LA_HANGMAN_QUOTE_ALREADY}");

	document.frm.res.disabled=false;
	document.frm.hm.src="../ext/dmzx/hangman/styles/all/theme/images/hmstart3.gif";

	for(var i=65; i<=90; i++)
		document.getElementById(String.fromCharCode(i)).style.backgroundColor='#D3D3D3';
}

function restart(form)
{
	running=1;
	failnum=0;
	form.lives.value=failnum;
	form.tried.value="";
	form.correct.value="";
	form.word.value="";
	index=Math.round(Math.random()*10000) % 100;
	alpha[0]=words[index].charAt(0);
	alpha[1]=words[index].charAt(words[index].length-1);
	alpha_index=1;
	bravo[0]=words[index].charAt(0);
	bravo[1]=words[index].charAt(words[index].length-1);
	bravo_index=1;
	pick();
	document.frm.hm.src="../ext/dmzx/hangman/styles/all/theme/images/hmstart3.gif";

	for(var i=65; i<=90; i++)
		document.getElementById(String.fromCharCode(i)).style.backgroundColor='#D3D3D3';
}

function seek(letter)
{
	if(!running)
		alert("{LA_HANGMAN_NEW_QUOTE_TO}");
	else
	{
		t=0;
		for(i=0; i<=bravo_index; i++)
			if (bravo[i]==letter || bravo[i]==letter.toLowerCase()) t=1;

		if(!t)
		{
			bravo_index++;
			bravo[bravo_index]=letter;

			for(i=0;i<words[index].length;i++)
				if(words[index].charAt(i)==letter || words[index].charAt(i)==letter.toLowerCase()) t=1;

			if(t)
			{
				alpha_index++;
				alpha[alpha_index]=letter;
				document.frm.correct.value+=letter+" ";
			  		document.getElementById(letter).style.backgroundColor='#FFF8DC';
			}
			else
			{
				failnum++;
				document.frm.tried.value+=letter+" ";
				eval("document.hm.src=\"../ext/dmzx/hangman/styles/all/theme/images/hm" + failnum + ".gif\"");
			  		document.getElementById(letter).style.backgroundColor='#CCD8FF';
			}

			document.frm.lives.value=failnum;

			if(failnum==10)
			{
				alert('{LA_HANGMAN_YOU_LOSE}');
				document.frm.score.value--;
				running=0;
				new_word(document.frm);
			}
			else pick();
		}
		else
			advise("{LA_HANGMAN_LETTER} "+letter+" {LA_HANGMAN_ALREADY_USED}");
	  }

}

function advise(msg)
{
	if(!advising)
	{
		advising=-1;
		savetext=document.frm.correct.value;
		document.frm.correct.value=msg;
		window.setTimeout("document.frm.correct.value=savetext; advising=0;",500);
	}
}
//]]>
</script>

User avatar

Yerunad
Users
Users
Posts: 5
Joined: 14 Nov 2015, 23:44
    Windows 10 Firefox

Re: Hangman Game

Post by Yerunad »

ninowebs wrote:where is this code?

Code: Select all

../ext/dmzx/hangman/styles/all/template/event/overall_footer_after.html

User avatar

ninowebs
Users
Users
Posts: 29
Joined: 04 Jun 2015, 23:44
    Windows 7 Chrome

Re: Hangman Game

Post by ninowebs »

Yerunad wrote:
ninowebs wrote:where is this code?

Code: Select all

../ext/dmzx/hangman/styles/all/template/event/overall_footer_after.html
thank you so much

User avatar

ninowebs
Users
Users
Posts: 29
Joined: 04 Jun 2015, 23:44
    Windows 7 Chrome

Re: Hangman Game

Post by ninowebs »

Pardon ,
I can change this with the words of my language ?

Code: Select all

var words = new Array("The Godfather",
                "The Shawshank Redemption",
                "Schindlers List",
                "Raging Bull",
                "Casablanca",
                "One Flew Over the Cuckoos Nest",
                "Gone with the Wind",
                "Citizen Kane",
                "The Wizard of Oz",
                "Titanic",
                "Lawrence of arabia",
                "The Godfather Part II",
                "Psycho",
                "Sunset Blvd",
                "Vertigo",
                "On the Waterfront",
                "Forrest Gump",
                "The Sound of Music",
                "West Side Story",
                "Star Wars",
                "E T The Extra Terrestrial",
                "A Space Odyssey",
                "The silence of the Lambs",
                "Chinatown",
                "The Bridge on the River Kwai",
                "Singin in the Rain",
                "Its a Wonderful Life",
                "Some Like It Hot",
                "Twelve Angry Men",
                "Dr Strangelove",
                "Amadeus",
                "Apocalypse Now",
                "Gandhi",
                "The Lord of the Rings",
                "Gladiator",
                "From Here to Eternity",
                "Saving Private Ryan",
                "Unforgiven",
                "Raiders of the Lost Ark",
                "Rocky",
                "A Streetcar Named Desire",
                "The Philadelphia Story",
                "To Kill a Mockingbird",
                "An American in Paris",
                "The Best Years of Our Lives",
                "My Fair Lady",
                "Ben Hur",
                "Doctor Zhivago",
                "Patton",
                "Jaws",
                "Braveheart",
                "The Good the Bad and the Ugly",
                "Butch Cassidy and the Sundance Kid",
                "The Treasure of the Sierra Madre",
                "The Apartment",
                "Platoon",
                "High noon",
                "Dances with Wolves",
                "The Pianist",
                "Goodfellas",
                "The Exorcist",
                "The Deer Hunter",
                "All Quiet on the Western Front",
                "The French Connection",
                "City Lights",
                "The Kings Speech",
                "It Happened One Night",
                "A Place in the Sun",
                "Midnight Cowboy",
                "Mr Smith Goes to Washington",
                "Rain Man",
                "Annie Hall",
                "Good Will Hunting",
                "Terms of Endearment",
                "Tootsie",
                "Fargo",
                "The Grapes of Wrath",
                "The Green Mile",
                "Close Encounters of the Third Kind",
                "The Graduate",
                "American Graffiti",
                "Pulp Fiction",
                "The African Queen",
                "Bonnie and Clyde",
                "Mutiny on the Bounty");
thank you

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6464
Joined: 13 Jan 2014, 21:45
    Windows 8 Firefox

Re: Hangman Game

Post by dmzx »

ninowebs wrote:pardon ,
I can change this with the words of my language ?

Code: Select all

var words = new Array("The Godfather",
                "The Shawshank Redemption",
                "Schindlers List",
                "Raging Bull",
                "Casablanca",
                "One Flew Over the Cuckoos Nest",
                "Gone with the Wind",
                "Citizen Kane",
                "The Wizard of Oz",
                "Titanic",
                "Lawrence of arabia",
                "The Godfather Part II",
                "Psycho",
                "Sunset Blvd",
                "Vertigo",
                "On the Waterfront",
                "Forrest Gump",
                "The Sound of Music",
                "West Side Story",
                "Star Wars",
                "E T The Extra Terrestrial",
                "A Space Odyssey",
                "The silence of the Lambs",
                "Chinatown",
                "The Bridge on the River Kwai",
                "Singin in the Rain",
                "Its a Wonderful Life",
                "Some Like It Hot",
                "Twelve Angry Men",
                "Dr Strangelove",
                "Amadeus",
                "Apocalypse Now",
                "Gandhi",
                "The Lord of the Rings",
                "Gladiator",
                "From Here to Eternity",
                "Saving Private Ryan",
                "Unforgiven",
                "Raiders of the Lost Ark",
                "Rocky",
                "A Streetcar Named Desire",
                "The Philadelphia Story",
                "To Kill a Mockingbird",
                "An American in Paris",
                "The Best Years of Our Lives",
                "My Fair Lady",
                "Ben Hur",
                "Doctor Zhivago",
                "Patton",
                "Jaws",
                "Braveheart",
                "The Good the Bad and the Ugly",
                "Butch Cassidy and the Sundance Kid",
                "The Treasure of the Sierra Madre",
                "The Apartment",
                "Platoon",
                "High noon",
                "Dances with Wolves",
                "The Pianist",
                "Goodfellas",
                "The Exorcist",
                "The Deer Hunter",
                "All Quiet on the Western Front",
                "The French Connection",
                "City Lights",
                "The Kings Speech",
                "It Happened One Night",
                "A Place in the Sun",
                "Midnight Cowboy",
                "Mr Smith Goes to Washington",
                "Rain Man",
                "Annie Hall",
                "Good Will Hunting",
                "Terms of Endearment",
                "Tootsie",
                "Fargo",
                "The Grapes of Wrath",
                "The Green Mile",
                "Close Encounters of the Third Kind",
                "The Graduate",
                "American Graffiti",
                "Pulp Fiction",
                "The African Queen",
                "Bonnie and Clyde",
                "Mutiny on the Bounty");
thank you

Yes you can and you can add also more if you want.

User avatar

ninowebs
Users
Users
Posts: 29
Joined: 04 Jun 2015, 23:44
    Windows 7 Chrome

Re: Hangman Game

Post by ninowebs »

Cattura.JPG
ninowebs wrote:
When I try genres Only a vacuum , I do not give me letters

my code
var words = new Array("casa",
"nido",
"pesce");
pardon ,
I can change this with the words of my language ?

Code: Select all

var words = new Array("The Godfather",
                "The Shawshank Redemption",
                "Schindlers List",
                "Raging Bull",
                "Casablanca",
                "One Flew Over the Cuckoos Nest",
                "Gone with the Wind",
                "Citizen Kane",
                "The Wizard of Oz",
                "Titanic",
                "Lawrence of arabia",
                "The Godfather Part II",
                "Psycho",
                "Sunset Blvd",
                "Vertigo",
                "On the Waterfront",
                "Forrest Gump",
                "The Sound of Music",
                "West Side Story",
                "Star Wars",
                "E T The Extra Terrestrial",
                "A Space Odyssey",
                "The silence of the Lambs",
                "Chinatown",
                "The Bridge on the River Kwai",
                "Singin in the Rain",
                "Its a Wonderful Life",
                "Some Like It Hot",
                "Twelve Angry Men",
                "Dr Strangelove",
                "Amadeus",
                "Apocalypse Now",
                "Gandhi",
                "The Lord of the Rings",
                "Gladiator",
                "From Here to Eternity",
                "Saving Private Ryan",
                "Unforgiven",
                "Raiders of the Lost Ark",
                "Rocky",
                "A Streetcar Named Desire",
                "The Philadelphia Story",
                "To Kill a Mockingbird",
                "An American in Paris",
                "The Best Years of Our Lives",
                "My Fair Lady",
                "Ben Hur",
                "Doctor Zhivago",
                "Patton",
                "Jaws",
                "Braveheart",
                "The Good the Bad and the Ugly",
                "Butch Cassidy and the Sundance Kid",
                "The Treasure of the Sierra Madre",
                "The Apartment",
                "Platoon",
                "High noon",
                "Dances with Wolves",
                "The Pianist",
                "Goodfellas",
                "The Exorcist",
                "The Deer Hunter",
                "All Quiet on the Western Front",
                "The French Connection",
                "City Lights",
                "The Kings Speech",
                "It Happened One Night",
                "A Place in the Sun",
                "Midnight Cowboy",
                "Mr Smith Goes to Washington",
                "Rain Man",
                "Annie Hall",
                "Good Will Hunting",
                "Terms of Endearment",
                "Tootsie",
                "Fargo",
                "The Grapes of Wrath",
                "The Green Mile",
                "Close Encounters of the Third Kind",
                "The Graduate",
                "American Graffiti",
                "Pulp Fiction",
                "The African Queen",
                "Bonnie and Clyde",
                "Mutiny on the Bounty");
thank you
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.

User avatar

Yerunad
Users
Users
Posts: 5
Joined: 14 Nov 2015, 23:44
    Windows 10 Firefox

Re: Hangman Game

Post by Yerunad »

You have low words.
On my forum we fix it by this way:

Find

Code: Select all

index=Math.round(Math.random()*10000) % 100;
Replace

Code: Select all

index=Math.round(Math.random()*10000) % words.length-1;
Last edited by Yerunad on 16 Nov 2015, 22:10, edited 1 time in total.

Locked Previous topicNext topic