Updated hw6 to a newer version
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
9224001a22
commit
0c04936ccf
356 changed files with 8408 additions and 4725 deletions
17
hw6/hw4programs/xor_bool.oat
Normal file
17
hw6/hw4programs/xor_bool.oat
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue