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.
Diff: Map/Map.cpp
- Revision:
- 14:7419c680656f
- Parent:
- 13:12276eed13ac
- Child:
- 15:90b6821bcf64
diff -r 12276eed13ac -r 7419c680656f Map/Map.cpp
--- a/Map/Map.cpp Sun Apr 26 17:08:10 2020 +0000
+++ b/Map/Map.cpp Sun Apr 26 20:31:53 2020 +0000
@@ -18,16 +18,16 @@
position_y_map_ = MAP_TERRAIN_Y_POSITION;
// Initialises random arrays to make random map
- get_random_arrays(pad);
+ fill_random_arrays(pad);
}
-void Map::get_random_arrays(Gamepad &pad){
+void Map::fill_random_arrays(Gamepad &pad){
srand(pad.read_adc()*64000);
for(int i = 0; i < 11; i++){
rand_heights_[i]= rand() % 8 + 5;
rand_lengths_[i]= rand() % 16 + 15;
}
- //printf loop to check correct random numbers are generated
+ //printf loop to check random numbers generated are actaully random
//for (int i = 0; i < 11; i++){
//usb.printf("map height random array = %d\n", rand_heights_[i]);
//}