adc for random number generation not yet working
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "shapes.h"
|
||||
#include "myrand.h"
|
||||
#include "canvas.h"
|
||||
#include "../rgb-driver/colors.h"
|
||||
|
||||
@ -354,16 +356,14 @@ void shapesInit() {
|
||||
}
|
||||
|
||||
void stoneCreate() {
|
||||
#if 0
|
||||
static uint8_t cnt = 0;
|
||||
// static uint8_t cnt = 0;
|
||||
uint8_t r = myRandGet();
|
||||
uint8_t cnt = r % e_ShapeInvalid;
|
||||
stone.shape = ((shape_t[]){ e_I, e_O, e_T, e_Z, e_S, e_L, e_J })[cnt];
|
||||
cnt++;
|
||||
if (cnt > 3) {
|
||||
cnt = 0;
|
||||
}
|
||||
#else
|
||||
stone.shape = e_J;
|
||||
#endif
|
||||
// cnt++;
|
||||
// if (cnt >= e_ShapeInvalid) {
|
||||
// cnt = 0;
|
||||
// }
|
||||
stone.orientation = e_0;
|
||||
stone.x = 5;
|
||||
stone.y = 0;
|
||||
|
Reference in New Issue
Block a user