Play Journal Entries

Petit computer 3

キムKENkenken0309

10/21/2017 4:12 AM ·Spoilers

ボタンが「特定」の押されている時は、変数が1でボタンが「特定」の押されてない時は、変数が0になるようにするためには、どうすればよいでしょうか?

Advertisement

Comment

This post has no comments.

  • ループの中に、 n(変数)=button()==(特定のボタン定数) と書くか、 if button()==(特定のボタン定数) then n(変数)=1 else n(変数)=0 と書けばよろしいかと

    Yeahs2
    Played
  • たばすこさんや、こういちさんのやり方でも いいですが、私が簡潔に書いた画像の プログラムでも、動作します。

    Yeahs2
    Played
  • ボタン判定を複数箇所で使用するならば自作関数を作っておくと良いでしょう。 DEF BTF(B) RETURN (BUTTON() AND B)==B END これでAボタンを押している時はBTF(#A)は1になり、押してない時はBTF(#A)は0になります。 また、複数ボタンに対応しているためBTF(#A+#B)はAボタンとBボタンの両方を押している時は1になります。

    Yeahs1
    Played

Add a Comment

You must sign in to post a comment.

Sign in using a Nintendo Network ID to connect to users around the world by writing posts and comments and by giving Yeahs to other people's posts. You can create a Nintendo Network ID using your Wii U console or your system in the Nintendo 3DS family.

Use of Miiverse Details about Miiverse

Report Violation to Miiverse Administrators

You are about to report a post with content which violates the Miiverse Code of Conduct. This report will be sent to Nintendo's Miiverse administrators and not to the creator of the post.

Violation Type:

Post ID: 3DB-NBL7-DPU-2NLA-LWK-W7G2

Report Violation to Miiverse Administrators

You cannot report posts made automatically by a software title.

Edit Post

Select an action: