# 🎮 WDC #24 Let's Play Mastermind!

**URL:** <https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130>\
**Category:** Teachers' Lounge\
**Tags:** wdc\
**Created:** [October 1, 2021, 3:24pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130 "2021-10-01T15:24:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [October 1, 2021, 3:24pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/1 "2021-10-01T15:24:04Z")

</div>

Has anyone ever played this game before? (Does it go by any different names around the world?)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/9/49f4cb2172fbf4038c5bb09fdcd10af348b22c44.jpeg)

If you’re not familiar with it, there are lots of videos and tutorials online - here’s just [one example](https://www.wikihow.com/Play-Mastermind) but feel free to share others if you think they give a better explanation.

This weekend, let’s try to recreate this classic game in Thunkable. I’m hoping to be able to get this working myself, and my only tip at this stage would be to start with a simple “Match 2” version and then progress to the more complex “Match 3” and “Match 4” versions.

Good luck!

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [October 1, 2021, 3:24pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/2 "2021-10-01T15:24:14Z")

</div>

## Summary of Entries

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 1, 2021, 3:37pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/3 "2021-10-01T15:37:51Z")

</div>

I love this game and play it all the time! Hoping to be able to get something together for this.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 1, 2021, 4:00pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/4 "2021-10-01T16:00:15Z")

</div>

I never play games. My mind refuses to understand them and could not figure out why.

---

<div class="post-metadata">

**Author:** ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)\
**Post date:** [October 1, 2021, 4:58pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/5 "2021-10-01T16:58:15Z")

</div>

