Skip to content

Instantly share code, notes, and snippets.

@akamah
Created October 29, 2016 08:38
Show Gist options
  • Save akamah/eda787b19e38fa54a8f86bb15055755b to your computer and use it in GitHub Desktop.
Save akamah/eda787b19e38fa54a8f86bb15055755b to your computer and use it in GitHub Desktop.
wrote_R0:
if (A == 0) {
T0 = !T0; // 自動ターンアウトレールなのでトグルする
if (T0 == 1) { // 1回目
R0 = 0; goto wrote_R0;
} else { // 2回目
R1 = 0; goto wrote_R1;
}
} else {
T1 = !T1;
if (T1 == 1) { // 1回目
R0 = 1; goto wrote_R0;
} else { // 2回目
R1 = 1; goto wrote_R1;
}
}
wrote_R1:
if (B == 0) {
if (R0 == 0) { // A == 0, B == 0
X = 0; goto wrote_X;
} else { // A == 1, B == 0
X = 1; goto wrote_X;
}
} else {
if (R1 == 0) { // A == 0, B == 1
X = 1; goto wrote_X;
} else { // A == 1, B == 1
X = 0; goto wrote_X;
}
}
wrote_X: ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment