Safe Haskell | None |
---|---|

Language | Haskell98 |

The standard set of functions and variables available to all programs.

You may use any of these functions and variables without defining them.

- data Number
- (+) :: Number -> Number -> Number
- (-) :: Number -> Number -> Number
- (*) :: Number -> Number -> Number
- (/) :: HasCallStack => Number -> Number -> Number
- (^) :: HasCallStack => Number -> Number -> Number
- (>) :: Number -> Number -> Truth
- (>=) :: Number -> Number -> Truth
- (<) :: Number -> Number -> Truth
- (<=) :: Number -> Number -> Truth
- max :: (Number, Number) -> Number
- min :: (Number, Number) -> Number
- negate :: Number -> Number
- abs :: Number -> Number
- absoluteValue :: Number -> Number
- signum :: Number -> Number
- truncation :: Number -> Number
- rounded :: Number -> Number
- ceiling :: Number -> Number
- floor :: Number -> Number
- quotient :: HasCallStack => (Number, Number) -> Number
- remainder :: HasCallStack => (Number, Number) -> Number
- pi :: Number
- exp :: Number -> Number
- sqrt :: HasCallStack => Number -> Number
- squareRoot :: HasCallStack => Number -> Number
- log :: HasCallStack => Number -> Number
- logBase :: HasCallStack => (Number, Number) -> Number
- sin :: Number -> Number
- tan :: Number -> Number
- cos :: Number -> Number
- asin :: HasCallStack => Number -> Number
- atan :: Number -> Number
- acos :: HasCallStack => Number -> Number
- properFraction :: Number -> (Number, Number)
- even :: Number -> Truth
- odd :: Number -> Truth
- gcd :: HasCallStack => (Number, Number) -> Number
- lcm :: HasCallStack => (Number, Number) -> Number
- sum :: [Number] -> Number
- product :: [Number] -> Number
- maximum :: [Number] -> Number
- minimum :: [Number] -> Number
- isInteger :: Number -> Truth
- fromInteger :: Integer -> Number
- fromRational :: Rational -> Number
- fromInt :: Int -> Number
- toInt :: HasCallStack => Number -> Int
- fromDouble :: HasCallStack => Double -> Number
- toDouble :: Number -> Double
- data Text
- fromString :: String -> Text
- toString :: Text -> String
- fromCWText :: Text -> Text
- toCWText :: Text -> Text
- (<>) :: Text -> Text -> Text
- numberOfCharacters :: Text -> Number
- numberOfWords :: Text -> Number
- numberOfLines :: Text -> Number
- lines :: Text -> [Text]
- unlines :: [Text] -> Text
- words :: Text -> [Text]
- unwords :: [Text] -> Text
- characters :: Text -> [Text]
- printed :: Number -> Text
- joined :: [Text] -> Text
- joinedWith :: ([Text], Text) -> Text
- lowercase :: Text -> Text
- uppercase :: Text -> Text
- startsWith :: (Text, Text) -> Truth
- endsWith :: (Text, Text) -> Truth
- substitution :: (Text, Text, Text) -> Text
- substitutions :: (Text, [(Text, Text)]) -> Text
- ifThenElse :: Truth -> a -> a -> a
- fail :: HasCallStack => String -> a
- (==) :: a -> a -> Truth
- (/=) :: a -> a -> Truth
- type Truth = Bool
- data Bool :: *
- (&&) :: Truth -> Truth -> Truth
- (||) :: Truth -> Truth -> Truth
- not :: Truth -> Truth
- otherwise :: Truth
- toOperator :: ((a, b) -> c) -> a -> b -> c
- fromOperator :: (a -> b -> c) -> (a, b) -> c
- firstOfPair :: (a, b) -> a
- secondOfPair :: (a, b) -> b
- error :: HasCallStack => Text -> a
- undefined :: HasCallStack => a
- (++) :: [a] -> [a] -> [a]
- empty :: [a] -> Truth
- contains :: ([a], a) -> Truth
- length :: [a] -> Number
- at :: HasCallStack => ([a], a, Number) -> [a]
- (#) :: HasCallStack => [a] -> Number -> a
- any :: [Truth] -> Truth
- all :: [Truth] -> Truth
- none :: [Truth] -> Truth
- repeated :: ([a], Number) -> [a]
- repeating :: [a] -> [a]
- first :: HasCallStack => ([a], Number) -> [a]
- last :: HasCallStack => ([a], Number) -> [a]
- rest :: HasCallStack => ([a], Number) -> [a]
- groups :: ([a], Number) -> [[a]]
- while :: ([a], a -> Truth) -> [a]
- until :: ([a], a -> Truth) -> [a]
- after :: ([a], a -> Truth) -> [a]
- concatenation :: [[a]] -> [a]
- subsequences :: [a] -> [[a]]
- permutations :: [a] -> [[a]]
- sorted :: [Number] -> [Number]
- reversed :: [a] -> [a]
- unique :: [a] -> [a]
- transposed :: [[a]] -> [[a]]
- randomsFrom :: StdGen -> [Number]
- randomNumbers :: Number -> [Number]
- shuffled :: ([a], Number) -> [a]
- data IO a :: * -> *
- data Number
- data Text
- data Color
- type Colour = Color
- pattern RGBA :: (Number, Number, Number, Number) -> Color
- pattern RGB :: (Number, Number, Number) -> Color
- pattern HSL :: (Number, Number, Number) -> Color
- black :: Color
- white :: Color
- red :: Color
- green :: Color
- blue :: Color
- cyan :: Color
- magenta :: Color
- yellow :: Color
- aquamarine :: Color
- orange :: Color
- azure :: Color
- violet :: Color
- chartreuse :: Color
- rose :: Color
- brown :: Color
- pink :: Color
- purple :: Color
- gray :: Color
- grey :: Color
- mixed :: [Color] -> Color
- lighter :: (Color, Number) -> Color
- light :: Color -> Color
- darker :: (Color, Number) -> Color
- dark :: Color -> Color
- brighter :: (Color, Number) -> Color
- bright :: Color -> Color
- duller :: (Color, Number) -> Color
- dull :: Color -> Color
- translucent :: Color -> Color
- assortedColors :: [Color]
- hue :: Color -> Number
- saturation :: Color -> Number
- luminosity :: Color -> Number
- alpha :: Color -> Number
- pattern White :: Color
- pattern Black :: Color
- pattern Gray :: Color
- pattern Grey :: Color
- pattern Red :: Color
- pattern Orange :: Color
- pattern Yellow :: Color
- pattern Green :: Color
- pattern Blue :: Color
- pattern Purple :: Color
- pattern Pink :: Color
- pattern Brown :: Color
- type Point = (Number, Number)
- translatedPoint :: (Point, Number, Number) -> Point
- rotatedPoint :: (Point, Number) -> Point
- scaledPoint :: (Point, Number, Number) -> Point
- dilatedPoint :: (Point, Number) -> Point
- type Vector = (Number, Number)
- vectorLength :: Vector -> Number
- vectorDirection :: Vector -> Number
- vectorSum :: (Vector, Vector) -> Vector
- vectorDifference :: (Vector, Vector) -> Vector
- scaledVector :: (Vector, Number) -> Vector
- rotatedVector :: (Vector, Number) -> Vector
- dotProduct :: (Vector, Vector) -> Number
- data Picture
- data Font
- data TextStyle
- blank :: HasCallStack => Picture
- polyline :: HasCallStack => [Point] -> Picture
- path :: HasCallStack => [Point] -> Picture
- thickPolyline :: HasCallStack => ([Point], Number) -> Picture
- thickPath :: HasCallStack => ([Point], Number) -> Picture
- polygon :: HasCallStack => [Point] -> Picture
- thickPolygon :: HasCallStack => ([Point], Number) -> Picture
- solidPolygon :: HasCallStack => [Point] -> Picture
- curve :: HasCallStack => [Point] -> Picture
- thickCurve :: HasCallStack => ([Point], Number) -> Picture
- closedCurve :: HasCallStack => [Point] -> Picture
- thickClosedCurve :: HasCallStack => ([Point], Number) -> Picture
- solidClosedCurve :: HasCallStack => [Point] -> Picture
- rectangle :: HasCallStack => (Number, Number) -> Picture
- solidRectangle :: HasCallStack => (Number, Number) -> Picture
- thickRectangle :: HasCallStack => (Number, Number, Number) -> Picture
- circle :: HasCallStack => Number -> Picture
- solidCircle :: HasCallStack => Number -> Picture
- thickCircle :: HasCallStack => (Number, Number) -> Picture
- arc :: HasCallStack => (Number, Number, Number) -> Picture
- sector :: HasCallStack => (Number, Number, Number) -> Picture
- thickArc :: HasCallStack => (Number, Number, Number, Number) -> Picture
- text :: HasCallStack => Text -> Picture
- lettering :: HasCallStack => Text -> Picture
- styledText :: HasCallStack => (Text, Font, TextStyle) -> Picture
- styledLettering :: HasCallStack => (Text, Font, TextStyle) -> Picture
- colored :: HasCallStack => (Picture, Color) -> Picture
- coloured :: HasCallStack => (Picture, Color) -> Picture
- translated :: HasCallStack => (Picture, Number, Number) -> Picture
- scaled :: HasCallStack => (Picture, Number, Number) -> Picture
- dilated :: HasCallStack => (Picture, Number) -> Picture
- rotated :: HasCallStack => (Picture, Number) -> Picture
- pictures :: HasCallStack => [Picture] -> Picture
- (&) :: HasCallStack => Picture -> Picture -> Picture
- coordinatePlane :: HasCallStack => Picture
- codeWorldLogo :: HasCallStack => Picture
- data Event
- traced :: (a, Text) -> a
- type Program = IO ()
- drawingOf :: Picture -> Program
- animationOf :: (Number -> Picture) -> Program
- activityOf :: ([Number] -> world, (world, Event) -> world, world -> Picture) -> Program
- debugActivityOf :: ([Number] -> world, (world, Event) -> world, world -> Picture) -> Program
- groupActivityOf :: (Number, [Number] -> state, (state, Event, Number) -> state, (state, Number) -> Picture) -> Program
- simulationOf :: ([Number] -> world, (world, Number) -> world, world -> Picture) -> Program
- debugSimulationOf :: ([Number] -> world, (world, Number) -> world, world -> Picture) -> Program
- interactionOf :: ([Number] -> world, (world, Number) -> world, (world, Event) -> world, world -> Picture) -> Program
- debugInteractionOf :: ([Number] -> world, (world, Number) -> world, (world, Event) -> world, world -> Picture) -> Program
- collaborationOf :: (Number, [Number] -> state, (state, Number) -> state, (state, Event, Number) -> state, (state, Number) -> Picture) -> Program

# Documentation

Welome to CodeWorld! You can define your own pictures, animations, and games by defining variables and functions. There are four kinds of CodeWorld programs:

- Pictures. To create a picture, you'll define the variable called
`program`

using`drawingOf`

. The parameter to`drawingOf`

should be a`Picture`

. Example:

program = drawingOf(tree)

- Animations. To create an animation, you'll define the variable called
`program`

using`animationOf`

. The parameter to`animationOf`

should be a function, mapping each time in seconds (a`Number`

) to a`Picture`

that is shown at that time. Example:

program = animationOf(spinningWheel)

- Activities. An activity is a program that can interact with the user by
responding to pointer and keyboard events. It also has a persistent state
that can be used to remember information about the past. To create an
activity, you should first decide on the type to describe the state of
things (called the "world" type). You will then describe the activity with:
an initial world, a change function that describes how the world changes
when various things happen, and a picture function that converts the world
into a picture to display. You will then use
`activityOf`

to define`program`

. Example:

program = activityOf(initial, change, picture)

- Group activities. Finally, you can build a multi-user activity that others
can join over the internet. The process is similar to activities, except
that you'll specify a number of participants, and your change and picture
functions receive extra arguments describing which participant an event or
picture applies to. You'll use
`groupActivityOf`

to define these. Example:

program = groupActivityOf(n, initial, change, picture)

The type for numbers.

Numbers can be positive or negative, whole or fractional. For example, 5, 3.2, and -10 are all values of the type Number.

(/) :: HasCallStack => Number -> Number -> Number infixl 7 #

Divides two numbers. The second number should not be zero.

(>=) :: Number -> Number -> Truth infix 4 #

Tells whether one number is greater than or equal to the other.

(<=) :: Number -> Number -> Truth infix 4 #

Tells whether one number is less than or equal to the other.

Gives the absolute value of a number.

If the number if positive or zero, the absolute value is the same as the number. If the number is negative, the absolute value is the opposite of the number.

absoluteValue :: Number -> Number #

truncation :: Number -> Number #

Gives the number without its fractional part.

For example, truncate(4.2) is 4, while truncate(-4.7) is -4.

Gives the number rounded to the nearest integer.

For example, round(4.2) is 4, while round(4.7) is 5.

Gives the smallest integer that is greater than or equal to a number.

For example, ceiling(4) is 4, while ceiling(4.1) is 5. With negative numbers, ceiling(-3.5) is -3, since -3 is greater than -3.5.

Gives the largest integer that is less than or equal to a number.

For example, floor(4) is 4, while floor(3.9) is 3. With negative numbers, floor(-3.5) is -4, since -4 is less than -3.5.

quotient :: HasCallStack => (Number, Number) -> Number #

Gives the integer part of the result when dividing two numbers.

For example, 3/2 is 1.5, but quotient(3, 2) is 1, which is the integer part.

remainder :: HasCallStack => (Number, Number) -> Number #

Gives the remainder when dividing two numbers.

For example, remainder(3,2) is 1, which is the remainder when dividing 3 by 2.

The constant pi, which is equal to the ratio between the circumference and diameter of a circle.

pi is approximately 3.14.

Gives the exponential of a number. This is equal to the constant e, raised to the power of the number.

The exp function increases faster and faster very quickly. For example, if t is the current time in seconds, exp(t) will reach a million in about 14 seconds. It will reach a billion in around 21 seconds.

sqrt :: HasCallStack => Number -> Number #

Gives the square root of a number. This is the positive number that, when multiplied by itself, gives the original number back.

The sqrt always increases, but slows down. For example, if t is the current time, sqrt(t) will reach 5 in 25 seconds. But it will take 100 seconds to reach 10, and 225 seconds (almost 4 minutes) to reach 15.

squareRoot :: HasCallStack => Number -> Number #

log :: HasCallStack => Number -> Number #

Gives the natural log of a number. This is the opposite of the exp function.

Like sqrt, the log function always increases, but slows down. However, it slows down much sooner than the sqrt function. If t is the current time in seconds, it takes more than 2 minutes for log(t) to reach 5, and more than 6 hours to reach 10!

logBase :: HasCallStack => (Number, Number) -> Number #

Gives the logarithm of the first number, using the base of the second number.

Gives the tangent of an angle, where the angle is measured in degrees.

This is the slope of a line at that angle from horizontal.

asin :: HasCallStack => Number -> Number #

Gives the inverse sine of a value, in degrees.

This is the unique angle between -90 and 90 that has the input as its sine.

Gives the inverse tangent of a value, in degrees.

This is the unique angle between -90 and 90 that has the input as its tangent.

acos :: HasCallStack => Number -> Number #

Gives the inverse cosine of a value, in degrees.

This is the unique angle between 0 and 180 that has the input as its cosine.

properFraction :: Number -> (Number, Number) #

Separates a number into its whole and fractional parts.

For example, properFraction(1.2) is (1, 0.2).

gcd :: HasCallStack => (Number, Number) -> Number #

Gives the greatest common divisor of two numbers.

This is the largest number that divides each of the two parameters. Both parameters must be integers.

lcm :: HasCallStack => (Number, Number) -> Number #

Gives the least common multiple of two numbers.

This is the smallest number that is divisible by both of the two parameters. Both parameters must be integers.

isInteger :: Number -> Truth #

Tells whether a Number is an integer or not.

An integer is a whole number, such as 5, 0, or -10. Numbers with non-zero decimals, like 5.3, are not integers.

fromInteger :: Integer -> Number #

fromRational :: Rational -> Number #

fromDouble :: HasCallStack => Double -> Number #

# Text

fromString :: String -> Text #

fromCWText :: Text -> Text #

numberOfCharacters :: Text -> Number #

numberOfWords :: Text -> Number #

numberOfLines :: Text -> Number #

characters :: Text -> [Text] #

joinedWith :: ([Text], Text) -> Text #

startsWith :: (Text, Text) -> Truth #

substitution :: (Text, Text, Text) -> Text #

Gives the result of replacing one piece of text with another.

For example, `substitution("How do you do?", "do", "be")`

is equal to
`"How be you be?"`

.

substitutions :: (Text, [(Text, Text)]) -> Text #

Gives the result of performing many substitutions in a piece of text. This is commonly used to build text to show in a program, as in this example:

substitutions("Lives: [lives] of 3 Score: [score]", [("[lives]", printed(lives)), ("[score]", printed(score))])

# General purpose functions

ifThenElse :: Truth -> a -> a -> a #

fail :: HasCallStack => String -> a #

Fails with an error message. This is required (though apparently unused) by the desugaring for pattern binds in list comprehensions.

(/=) :: a -> a -> Truth infix 4 #

Compares values to see if they are not equal.
Note that `a /= b`

is the same as `not (a == b)`

.

Bounded Bool | |

Enum Bool | |

Eq Bool | |

Ord Bool | |

Show Bool | |

Generic Bool | |

Bits Bool | |

FiniteBits Bool | |

Random Bool | |

Unbox Bool | |

SingI Bool False | |

SingI Bool True | |

Vector Vector Bool | |

MVector MVector Bool | |

SingKind Bool (KProxy Bool) | |

type Rep Bool | |

data Sing Bool | |

data Vector Bool | |

data MVector s Bool | |

type (==) Bool a b | |

type DemoteRep Bool (KProxy Bool) | |

toOperator :: ((a, b) -> c) -> a -> b -> c #

Converts a function to an operator.

Example use:

f(x,y) = 2*x + y (%) = toOperator(f) eight = 3 % 2

This has the same effect as defining % as:

x % y = 2*x + y eight = 3 % 2

fromOperator :: (a -> b -> c) -> (a, b) -> c #

Converts an operator into a normal function.

Example use:

divide = fromOperator(/) four = divide(16, 4)

firstOfPair :: (a, b) -> a #

Returns the first element of an ordered pair.

secondOfPair :: (a, b) -> b #

Returns the second element of an ordered pair.

undefined :: HasCallStack => a #

Represents an undefined value. This lets you compile programs with unfinished values. If the value is needed, the program will crash.

at :: HasCallStack => ([a], a, Number) -> [a] #

Gives a list with a replaced element at an index. Indices start at 1.

(#) :: HasCallStack => [a] -> Number -> a infixl 9 #

Gives the member of a list at a given index. Indices start at 1.

Determines if any proposition in a list is true.

For example, `any([even(n) | n <- [1,2,3]])`

is `True`

, because 2 is even.

Determines if all propositions in a list are true.

For example, `all([even(n) | n <- [2,3,4]])`

is `False`

, because 3 is not even.

Determines if all propositions in a list are false.

For example, `none([odd(n) | n <- [2,3,4]])`

is `False`

, because 3 is odd.

first :: HasCallStack => ([a], Number) -> [a] #

Gives the first members of a list, up to the given number.

last :: HasCallStack => ([a], Number) -> [a] #

Gives the last members of a list, up to the given number.

rest :: HasCallStack => ([a], Number) -> [a] #

Gives all members of a list after the given number.

In general, `xs = first(xs, n) ++ rest(xs, n)`

.

groups :: ([a], Number) -> [[a]] #

Converts a list of elements into a list of smaller lists, each of the given length.

For example, `[ (x, y) | [x, y] <- groups(randomNumbers(42), 2) ]`

.

while :: ([a], a -> Truth) -> [a] #

Gives the longest prefix of a list for which a condition is true.

For example, `while([2,4,5,6], even) = [2,4]`

.

until :: ([a], a -> Truth) -> [a] #

Gives the longest prefix of a list for which a condition is false.

For example, `until([2,4,5,6], odd) = [2,4]`

.

after :: ([a], a -> Truth) -> [a] #

Gives the remaining portion of a list after the longest prefix for which a condition is true.

In general, `xs = while(xs, cond) ++ after(xs, cond)`

.

concatenation :: [[a]] -> [a] #

Gives the concatenation of all of the lists in its input.

subsequences :: [a] -> [[a]] #

permutations :: [a] -> [[a]] #

transposed :: [[a]] -> [[a]] #

randomsFrom :: StdGen -> [Number] #

randomNumbers :: Number -> [Number] #

The type for numbers.

Numbers can be positive or negative, whole or fractional. For example, 5, 3.2, and -10 are all values of the type Number.

# Colors

Warning: Please use RGB(...) instead of cyan.The variable cyan may be removed July 2020.

Warning: Please use RGB(...) instead of magenta.The variable magenta may be removed July 2020.

aquamarine :: Color #

Warning: Please use RGB(...) instead of aquamarine.The variable aquamarine may be removed July 2020.

Warning: Please use RGB(...) instead of azure.The variable azure may be removed July 2020.

Warning: Please use Purple instead of violet.The variable violet may be removed July 2020.

chartreuse :: Color #

Warning: Please use RGB(...) instead of chartreuse.The variable chartreuse may be removed July 2020.

Warning: Please use RGB(...) instead of rose.The variable rose may be removed July 2020.

translucent :: Color -> Color #

assortedColors :: [Color] #

saturation :: Color -> Number #

luminosity :: Color -> Number #

Warning: Please use white (lower case) instead of White.The value White may be removed July 2019.

Warning: Please use black (lower case) instead of Black.The value Black may be removed July 2019.

Warning: Please use gray (lower case) instead of Gray.The value Gray may be removed July 2019.

Warning: Please use grey (lower case) instead of Gray.The value Grey may be removed July 2019.

Warning: Please use red (lower case) instead of Red.The value Red may be removed July 2019.

Warning: Please use orange (lower case) instead of Orange.The value Orange may be removed July 2019.

Warning: Please use yellow (lower case) instead of Yellow.The value Yellow may be removed July 2019.

Warning: Please use green (lower case) instead of Green.The value Green may be removed July 2019.

Warning: Please use blue (lower case) instead of Blue.The value Blue may be removed July 2019.

Warning: Please use purple (lower case) instead of Purple.The value Purple may be removed July 2019.

Warning: Please use pink (lower case) instead of Pink.The value Pink may be removed July 2019.

Warning: Please use brown (lower case) instead of Brown.The value Brown may be removed July 2019.

# Pictures

rotatedPoint :: (Point, Number) -> Point #

dilatedPoint :: (Point, Number) -> Point #

vectorLength :: Vector -> Number #

vectorDirection :: Vector -> Number #

vectorDifference :: (Vector, Vector) -> Vector #

scaledVector :: (Vector, Number) -> Vector #

rotatedVector :: (Vector, Number) -> Vector #

dotProduct :: (Vector, Vector) -> Number #

polyline :: HasCallStack => [Point] -> Picture #

A thin sequence of line segments with these endpoints

path :: HasCallStack => [Point] -> Picture #

Warning: Please use polyline(...) instead of path(...).path may be removed July 2019.

A thin sequence of line segments with these endpoints

thickPolyline :: HasCallStack => ([Point], Number) -> Picture #

A thin sequence of line segments, with these endpoints and line width

thickPath :: HasCallStack => ([Point], Number) -> Picture #

Warning: Please use thickPolyline(...) instead of thickPath(...).thickPath may be removed July 2019.

A thin sequence of line segments, with these endpoints and line width

thickPolygon :: HasCallStack => ([Point], Number) -> Picture #

A thin polygon with these points as vertices

solidPolygon :: HasCallStack => [Point] -> Picture #

A solid polygon with these points as vertices

thickCurve :: HasCallStack => ([Point], Number) -> Picture #

A thick curve passing through these points, with this line width

closedCurve :: HasCallStack => [Point] -> Picture #

A thin closed curve passing through these points.

thickClosedCurve :: HasCallStack => ([Point], Number) -> Picture #

A thick closed curve passing through these points, with this line width.

solidClosedCurve :: HasCallStack => [Point] -> Picture #

A solid closed curve passing through these points.

rectangle :: HasCallStack => (Number, Number) -> Picture #

A thin rectangle, with this width and height

solidRectangle :: HasCallStack => (Number, Number) -> Picture #

A solid rectangle, with this width and height

thickRectangle :: HasCallStack => (Number, Number, Number) -> Picture #

A thick rectangle, with this width and height and line width

solidCircle :: HasCallStack => Number -> Picture #

A solid circle, with this radius

thickCircle :: HasCallStack => (Number, Number) -> Picture #

A thick circle, with this radius and line width

arc :: HasCallStack => (Number, Number, Number) -> Picture #

A thin arc, starting and ending at these angles, with this radius

sector :: HasCallStack => (Number, Number, Number) -> Picture #

A solid sector of a circle (i.e., a pie slice) starting and ending at these angles, with this radius

thickArc :: HasCallStack => (Number, Number, Number, Number) -> Picture #

A thick arc, starting and ending at these angles, with this radius and line width

text :: HasCallStack => Text -> Picture #

Warning: Please use lettering(...) instead of text(...).text may be removed July 2019.

A rendering of text characters.

styledText :: HasCallStack => (Text, Font, TextStyle) -> Picture #

Warning: Please use styledLettering(...) instead of styledText(...).styledText may be removed July 2019.

A rendering of text characters, with a specific choice of font and style.

styledLettering :: HasCallStack => (Text, Font, TextStyle) -> Picture #

A rendering of text characters, with a specific choice of font and style.

translated :: HasCallStack => (Picture, Number, Number) -> Picture #

A picture drawn translated in these directions.

coordinatePlane :: HasCallStack => Picture #

A coordinate plane. Adding this to your pictures can help you measure distances more accurately.

Example:

program = drawingOf(myPicture & coordinatePlane) myPicture = ...

codeWorldLogo :: HasCallStack => Picture #

The CodeWorld logo.

# Events

An event initiated by the user.

Values of this type represent events that the user triggers when using an interactive program.

Key events describe the key as `Text`

. Most keys are represented
by a single character text string, with the capital letter or other
symbol from the key. Keys that don't correspond to a single
character use longer names from the following list. Keep in mind
that not all of these keys appear on all keyboards.

- Up, Down, Left, and Right for the cursor keys.
- F1, F2, etc. for function keys.
- Backspace
- Tab
- Enter
- Shift
- Ctrl
- Alt
- Esc
- PageUp
- PageDown
- End
- Home
- Insert
- Delete
- CapsLock
- NumLock
- ScrollLock
- PrintScreen
- Break
- Separator
- Cancel
- Help

# Debugging

# Entry points

animationOf :: (Number -> Picture) -> Program #

groupActivityOf :: (Number, [Number] -> state, (state, Event, Number) -> state, (state, Number) -> Picture) -> Program #

interactionOf :: ([Number] -> world, (world, Number) -> world, (world, Event) -> world, world -> Picture) -> Program #