@domhnallohanlon 1A2B This game is called mastermind or cows and bulls abroad (The content is excerpted from the [Chinese website](https://blog.edumeme.org/2018/07/1a2b.html?m=1))  
Is the rule similar to this? [Y.C.Y. Program - 1A2B](https://sites.google.com/view/ycyprogram/1a2b)

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [October 1, 2021, 7:11pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/6 "2021-10-01T19:11:50Z")

</div>

> [@tony.ycy.program](#):
>
> Is the rule similar to this? [Y.C.Y. Program - 1A2B](https://sites.google.com/view/ycyprogram/1a2b)

Wow, this looks great. Yep, very similar underlying logic, to only difference really is the UI. (Should be an easy one for you so @tony.ycy.program! 😂)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 1, 2021, 8:08pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/7 "2021-10-01T20:08:46Z")

</div>

Loved this game as a kid! My grandparents in Arizona had it and I would play it with them when I visited.

@muneer, it’s a great logic game. I think you might like it! Let’s have a Zoom meeting and I can play it with you. 😆

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 2, 2021, 6:27am UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/9 "2021-10-02T06:27:33Z")

</div>

[![](https://img.youtube.com/vi/5jtcsBERDEQ/maxresdefault.jpg "How to play Mastermind") ](https://www.youtube.com/watch?v=5jtcsBERDEQ&t=81s)

---

<div class="post-metadata">

**Author:** ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)\
**Post date:** [October 2, 2021, 7:11am UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/10 "2021-10-02T07:11:13Z")

</div>

@domhnallohanlon  
This is a screenshot of my app.

[![](https://img.youtube.com/vi/fSlf-6tCbdI/maxresdefault.jpg "1A2B Mastermind") ](https://www.youtube.com/watch?v=fSlf-6tCbdI)

 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/0/a0b2b7ebf529f57a2676a15afb9d3ae5a498b8b4.jpeg)  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/4/94429346b56ed0321855a474721f89695a7f021f.jpeg)  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/3/93b8e30fca1d768c374d26fe95c33b21a5187023.jpeg)  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/c/5c0520fe577a6ab764bed9ab7bdf6f2babe67a44.jpeg)  
 ![圖片](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/6/c63504ade27aac15a038858eb589ed38a2e50f98.jpeg)

Everything is normal, there are 10 balls in total, I just changed the black (Red) and white cue balls to A and B!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 2, 2021, 1:29pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/11 "2021-10-02T13:29:24Z")

</div>

> [@tatiang](#):
>
> I think you might like it! Let’s have a Zoom meeting and I can play it with you. 😆

That’s an offer I cannot refuse. Tell me your convenient time and I’ll be available for it. You’re a teacher and I’m confident you have a way to make it stick into my thick mind.

---

<div class="post-metadata">

**Author:** ![vishruth-ram](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vishruth-ram](https://community.thunkable.com/u/vishruth-ram)\
**Post date:** [October 3, 2021, 3:06am UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/12 "2021-10-03T03:06:30Z")

</div>

I’ve NEVER played it before! 😇

this #wdc sounds wierd.I don’t know if we have to create it online or play it. 🙃

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 3, 2021, 3:26am UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/13 "2021-10-03T03:26:00Z")

</div>

> [@vishruth-ram](#):
>
> if we have to create it online or play it.

**WDC** stands for Weekend Design Challenge. Take good notice of the middle one **Design** , it means you need to develop the game and if you can then play your own developed one then it would be fine.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 3, 2021, 6:21am UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/14 "2021-10-03T06:21:53Z")

</div>

This is a hard challenge for me. I decided to use the Snap To Place interface so I could take advantage of the clone blocks. But I had to do some mental gymnastics to convert the cloned button positional values that are generated using Any Component blocks with button lists to what I expect them to be (e.g. bottom-left button is #1, top-right button is #40).

Here’s what I have so far. You can click a button to generate a label value for its position (just for debugging purposes), click a button in the first row **only** to set a guess color, and you can cycle through six available colors.

I haven’t programmed the check against the secret pattern/code or the results feedback of pegs yet.

[![](https://img.youtube.com/vi/urrMYAffXmk/maxresdefault.jpg "Mastermind early demo") ](https://www.youtube.com/watch?v=urrMYAffXmk)

(No sound; the black circles for each click are just from Quicktime’s screen capture… they don’t show up in the actual project)

**Edit:** got basic pattern checking now. No feedback pegs yet but if you happen to guess the correct pattern, it will tell you at the top. The secret pattern is randomized each time and is only displayed here for debugging purposes.

[![](https://img.youtube.com/vi/N1dAWhLijKY/maxresdefault.jpg "Mastermind progress demo") ](https://www.youtube.com/watch?v=N1dAWhLijKY)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 3, 2021, 8:43am UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/15 "2021-10-03T08:43:23Z")

</div>

I did the button test in a simpler way. I have a variable that tracks the row being played and with the `Any Button` in that row I just have **Four** buttons that I change the color so I just check the position of the button in the active row. When you click on any button in any other row, nothing happens.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 3, 2021, 1:02pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/16 "2021-10-03T13:02:37Z")

</div>

I’m using the same technique!

---

<div class="post-metadata">

**Author:** ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)\
**Post date:** [October 3, 2021, 2:25pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/17 "2021-10-03T14:25:54Z")

</div>

I use data display (row-shaped).  
He can display content by himself. It can also be copied infinitely (it seems to be less than 100 after testing).  
These programs can be relatively simple.

---

<div class="post-metadata">

**Author:** ![tony.ycy.program](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tony.ycy.program/32/100153_2.png) [@tony.ycy.program](https://community.thunkable.com/u/tony.ycy.program)\
**Post date:** [October 3, 2021, 3:38pm UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/18 "2021-10-03T15:38:34Z")

</div>

This is my app!  
[Download the test from the Google Play Store!](https://play.google.com/apps/testing/com.gmail.app97204.numbergame)

Note:

- Although the app name is different from the challenge title, both can be played!
- Mastermind is customarily called 1A2B in Taiwan🇹🇼 (the red mark is A and the white mark is B).
- This app provides dual language.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 4, 2021, 9:14am UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/19 "2021-10-04T09:14:07Z")

</div>

Hi everyone,

After a valuable session from an extraordinary teacher ( @tatiang ) showing me how this game works, I am presenting my attempt in developing the game in **DnD UI**. It is not yet complete and has lots of small issues such as the unavailability of the `Any Components` features and some unexplainable issue with colors.

[https://x.thunkable.com/projectPage/61597201fbd1fa0011f30a15](https://x.thunkable.com/projectPage/61597201fbd1fa0011f30a15)

Some images

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/4/2495f3e945519f2fbae93d3af7692b144acc66eb.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/6/266ad8dd7e753490bb316663a8bbcbb3af8661ea.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/3/93e81b59a7bf2fa589d654ce4f95a3ea2c16e26f.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/1/b180d5d147fa9e3eda2390e1522370cd647c3496.png)

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [October 4, 2021, 11:01am UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/20 "2021-10-04T11:01:26Z")

</div>

The flashing animation effect before you win is fantastic - thanks @muneer, great implementation!

 ![Screenshot 2021-10-04 at 12.00.03](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/7/577960849ea7801d53b37a55d21b2c2509e1675c.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 4, 2021, 11:08am UTC](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130/21 "2021-10-04T11:08:52Z")

</div>

> [@domhnallohanlon](#):
>
> flashing animation effect before you win is fantastic

Many thanks for your comments.

[Next page](https://community.thunkable.com/t/wdc-24-lets-play-mastermind/1538130.md?page=2)
