- Learning C# 7 By Developing Games with Unity 2017(Third Edition)
- Micael DaGra?a Greg Lukosek
- 92字
- 2021-07-02 19:59:39
Using the NOT operator to change the condition
Here's a little curveball to wrap your mind around: the NOT logical operator. It's written in code using an exclamation mark. This makes a true condition false, or a false condition true. Let's add a NOT operator to our statement. Line 10 should now look like this:
if ( ! willItBeRainingToday ) {
Press Play in the editor. You will notice that the decision?1;making is now working the opposite way. Line 11 will be executed only if the willItBeRaining variable is false.
推薦閱讀
- Visual C++程序設(shè)計學(xué)習(xí)筆記
- Building a Home Security System with Raspberry Pi
- 精通網(wǎng)絡(luò)視頻核心開發(fā)技術(shù)
- .NET 3.5編程
- Geospatial Development By Example with Python
- OpenCV with Python By Example
- .NET Standard 2.0 Cookbook
- Zabbix Performance Tuning
- 區(qū)塊鏈項目開發(fā)指南
- JavaScript機(jī)器人編程指南
- 微課學(xué)人工智能Python編程
- Julia數(shù)據(jù)科學(xué)應(yīng)用
- Oracle Data Guard 11gR2 Administration Beginner's Guide
- 貫通Tomcat開發(fā)
- JavaScript高級程序設(shè)計(第4版)