Skip to content

Commit ee9369b

Browse files
author
Louis Jenkins
committed
Finished overall refactoring for now (although Types.hs needs a nice
touch-up), and I may refactor the ClassFile module later, but for now I am content. I added a decent test for arithmetic (although I'm not bothering with any non-integer types yet for the sake of presentation). I need to revise Main.hs to have a decent interface so it can be run appropriately, but that can come later.
1 parent 4f5a2fe commit ee9369b

17 files changed

+291
-315
lines changed

AdditionTest.class

-333 Bytes
Binary file not shown.

ClassFile/Class_File.hs

Lines changed: 0 additions & 26 deletions
This file was deleted.

ClassFiles/bytecode.txt

Lines changed: 0 additions & 187 deletions
This file was deleted.

ClassFiles/test.class

-1.02 KB
Binary file not shown.

Examples/ArithmeticTest.class

1 KB
Binary file not shown.

Examples/ArithmeticTest.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* Name of the class has to be "Main" only if the class is public. */
2+
class ArithmeticTest
3+
{
4+
public static void main (String[] args) {
5+
// Simple math example, you can alter this as you wish.
6+
int x = 100;
7+
System.out.println("X = " + x);
8+
int y = 1000;
9+
System.out.println("Y = " + y);
10+
int z = 50;
11+
System.out.println("Z = " + z);
12+
13+
int addResult = x + y + z;
14+
int subResult = x - y - z;
15+
int multResult = x * y * z;
16+
int divResult = x / y / z;
17+
int mixedResult = x + y / z;
18+
System.out.println("X + Y + Z = " + addResult);
19+
System.out.println("X - Y = Z = " + subResult);
20+
System.out.println("X * Y * Z = " + multResult);
21+
System.out.println("X / Y / Z = " + divResult);
22+
System.out.println("X + Y / Z = " + mixedResult);
23+
}
24+
}

0 commit comments

Comments
 (0)