summaryrefslogtreecommitdiff
path: root/XorInterpreter.java
diff options
context:
space:
mode:
authorJan Huwald <jh@sotun.de>2013-04-22 13:42:11 (GMT)
committerJan Huwald <jh@sotun.de>2013-04-22 13:42:11 (GMT)
commitf788d4c48f2d94fcfd73a093ab33d734ab427cb8 (patch)
treebe4c00d562ec75f746736b5e0788f2847f7b8baa /XorInterpreter.java
Initial commit
Diffstat (limited to 'XorInterpreter.java')
-rw-r--r--XorInterpreter.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/XorInterpreter.java b/XorInterpreter.java
new file mode 100644
index 0000000..1b0ee0f
--- /dev/null
+++ b/XorInterpreter.java
@@ -0,0 +1,9 @@
+class XorInterpreter extends AbstractInterpreter {
+ public String eval(String code, String param) {
+ BitString
+ x1 = new BitString(code),
+ x2 = new BitString(param);
+ x1.xor(x2);
+ return x1.toString(code.length());
+ }
+}
contact: Jan Huwald // Impressum