The Basics of Coin Toss
There is little code snippet that's so simple yet holds so much potential.
<!-- JavaScript -->
let result;
let randomNumber = Math.floor(Math.random() * 2);
if (randomNumber == 0) {
result = "Heads"
}else{
result = "Tails"
}
The MVP
The app that I made was not what I set out to make. I set out to make a global leaderboard of the luckiest people in the current week. That would be decided by the current score of coinflips. At some point I realized that if I settle for nothing less, then it would take a heck of a lot more time. So I scaled back. The minimum viable product in this case was a bare bones coin tossing app that keeps track of the owners record and has an animated toss.
The MVP used only one of the screens:
Tools I used
The Progression
- Write flipping and win/lose logic in plain Javascript
- UI design
- Set up an Expo project
- Write the logic in React Native
- Make the flip animation
- Implement animation with Lottie
- Implement adds with AdMob
- Publish @ Expo
- Publish @ Play Store
The Take Away
I'm incredibly happy for having something I made up and live. This was my first project with a multitude of frameworks. Incredible feeling. But that's not it for this little project. Next up, let's find out who's the luckiest person in the world:)
Until then - download for Android devices
If you're walking down the right path and you're willing to keep walking, eventually you'll make progress. Barack Obama