From Test-Scratch-Wiki
() 或 () | |
<>或<> | |
类别 | 运算类积木 |
形狀 | 菱形积木 |
The () or () 积木 is an 运算类积木 and a 菱形积木. The block joins two boolean blocks so any one of them can be true to return true — if at least one of them is true, the block returns true; if neither of them are true, it returns false.
This block can be stacked inside itself — this can be used to fit more booleans inside.
用法示例
This script asks the user what their favorite color, and will give one response if it is "blue" or "red", and another response if it is anything else.
當 @greenflag 被點擊 詢問 [What is your favorite color?] 並等待 如果 <<(詢問的答案) = [blue]> 或 <(詢問的答案) = [red]>> 那麼 說出 [I also like that color!] 否則 說出 [That's a nice color!] end
Workaround
- Main article: List of Block Workarounds
This block can be replicated with the following code:
<<<<condition1> 不成立> 且 <<condition2> 不成立>> 不成立>
This stack also works (with the 变量 T/F being the result):
變數 [T/F v] 設為 [false] 如果 <condition1> 那麼 變數 [T/F v] 設為 [true] end 如果 <condition2> 那麼 變數 [T/F v] 設為 [true] end
参见
() + ()
• () - () • () * () • () / () • 随机取数 () 到 () • () < () • () = () • () > () • () 且 () • () 或 () • () 不成立 • 字串组合 () 和 () • 字串中第 () 字 () • 字串长度 () • ) 除 () 的馀数 • 四舍五入数值 () • () 数值 ()更多积木… |