CMSC 434            Homework #1            Fall 2018

Making Math Fun?

Due on ELMS as a PDF and an APK by 11pm on September 26th.
Two XKCD people wearing hats.  One red, one blue.
(stick figures modified from XKCD)

For this homework assignment, you will attempt to make a math problem into a game of some sort.

There is a set of problems where people have hats of one of two colors placed on their head in a way that they cannot see their own hat color and they are asked to guess what color hat they are wearing.

One version of this has two people face each other so they are able to see the hat color of the other person. They then have to make simultaneous guesses about their own hat's color. If at least one of the two is right, they both win. They are allowed to come up with a plan in advance, but the adversary who is deciding which hats to put on them will hear the plan and will actively work against it.

There is a winning strategy for the two person, two hat color game. The two people agree that a specific one of them will always guess that their hat is the same color as the one they see on the other person, while the other person will always guess that their hat is the other color from the one they see on the first person.

We have placed a basic Android Studio project at
   http://www.cs.umd.edu/class/fall2018/cmsc434-0201/TwoHats.zip
that creates a simple app where the user can select the hat color of each of the two people, press a button, and see what the strategy leads to as guesses.

For this homework assignment, you will:
  • create a paper or digital (using some image editing/drawing program) mock-up of a modified app such that there are three hat colors and four people placed in a scenario where person 1 and person 3 can see both person 2 and person 4 (and vice versa) but where person 1 and person 3 can't see each other, and person 2 and person 4 can't see each other - the user is still able to set all of the hat colors and press a button and see what a predetermined strategy will guess (if you'd like to see a stragegy that guarantees at least one of the four people is correct, click here)

  • come up with a "story" around the four-person app that somehow turns it into a game (concept, game mechanics) and your mock-up might need to reflect elements of this or you can choose to have your user read the story before playing [you can click here to see an example two-player story]

  • thinking about your vision for the four-player version, modify the Android Studio project so that it allows the two-player version to still be played, but has an improved look and feel to it, perhaps in line with your mock-up, or perhaps just inspired by it a little - the minimum changes we will require are:
    • have a consistent approach to selecting the hat colors of the two people (this could be making them both radio-button-based or both dropdown-based, or having both use some other visual metaphor for selection)
    • have some visual feedback using the actual colors red and blue letting the user see the color of each person's hat on the screen
    you will submit the APK for this app as well as two screenshots (one showing Person 1 having a red hat and Person 2 having a blue hat and the other showing Person 1 having a blue hat and Person 2 having a red hat)




  • ELMS will be set up to allow you to upload a PDF and an APK.

    The PDF will need to contain your four-player drawing mock-up, your game story, and the screenshots of the modified two-player app. The APK needs to be of the modified two-player app in case we want to run it and try it out.









    Web Accessibility