Please be sure your program compiles and run in UNIXS since I will compile and test them there The base file provided in courseweb has two issues that prevent it from compiling or running in UNIXS: - (compilation problem) Line 254: Function exit is called without parameters. Please change
exit(); to exit(-1); Note: -1 is arbitrary here, you can put a different integer (obviously not zero because it will not indicate an error) if you prefer. - (runtime problem) Line 272:
double mmm = 2147483647; /* largest int - MACHINE DEPENDENT!!!!!!!! */ When you run the program, you will get a warning: "... random number generation on your machine is different from what this emulator expects ..." In this case you should assign to the variable mmm the value of RAND_MAX which seems to be different in UNIXS (at least in unixs1.cis.pitt.edu) to what the simulator is expecting. To find out the value of RAND_MAX in UNIXS you can use the following program: testrnd.c When I run it at UNIXS, the value of RAND_MAX printed is 32767, so if you get the same answer, please assign that value (or any other value that is printed by the program above) to the variable mmm (see above). This may affect the generation of random numbers but that is a limitation of UNIXS right now and I am trying to put some consistency into the work.
Please be sure that your submission contains a Makefile (as noted by Dr. Brustoloni) that allows me to compile your program. You can find a sample makefile here: Makefile Also, if there are special instructions that you need me to follow for you program to compile and run correctly, please let me know using a README.txt It is recommended that for testing your program quickly without having to ask the user of the values of the simulator, you can use an input file like this: parameter And run your program in this way: $ ./myprogram <parameter I am going to test your program in that way too, but since this was not announced from the beginning, I will be flexible. |