IoT Challenge 1

Dependencies:   microbit-dal

README.md

Committer:
jeffloh33
Date:
2020-02-10
Revision:
15:c1e95fe32630
Parent:
1:af427e419320

File content as of revision 15:c1e95fe32630:

## Project Title
Paper, Scissors and Rock


## Getting Started
Button A is used for the counting score function 
Button B is used for display Paper, Scissors and Rock in randomly
 

## How to play the game 
This game need to play by 2 players and each player hold one Micro:Bit. Players press the buttonB to randomly
show Paper, Scissor & Rock. The player who won the round, press buttonA to add the score. The player who reach
5 score first win the game.


## Examples
P1 and P2 press buttonB. P1's MicroBit display Scissors, and P2's MicroBit display Rock. So, P2 win the first 
round. P2 press buttonA to add 1 score. 
Then, both players press buttonB again for the next round. P1 shows Rock and P2 shows scissors. P1 press 
buttonA to add score.
Round 3, P1 get scissors and P2 get Paper. P1 press buttonA to add score. Now P1 got 2 scores and P2 got 1.
The player reach 5 scores first win the game.
 

## How to build it
This simple mini game is build by c++ language. Some simple if statement are used to display something when
player press the buttons. A random function is also used to generate a random number between 1-3 in this game,
if the random number is 1, it will display a Scissors image on MicroBit, number 2 will display Rock image and number
3 display Paper image. A counting function used to count the player's score. The count will automatically add 1 
when player pressed buttonA and then display a win message when the score is 5.


## Built With
* Mbed Compiler
* c++ programming language
* BBC Micro:Bit