- 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.
推薦閱讀
- 計(jì)算機(jī)網(wǎng)絡(luò)
- ExtGWT Rich Internet Application Cookbook
- 嵌入式軟件系統(tǒng)測試:基于形式化方法的自動化測試解決方案
- Python快樂編程:人工智能深度學(xué)習(xí)基礎(chǔ)
- Java異步編程實(shí)戰(zhàn)
- 深度學(xué)習(xí)經(jīng)典案例解析:基于MATLAB
- .NET 4.0面向?qū)ο缶幊搪劊夯A(chǔ)篇
- Processing互動編程藝術(shù)
- Access 2016數(shù)據(jù)庫管
- Hands-On Functional Programming with TypeScript
- 西門子S7-200 SMART PLC編程從入門到實(shí)踐
- C專家編程
- Spring Boot 3:入門與應(yīng)用實(shí)戰(zhàn)
- Unreal Engine Game Development Cookbook
- Instant AppFog