Commit fc940476 authored by uievq's avatar uievq Committed by uxrog
Browse files

Added more test, testing if the program is executed in the right order

parent d02697be
class correctStepping {
public static void main(String[] args) {
System.out.write(48);
Steps step = new Steps();
if (true && (false || 48 < 356)) {
System.out.write(49);
} else {
System.out.write(48);
}
System.out.write(step.step1());
if (step.step2() < 54 || step.noStep() == 4) {
System.out.write(step.step2());
} else {
System.out.write(step.noStep());
}
}
}
class Steps {
public int step1() {
System.out.write(50);
return 51;
return 52;
}
public int step2() {
int part1 = 5;
int part2 = 2;
return part2 + 10 * part1;
}
public int noStep() {
System.out.write(48);
return 5 * 10 / 2 + 35;
}
}
\ No newline at end of file
class deadCode {
public static void main(String[] args) {
Death death = new Death();
death.deadAfterReturn();
death.lazyEvalDeath();
}
}
class Death {
public int[] array;
public void deadAfterReturn() {
int a = 3;
int b = 5;
boolean c = false;
b = a + b;
a = b * a;
a = a * a + b;
c = !c;
return;
System.out.write(48);
array[10] = 5;
b = a * b * 0;
a = a / b;
}
public boolean lazyEvalDeath() {
boolean boo = true;
boolean test = false;
int a = 46;
int b = 2;
int c = a / b;
int d = 0;
return (test || a == b || boo && test != boo || lazyEvalDeath()) && (test || boo || a / d < 5);
}
public boolean infinite;
public boolean neverUsedDeath(boolean infinite) {
System.out.write(48);
boolean infi = false;
boolean nite = true;
if (infinite) {
infinite = !this.infinite;
}
this.infinite = infinite;
infinite = infi || nite;
return neverUsedDeath(infinite);
}
}
\ No newline at end of file
class Factorial {
public static void main(String[] args) throws Exception {
Calc c = new Calc();
c.reset();
while (true) {
c.getInput();
c = new Calc();
c.reset();
}
}
}
class Calc {
public int input;
public int number;
public void readNext() throws Exception {
input = System.in.read();
}
public void reset() {
number = 0;
}
public void getInput() throws Exception {
readNext();
while (isDigit(input)) {
number = 10 * number;
number = number + (input - 48);
readNext();
}
if (input == 33) {
System.out.println(fact(number));
} else if (input != 10) {
System.out.write(33);
System.out.write(10);
}
}
public int fact(int factNum) {
if (factNum > 0) {
return fact(factNum - 1) * factNum;
}
return 1;
}
public boolean isDigit(int digit) {
return 48 <= digit && digit < 58;
}
}
\ No newline at end of file
class infiniteLoop {
public static void main(String[] args) {
int counter = 48;
while (true && !false) {
System.out.write(counter);
counter = counter + 1;
if (counter > 57)
return;
}
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment