If / Ifelse / Related Flashcards
1
Q
ask
A
- Asks an agent to do something
- Uses a specified group
2
Q
if
A
- If a Boolean reports true, the commands are run
- Command will return false
- not having #t or #f -> runtime error
3
Q
ifelse
A
- Uses multiple booleans
- not having #t or #f -> runtime error
4
Q
let
A
- let variable value
- creates a new variable and gives it the given value
5
Q
pd
A
- pen-down
- traces the movements of turtles
6
Q
set
A
- set variables value
- sets variable to the given value (which should already exist)
7
Q
repeat
A
- repeats a block of code a specified number of times
8
Q
random
A
- random #
- if # is positive, it reports a random integer >= 0 but < #
- if # negative, it reports a random integer <= 0 but > #
- if # = 0 -> 0