Number Guessing Game
The number guessing game project allows the Picobricks to find a number that you keep in the range of 1-128 by directing the Picobricks with the help of an IR sensor and remote control.
After pressing the button, Picobricks makes the first guess and waits for the player to direct by using the "up", "down" and "ok" keys of the controller.
Project Algorithm
- Start when button is pressed.
- Divide the max prediction value by 2.
- If the player presses the up key, that is, if Picobricks’ prediction is less than the player’s number, divide the guess interval by 2 again and add it to the current Picobricks’ prediction.
- If the player presses the down key, that is, if Picobricks’ prediction is greater than the player’s number, divide the guess interval by 2 again and subtract it from the current Picobricks’ prediction.
- If the player presses “ok” button, end the game and congratulate Picobricks.
- Repeat the 2nd, 3rd and 4th steps until the “ok” button is pressed.
- Return the 1st step.
Project Pin Diagram
Project Images
MicroBlocks Codes of The Project
2
Comments
-
PicoBricks found the number I kept on his fourth try😄
Creative, but can improve🧐
1
Howdy, Stranger!
Categories
- 117 All Categories
- 3 Community
- 3 Hello Maker!
- 102 PicoBricks - Make, Run, Split, Merge
- 1 PicoBricks IDE
- 1 Arduino IDE
- 31 Hardware Support
- 15 PicoBricks Backers Hub
- 49 MicroBlocks Support
- 3 Shipping Support
- 2 MicroPython
- REX - 8 in 1
- Mechanical Parts and Parkour
- REX Main
- Arduino-IDE
- REX - Shipping
- 12 Products & Technology
- 2 Raspberry Pi
- Arduino
- 10 Other