mirror of
https://github.com/caperren/school_archives.git
synced 2025-11-09 21:51:15 +00:00
Added Software Engineering II code
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "rngs.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc < 3) {
|
||||
printf ("Not enough inputs: seed target\n");
|
||||
}
|
||||
|
||||
SelectStream(1);
|
||||
PutSeed((long)atoi(argv[1]));
|
||||
|
||||
int done = 0;
|
||||
int c = 1000000000;
|
||||
|
||||
while (!done) {
|
||||
c = floor(Random() * 1000000000);
|
||||
// if (c % 100000 == 0) {
|
||||
// printf ("c = %d\n", c);
|
||||
// }
|
||||
if (c == atoi(argv[2])) {
|
||||
printf ("Found the bug!\n");
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user