その答え(の一つ)が、 「button() の戻り値と00010000 (=#A) の and を求める」 というものです。 上の 00110101 と 00010000(=#A) の and は 00110101 (=button()) 00010000 (=#A) 00010000 (=button() and #A) button() and #a が 0 でなければ、Aボタンが押されていたことがわかります。 Bと←と↑が押されていた場合、button() は 00100101 を返します。 00100101 (button()) 00010000 (#A) 00000000 (button() and #A) button() and #A が 0 なら、Aボタンは押されていません。