I will love your help as I am trying to retrieve list items, but I cannot. What I’m looking to achieve:
I have a variable where I create a list of 6 items, each of them have 3 items: an index number, a color and a button.
When initializing the screen, I want to retrieve 4 random elements from this list and then change the color of 4 other buttons by the selected color, and change the text of a label by displaying the 4 indexes of each selected item.
I’m not sure if I’m clear in what I’m writing, but here are my blocks, maybe you can figure out what I want:
So that you understand exactly my goal, I want to make the MasterMind game, a game where there is a series of 4 colored pawns (chosen randomly from a list of 6 colors).
These 4 pawns are hidden for the player, and that player must guess which colors are and in the correct order.
He has several tries (12 it seems to me, I have to find the rules). And at each test, you have to see if the combination he gave is correct. If a color is present and in the right place, we put a white pawn, if the color is present but not in the right place, we put a black pawn and if the color is not present we do not put anything.
Oooh woaw! Awesome the game, it’s a collector’s item you have, @dora_paz ! It reminds me of memories, my father had a pretty similar box, but I think he doesn’t have it anymore.
I test your aia tonight and see if it works well! Thanks to you for the help!
Tested apk, you are close but this is not exactly what mastermind is about @Still-learning When 4 colors are chosen you have to inform the player whether he found the combination of colors or if he has found any colors and also if they were placed in the correct order or not. For doing that you may use up to 4 black or white pins.
A black clue means that there is a correct color in the correct place.
A white clue means that a correct color is in the wrong place.
An empty clue slot means that a wrong color has been placed
If for example with the first try I found only one color and I placed in the wrong position then I get informed about that and I continue from that point with a white clue and 3 empty slots. I change my combinations of colors and then I get informed that I have one in wrong position and one in correct, one white clue, one black, two empty slots and so on … In original board game I have 12 attempts to get the correct combination
@dora_paz , Mam, As per your suggestion added in the post. i made a sample app… If possible just try (anyone, it is offline app with no permission) and let me know…
In VSA, if your attempt crosses more than 6 means, then i would like to hide the preceding things… and it can be viewable if your turn completes or finished… also, there is no term for repetition in the lists… You cannot pick up two colors during a attempt… i dont whether know repetition is allowed or not in this game…
Sorry, due to network connectivity, some of the blocks not saved properly… Now you try this…