| Rules Applied | JavaKeywordRule | app0.txt | PPspaceRule | PPifndefRule | PPRule | PPdefineRule.DefineReplacementRule | MissingFunctionTypeRule | snippets0b.txt | OneDeclarationPerLineRule | ArrayDeclaration0Rule | StaticFunctionsRule | RandomRule | ArrayDeclarationRule | StringRule | DeclarationAssignmentRule | LossOfPrecisionRule | ForceToBooleanRule | snippets2.txt | snippets3.txt | UninitializedVariableRule | InsertClassRule | ImportRule | (Final Version) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| JavaKeywordRule app0.txt PPspaceRule PPifndefRule PPRule PPdefineRule.DefineReplacementRule MissingFunctionTypeRule snippets0b.txt OneDeclarationPerLineRule ArrayDeclaration0Rule StaticFunctionsRule RandomRule ArrayDeclarationRule StringRule DeclarationAssignmentRule LossOfPrecisionRule ForceToBooleanRule snippets2.txt snippets3.txt UninitializedVariableRule InsertClassRule ImportRule final | #ifndef lint static char sccsid[] = "@(#)roll.c 5.6 (Berkeley) 9/29/92"; #endif #include | #ifndef lint static char sccsid[] = "@(#)roll.c 5.6 (Berkeley) 9/29/92"; #endif #include | #ifndef lint static char sccsid[] = "@(#)roll.c 5.6 (Berkeley) 9/29/92"; #endif #include | #if !defined(lint) static char sccsid[] = "@(#)roll.c 5.6 (Berkeley) 9/29/92"; #endif #include | static char sccsid[] = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
roll(register int numberOfDice, register int nsides) {
regint total;
regdouble numberOfSides;
int temp,
temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| static char sccsid[] = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
roll(register int numberOfDice, register int nsides) {
register int total;
register double numberOfSides;
int temp,
temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| static char sccsid[] = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
int roll(register int numberOfDice, register int nsides) {
register int total;
register double numberOfSides;
int temp,
temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| static char sccsid[] = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp,
temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| static char sccsid[] = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| static char[] sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| static char[] sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| private final static Random random = new Random();
static char[] sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| private final static Random random = new Random();
static char[] sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| private final static Random random = new Random();
static String sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| private final static Random random = new Random();
static String sccsid;
sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = temp * (numberOfSides / RAND_MAX) + 1;
total += temp2;
}
return total;
}
| private final static Random random = new Random();
static String sccsid;
sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice--) {
temp = rand();
temp2 = (int) (temp * (numberOfSides / RAND_MAX) + 1);
total += temp2;
}
return total;
}
| private final static Random random = new Random();
static String sccsid;
sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice-- != 0) {
temp = rand();
temp2 = (int) (temp * (numberOfSides / RAND_MAX) + 1);
total += temp2;
}
return total;
}
| private final static Random random = new Random();
static String sccsid;
sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice-- != 0) {
temp = random.nextInt();
temp2 = (int) (temp * (numberOfSides / Integer.MAX_VALUE) + 1);
total += temp2;
}
return total;
}
| private final static Random random = new Random();
static String sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total;
double numberOfSides;
int temp;
int temp2;
numberOfSides = nsides;
total = 0;
while (numberOfDice-- != 0) {
temp = random.nextInt();
temp2 = (int) (temp * (numberOfSides / Integer.MAX_VALUE) + 1);
total += temp2;
}
return total;
}
| private final static Random random = new Random();
static String sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total = 0;
double numberOfSides = 0.0d;
int temp = 0;
int temp2 = 0;
numberOfSides = nsides;
total = 0;
while (numberOfDice-- != 0) {
temp = random.nextInt();
temp2 = (int) (temp * (numberOfSides / Integer.MAX_VALUE) + 1);
total += temp2;
}
return total;
}
| public class Roll {
private final static Random random = new Random();
static String sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total = 0;
double numberOfSides = 0.0d;
int temp = 0;
int temp2 = 0;
numberOfSides = nsides;
total = 0;
while (numberOfDice-- != 0) {
temp = random.nextInt();
temp2 = (int) (temp * (numberOfSides / Integer.MAX_VALUE) + 1);
total += temp2;
}
return total;
}
}
| import java.util.Random;
public class Roll {
private final static Random random = new Random();
static String sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total = 0;
double numberOfSides = 0.0d;
int temp = 0;
int temp2 = 0;
numberOfSides = nsides;
total = 0;
while (numberOfDice-- != 0) {
temp = random.nextInt();
temp2 = (int) (temp * (numberOfSides / Integer.MAX_VALUE) + 1);
total += temp2;
}
return total;
}
}
| import java.util.Random;
public class Roll {
private final static Random random = new Random();
static String sccsid = "@(#)roll.c 5.6 (Berkeley) 9/29/92";
static int roll(int numberOfDice, int nsides) {
int total = 0;
double numberOfSides = 0.0d;
int temp = 0;
int temp2 = 0;
numberOfSides = nsides;
total = 0;
while (numberOfDice-- != 0) {
temp = random.nextInt();
temp2 = (int) (temp * (numberOfSides / Integer.MAX_VALUE) + 1);
total += temp2;
}
return total;
}
}
|