An open API service indexing awesome lists of open source software.

https://github.com/vexcited/shifugo

A simple rock paper scissors game made with Jetpack Compose as a school project for the resource R4A.11
https://github.com/vexcited/shifugo

jetpack-compose kotlin rock-paper-scissors school-assignment

Last synced: about 1 year ago
JSON representation

A simple rock paper scissors game made with Jetpack Compose as a school project for the resource R4A.11

Awesome Lists containing this project

README

          

# ShiFuGo

Rock paper scissors is an intransitive hand game, usually played between two people, in which each player simultaneously forms one of three shapes with an outstretched hand. These shapes are "rock" (a closed fist), "paper" (a flat hand), and "scissors" (a fist with the index finger and middle finger extended, forming a V).

A simultaneous, zero-sum game, it has three possible outcomes: a draw, a win, or a loss. A player who decides to play rock will beat another player who chooses scissors ("rock crushes scissors" or "breaks scissors"), but will lose to one who has played paper ("paper covers rock"); a play of paper will lose to a play of scissors ("scissors cuts paper"). If both players choose the same shape, the game is tied, but is usually replayed until there is a winner.

## Screenshots

| Homepage | Singleplayer |
| -------- | ------------ |
| ![image](https://github.com/user-attachments/assets/46050055-fa3d-417d-93aa-72f43a3624ec) | ![image](https://github.com/user-attachments/assets/b2aed6aa-2fa5-4f4d-b60f-60a2b9726213) |

## Single Player: Game Strategy

Starting from V3, we aim to enhance the gaming experience by implementing a strategic approach for both the human player and the computer opponent. The strategy is designed to make the game more engaging and challenging.

### Player

- The system suggests a weapon for the player based on the computer's history
- Analyzes the computer's most frequently used weapon
- Suggests a counter-weapon to the computer's most common choice
- Example: If the computer frequently uses Rock, the system will suggest Paper

### Computer

1. **Pattern Recognition**
- Analyzes the player's move patterns
- Tracks sequences of weapons used by the player
- Identifies if the player tends to follow specific patterns (e.g., switching from Rock to Paper frequently)

2. **Adaptive Counter-Strategy**
- First attempts to predict the player's next move based on detected patterns
- If a pattern is detected, chooses a weapon to counter the predicted move
- If no pattern is detected, counters the player's last move
- Falls back to random selection only when no history is available

## Scoring

Starting from V4, we implement a scoring system, the game tracks several types of records:

1. **Win Streak**
- Tracks consecutive wins
- Resets on loss or tie

2. **Total Wins**
- Tracks lifetime wins
- Persists between game sessions

3. **Win Rate**
- Calculates win percentage (wins / total games)
- Requires minimum 10 games played