void genFilterFile() { ulen len=Len-filter_len; file_len=0; for(char ch : getFilter() ) { switch( ch ) { case '?' : { file[file_len++]=genChar(file_sym); } break; case '*' : { ulen count=random.select(0,len); len-=count; for(; count ;count--) file[file_len++]=genChar(file_sym); } break; default: { file[file_len++]=ch; } } } }
void fill(PtrLen<char> buf,PtrLen<const char> sym) { for(char &ch : buf ) ch=genChar(sym); }
Boule creerBoule() { cpFloat radius = rand() % 16 + 25;// radius entre 25 et 40 cpFloat mass = rand() % 3 + 1;// masse entre 1 et 3; cpFloat moment = cpMomentForCircle(mass, 0, radius, cpvzero); cpBody *ballBody = cpSpaceAddBody(espace, cpBodyNew(mass, moment)); cpBodySetPos(ballBody, cpv(0, 310)); cpShape *ballShape = cpSpaceAddShape(espace, cpCircleShapeNew(ballBody, radius, cpvzero)); cpShapeSetFriction(ballShape, -0.2); Boule laBoule={radius, cpBodyGetPos(ballBody).x,0,rand() % 136 + 150,rand() % 136 + 100,rand() % 136 + 50,255,ballShape,ballBody, genChar(),FALSE}; return laBoule; }