CS153/hw5/hw4programs/xor_bool.oat
jmug 9224001a22 Update hw5 to a newer version.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-24 21:10:31 -08:00

17 lines
No EOL
245 B
Text

bool xor(bool x, bool y) {
return (x & !y) | (!x & y);
}
int to_int(bool b) {
if (b) {
return 1;
} else {
return 0;
}
}
int program(int argc, string[] argv) {
var t = true;
var f = false;
return to_int(xor(t, t));
}