A fun and smart number guessing game built with React Native and Expo.
The phone uses binary search to guess your secret number (1-99) in the fewest rounds possible – and it even catches you if you try to cheat😏
Perfect beginner project to showcase core React Native concepts.
Home Screen |
Invalid Input Alert |
Game Screen |
Cheat Detection Alert |
Game Over Screen |
Screenshots taken on Android device – clean UI with gradient & dice background 🎲
- Beautiful UI with LinearGradient + dice ImageBackground (opacity for cool effect)
- Binary search algorithm for optimal guessing
- Cheat detection (alert if you lie about higher/lower)
- Tracks guess history and shows rounds count on Game Over
- Custom reusable components (PrimaryButton, Guess item, Alert, Appbar)
This simple app covers essential React Native fundamentals:
- State Management: useState for userNumber, rounds, bounds, currentGuess
- Conditional Rendering: Switch between StartGameScreen, GameScreen, GameOverScreen in App.js
- Props & Callbacks: Passing handlers like pickedNumberHandler, gameOverHandle
- Custom Components: PrimaryButton with Pressable + pressed state, Guess list item
- Styling: StyleSheet, shadows, elevation, LinearGradient, ImageBackground
- User Input & Validation: TextInput with number-pad, Alert for invalid input
- Lists: FlatList for guess history in GameOverScreen
- Side Effects: useEffect for initial random guess
- React Native
- Expo (expo-linear-gradient)
- Pure JavaScript (no external state libraries)




