IoT Challenge 1

Dependencies:   microbit-dal

Committer:
jeffloh33
Date:
Mon Feb 10 13:33:15 2020 +0000
Revision:
15:c1e95fe32630
Parent:
1:af427e419320
Paper, scissors & rock;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jeffloh33 15:c1e95fe32630 1 ## Project Title
jeffloh33 15:c1e95fe32630 2 Paper, Scissors and Rock
Jonathan Austin 1:af427e419320 3
Jonathan Austin 1:af427e419320 4
jeffloh33 15:c1e95fe32630 5 ## Getting Started
jeffloh33 15:c1e95fe32630 6 Button A is used for the counting score function
jeffloh33 15:c1e95fe32630 7 Button B is used for display Paper, Scissors and Rock in randomly
jeffloh33 15:c1e95fe32630 8
Jonathan Austin 1:af427e419320 9
jeffloh33 15:c1e95fe32630 10 ## How to play the game
jeffloh33 15:c1e95fe32630 11 This game need to play by 2 players and each player hold one Micro:Bit. Players press the buttonB to randomly
jeffloh33 15:c1e95fe32630 12 show Paper, Scissor & Rock. The player who won the round, press buttonA to add the score. The player who reach
jeffloh33 15:c1e95fe32630 13 5 score first win the game.
Jonathan Austin 1:af427e419320 14
Jonathan Austin 1:af427e419320 15
jeffloh33 15:c1e95fe32630 16 ## Examples
jeffloh33 15:c1e95fe32630 17 P1 and P2 press buttonB. P1's MicroBit display Scissors, and P2's MicroBit display Rock. So, P2 win the first
jeffloh33 15:c1e95fe32630 18 round. P2 press buttonA to add 1 score.
jeffloh33 15:c1e95fe32630 19 Then, both players press buttonB again for the next round. P1 shows Rock and P2 shows scissors. P1 press
jeffloh33 15:c1e95fe32630 20 buttonA to add score.
jeffloh33 15:c1e95fe32630 21 Round 3, P1 get scissors and P2 get Paper. P1 press buttonA to add score. Now P1 got 2 scores and P2 got 1.
jeffloh33 15:c1e95fe32630 22 The player reach 5 scores first win the game.
jeffloh33 15:c1e95fe32630 23
Jonathan Austin 1:af427e419320 24
jeffloh33 15:c1e95fe32630 25 ## How to build it
jeffloh33 15:c1e95fe32630 26 This simple mini game is build by c++ language. Some simple if statement are used to display something when
jeffloh33 15:c1e95fe32630 27 player press the buttons. A random function is also used to generate a random number between 1-3 in this game,
jeffloh33 15:c1e95fe32630 28 if the random number is 1, it will display a Scissors image on MicroBit, number 2 will display Rock image and number
jeffloh33 15:c1e95fe32630 29 3 display Paper image. A counting function used to count the player's score. The count will automatically add 1
jeffloh33 15:c1e95fe32630 30 when player pressed buttonA and then display a win message when the score is 5.
Jonathan Austin 1:af427e419320 31
jeffloh33 15:c1e95fe32630 32
jeffloh33 15:c1e95fe32630 33 ## Built With
jeffloh33 15:c1e95fe32630 34 * Mbed Compiler
jeffloh33 15:c1e95fe32630 35 * c++ programming language
jeffloh33 15:c1e95fe32630 36 * BBC Micro:Bit
Jonathan Austin 1:af427e419320 37
Jonathan Austin 1:af427e419320 38
Jonathan Austin 1:af427e419320 39