ch 5 boolean logical in alice

8
An Introduction to Programming with Alice Boolean Logic Boolean Logic in Alice in Alice

Upload: chaffey-college

Post on 13-Dec-2014

3.866 views

Category:

Documents


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Ch 5  boolean logical in alice

An Introduction to Programming with Alice

Boolean Logic Boolean Logic in Alice in Alice

Page 2: Ch 5  boolean logical in alice

Boolean FunctionsBoolean Functions

Functions in Alice that return Functions in Alice that return true or false values are true or false values are called Boolean functions.called Boolean functions.

Alice has many such built-in Alice has many such built-in functions, such as these two functions, such as these two groups of basic Boolean groups of basic Boolean functions and comparison functions and comparison functions.functions.

Page 3: Ch 5  boolean logical in alice

They can be found on the world’s functions tab

Page 4: Ch 5  boolean logical in alice

They are used inside branching and looping instructions

Page 5: Ch 5  boolean logical in alice

Boolean FunctionsBoolean Functions

The Boolean comparison The Boolean comparison functions can be used to functions can be used to create simple true or false create simple true or false conditions.conditions.

Page 6: Ch 5  boolean logical in alice

Boolean FunctionsBoolean Functions

The Boolean logic functions The Boolean logic functions can be used to create can be used to create compound conditions.compound conditions.

Page 7: Ch 5  boolean logical in alice

Boolean FunctionsBoolean Functions

Alice has many other Alice has many other world-level and object-world-level and object-level methods that return level methods that return true or false values, such true or false values, such as the Boolean proximity as the Boolean proximity functions shown here on functions shown here on aliceLiddel’s functions tab aliceLiddel’s functions tab in the details area.in the details area.

Page 8: Ch 5  boolean logical in alice

Boolean FunctionsBoolean Functions

They can be used anywhere that a Boolean They can be used anywhere that a Boolean value is needed, such as in this If/Else value is needed, such as in this If/Else command.command.