Challenge: Limited Cheats

Allow the user to cheat a maximum of three times. Keep track of the user’s cheat occurrences and display the number of remaining cheat tokens below the cheat button. If no tokens remain, disable the cheat button.

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.