--- /dev/null
+#!/bin/bash
+
+function classic {
+../bin/QAnsel << HERE
+qreg q[2];
+creg c[2];
+
+h q[0];
+h q[1];
+measure q[0] -> c[0];
+measure q[1] -> c[1];
+x q[0];
+if(c[1]==1) x q[1];
+print c;
+
+//Player X rules
+if(c[0]==1) x q[0];
+
+//Player Y rules
+x q[1];
+
+//Results
+measure q[0] -> c[0];
+measure q[1] -> c[1];
+print c;
+
+HERE
+}
+
+function quantum {
+../bin/QAnsel << HERE
+qreg q[2];
+creg c[2];
+
+h q[0];
+h q[1];
+measure q[0] -> c[0];
+measure q[1] -> c[1];
+print c;
+reset q[0];
+reset q[1];
+
+h q[0];
+cx q[0], q[1];
+
+//Player X rules
+if(c[0]==1) ry(pi/2) q[0];
+
+//Player Y rules
+if(c[1]==0) ry(pi/4) q[1];
+if(c[1]==1) ry(-pi/4) q[1];
+
+measure q[0] -> c[0];
+measure q[1] -> c[1];
+print c;
+
+HERE
+}
+
+function test
+{
+ if [ "$1" == "00 00" ]
+ then
+ echo 1
+ elif [ "$1" == "00 11" ]
+ then
+ echo 1
+ elif [ "$1" == "01 00" ]
+ then
+ echo 1
+ elif [ "$1" == "01 11" ]
+ then
+ echo 1
+ elif [ "$1" == "10 00" ]
+ then
+ echo 1
+ elif [ "$1" == "10 11" ]
+ then
+ echo 1
+ elif [ "$1" == "11 10" ]
+ then
+ echo 1
+ elif [ "$1" == "11 01" ]
+ then
+ echo 1
+ else
+ echo 0
+ fi
+}
+
+trials=1000
+cwins=0
+qwins=0
+for i in $(seq 1 $trials)
+do
+ clear
+ echo "$(( (100 * i) / trials ))%"
+
+ trial=$(classic | xargs)
+ results=$(test "$trial")
+ cwins=$((cwins+results))
+
+ trial=$(quantum | xargs)
+ results=$(test "$trial")
+ qwins=$((qwins+results))
+
+done
+clear
+
+echo "Classical Strategy: $cwins points"
+echo "Quantum Strategy: $qwins points"
+++ /dev/null
-#!/bin/bash
-
-function classic {
-../../bin/QAnsel << HERE
-qreg q[2];
-creg c[2];
-
-h q[0];
-h q[1];
-measure q[0] -> c[0];
-measure q[1] -> c[1];
-x q[0];
-if(c[1]==1) x q[1];
-print c;
-
-//Player X rules
-if(c[0]==1) x q[0];
-
-//Player Y rules
-x q[1];
-
-//Results
-measure q[0] -> c[0];
-measure q[1] -> c[1];
-print c;
-
-HERE
-}
-
-function quantum {
-../../bin/QAnsel << HERE
-qreg q[2];
-creg c[2];
-
-h q[0];
-h q[1];
-measure q[0] -> c[0];
-measure q[1] -> c[1];
-print c;
-reset q[0];
-reset q[1];
-
-h q[0];
-cx q[0], q[1];
-
-if(c[0]==1) ry(pi/2) q[0];
-if(c[0]==1) rz(pi) q[0];
-
-if(c[1]==0) ry(pi/4) q[1];
-if(c[1]==0) rz(pi) q[1];
-
-if(c[1]==1) ry(-pi/4) q[1];
-if(c[1]==1) rz(pi) q[1];
-
-measure q[0] -> c[0];
-measure q[1] -> c[1];
-print c;
-
-HERE
-}
-
-function test
-{
- if [ "$1" == "00 00" ]
- then
- echo 1
- elif [ "$1" == "00 11" ]
- then
- echo 1
- elif [ "$1" == "01 00" ]
- then
- echo 1
- elif [ "$1" == "01 11" ]
- then
- echo 1
- elif [ "$1" == "10 00" ]
- then
- echo 1
- elif [ "$1" == "10 11" ]
- then
- echo 1
- elif [ "$1" == "11 10" ]
- then
- echo 1
- elif [ "$1" == "11 01" ]
- then
- echo 1
- else
- echo 0
- fi
-}
-
-trials=1000
-cwins=0
-qwins=0
-for i in $(seq 1 $trials)
-do
- clear
- echo "$(( (100 * i) / trials ))%"
-
- trial=$(classic | xargs)
- results=$(test "$trial")
- cwins=$((cwins+results))
-
- trial=$(quantum | xargs)
- results=$(test "$trial")
- qwins=$((qwins+results))
-
-done
-clear
-
-echo "Classical Strategy: $cwins points"
-echo "Quantum Strategy: $qwins points"