Project 2 for MA132
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
393 B

#include <string.h>
#include "bugage.h"
#include "rand.h"
int *BugArray;
int eggCount;
void BugArrayTick()
{
// BugArray size:ADULTS
// 0 ADUlTS-1
BugArray[ADULTS - 2] += BugArray[ADULTS - 1];
memmove(BugArray, BugArray + 1, ADULTS - 1);
for(int e = 0; e < eggCount; e++)
{
int r = (int) umremap(prngdn(), 28, 5);
if (r > 20 && r <= ADULTS)
{
BugArray[r]++;
}
}
}