cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fbxiii
Level: Powered On

Hangman game

 

My App is a company wide knowledge store to enable people to enter information into it and then others can search the App to read the information.

 

I've been asked whether it is possible to have an educational kind of game within the App to aid learning (honest!).

 

Thinking of basic word games, I decided to try and take Hangman on.  It Selects 1 of the definitions in the App at random and the user has to guess what it is.

 

I've got as far as 'drawing' a hangman using Icons, presenting the User with the letters from the alphabet and then using a Find to determine if their selection is in the word or not and removing the selected letter from the collection if it isn't in the definition.

 

I'm struggling with the last part and thats displaying empty fields to represent each Letter and also finding the other positions of the same letter within the word so I can show them in the empty fields.

 

Does anyone know if this is at all possible?

 

Here is my screen so far.

 

Hangman.PNG

8 REPLIES 8
Sienna
Level 10

Re: Hangman game

Wow that is very interesting way of learning. I wish I came up with this idea when I was learning. I thing there are many ways to achive that. I probably would create a Database with all words in it saved by letters for example

Id Letter1 Letter2. Letter3. Letter4. Letter5 ...
1. H. E. L. L. O
2. C. A. R. %. %

Then create a button New Game which would randomly pick a number and filter a line of the table based on the random number without % in a gallery .Then I would add an input text for guessing letters and label for displayng wrong letters. Once the letter match a letter in a gallery I would make the letter visible in a gallery. If not add it to label and update variable which vould make visible one of the icon.
Hope I point you on the right direction
fbxiii
Level: Powered On

Re: Hangman game

It introduces them to new things in an interesting way I thought 🙂

 

I have made progress on this now.

 

I've added a button that uses split to create a collection of the Letters in the word.  I've tied a horizontal gallery to the collection and can display the letters in it.  Setting the Font colour to the same as the background hides the Letters in the word.

 

Now I just need to get the Font colour to change when they select a correct letter.

 

Capture.PNG

nickduxfield
Level 8

Re: Hangman game

hahahah education game in the app, I love this.

Can't believe how much youve dreamed up so far.

 

How about a simple variable & if statement with updatecontext to change color?

 

fbxiii
Level: Powered On

Re: Hangman game

 

I'm trying to capture the correct letters in a collection then change the Color property of the label to white if the displayed letter is in the collection.

 

If(ThisItem.Result in LetterSelected,RGBA(255,255,255,1))

 

But it is just highlighting the selected letter and not all within the collection.

nickduxfield
Level 8

Re: Hangman game

Try using the IN or ExactIn by comparing 2 collections.

fbxiii
Level: Powered On

Re: Hangman game

I need to reference whats in the gallery to the correct letters collection I think but can't figure it out.

fbxiii
Level: Powered On

Re: Hangman game

I've set all of the Hangmans icons to not visible and set an IncorrectLetters count when a letter isn''t in the definition.  Then I am using that on each part of the hangman with an If statement to show when the counter increments.

 

It's close to working I think 🙂

nickduxfield
Level 8

Re: Hangman game

I was just going to say, try the Visible attribute. its probably easier.

Keep going.You know its harder when its not in front of you.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (1,924)