Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Wall/Wall.cpp
- Revision:
- 8:97576c8761a8
- Parent:
- 7:193c0fd7afdd
- Child:
- 14:13e82f720bea
--- a/Wall/Wall.cpp Thu May 09 01:27:58 2019 +0000
+++ b/Wall/Wall.cpp Thu May 09 02:17:47 2019 +0000
@@ -13,9 +13,9 @@
void Wall::init(int x,int gap,int width,int speed) {
_x = x; // x value on screen is fixed
- int uncertainty = rand() % 39;
+ _gap = gap;
+ int uncertainty = rand() % (47 - _gap);
_height = uncertainty; // y depends on height of screen and height of paddle
- _gap = gap;
_width = width;
_speed = speed;
}
@@ -36,7 +36,7 @@
void Wall::reset() {
_x = 149;
- int uncertainty = rand() % 39;
+ int uncertainty = rand() % (47 - _gap);
_height = uncertainty;
}