論理式について

Kazunori Kamiya
Aug 23, 2017 · 2 min read

・Exercise27:論理式を覚えましょう

ここでは、論理式というものについて学習していきます。

このエクササイズは単純に覚えるだけであまり面白くないかもしれませんが、後のエクササイズにおいても重要なのでしっかり覚えてください。

The Truth Terms

Rubyでは、trueかfalseかを決定するために、以下に紹介するような文字やフレーズがあります。

  • && (and)
  • || (or)
  • ! (not)
  • != (not equal)
  • == (equal)
  • >= (greater-than-equal)
  • <= (less-than-equal)
  • true
  • false

The Truth Tables

ここでは上で紹介したような文字を使って、覚えておくべき論理式の一覧を作成しました。

これらのテーブルに書いてあることは、カードに書いたりしてしっかり記憶してください。

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade