Skip to content

Instantly share code, notes, and snippets.

@akamah
Created September 7, 2017 01:54
Show Gist options
  • Save akamah/05fd940bf77cff980da8c505cc2802c5 to your computer and use it in GitHub Desktop.
Save akamah/05fd940bf77cff980da8c505cc2802c5 to your computer and use it in GitHub Desktop.
// 下層の電車
// 1周目
if (A == 0) {
R0 = 0;
} else if (A == 1) {
R1 = 0;
}
// 2周目
if (A == 0) {
R1 = 1;
} else if (A == 1) {
R0 = 1;
}
//本来ならここでバリア同期をする////
// 3周目(途中で上に登る)
if (A == 0) {
C = 0;
} else if (A == 1) {
if (R2 == 0) {
C = 0;
} else if (R2 == 1) {
C = 1;
}
}
// 上層の電車
// 1周目
if (B == 0) {
R2 = 0;
} else if (B == 1) {
R2 = 1;
}
// 2周目
if (B == 0) {
R2 = 0;
} else if (B == 1) {
// NOP
}
///////////////////////////////
// 3周目(途中で下に降りる)
if (B == 0) {
if (R0 == 0) {
S = 0;
} else if (R0 == 1) {
S = 1;
}
} else if (B == 1) {
if (R1 == 0) {
S = 0;
} else if (R1 == 1) {
S = 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment