Transformation Rules Applied to File:Roll.java

Showing full text of file after each rule

Rules AppliedJavaKeywordRule 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 
# define	reg	register
# if defined(pdp11)
# define	MAXRAND	32767L
roll(int ndie, int nsides) {
    reglong tot;
    regunsigned n,
     r;
    tot = 0;
    n = ndie;
    while (n--) tot += rand();
    return (int) ((tot * (long) nsides) / ((long) MAXRAND + 1)) + ndie;
}
# else
roll(register int ndie, register int nsides) {
    regint tot;
    regdouble num_sides;
    int temp,
     temp2;
    num_sides = nsides;
    tot = 0;
    while (ndie--) {
        temp = rand();
        temp2 = temp * (num_sides / RAND_MAX) + 1;
        tot += temp2;
    }
    return tot;
}
# endif
#ifndef lint
static char sccsid[] = "@(#)roll.c	5.6 (Berkeley) 9/29/92";
#endif
#include 
# define	reg	register
# if defined(pdp11)
# define	MAXRAND	32767L
roll(int numberOfDice, int nsides) {
    reglong total;
    regunsigned n,
     r;
    total = 0;
    n = numberOfDice;
    while (n--) total += rand();
    return (int) ((total * (long) nsides) / ((long) MAXRAND + 1)) + numberOfDice;
}
# else
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;
}
# endif
#ifndef lint
static char sccsid[] = "@(#)roll.c	5.6 (Berkeley) 9/29/92";
#endif
#include 
#define	reg	register
#if defined(pdp11)
#define	MAXRAND	32767L
roll(int numberOfDice, int nsides) {
    reglong total;
    regunsigned n,
     r;
    total = 0;
    n = numberOfDice;
    while (n--) total += rand();
    return (int) ((total * (long) nsides) / ((long) MAXRAND + 1)) + numberOfDice;
}
#else
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;
}
#endif
#if !defined(lint)
static char sccsid[] = "@(#)roll.c	5.6 (Berkeley) 9/29/92";
#endif
#include 
#define	reg	register
#if defined(pdp11)
#define	MAXRAND	32767L
roll(int numberOfDice, int nsides) {
    reglong total;
    regunsigned n,
     r;
    total = 0;
    n = numberOfDice;
    while (n--) total += rand();
    return (int) ((total * (long) nsides) / ((long) MAXRAND + 1)) + numberOfDice;
}
#else
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;
}
#endif
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;
    }

}