Mint has many objects, and within these objects are subprograms that are not part of any library. Here they are:|
Lists are data structures that can hold values of any type. They are declared with a comma separated list of items inside square brackets.
Returns the number of items in the list. Same as
Removes the last item in the list and returns it.
Removes the ith item in the list and returns it.
Reverses the list.
Finds the item in the list and returns the position of the item in the list. If the item cannot be found, returns -1.
Attaches the item to the end of the list. Same as
Returns the sublist of this list, starting at item number i.
Returns the sublist of this list, starting at item number a and ending at item number b - 1.
Replaces the list's sublist from position a to position b - 1 with the new sublist list.
Strings are variables that hold text. They are declared with quotes surrounding a series of zero or more characters.
Returns the number of characters in the string. Same as
Splits the string around the substring substr, and returns a list of the split parts. For example, "hi hello bye".split(" ") will return ["hi", "hello", "bye"].
Returns the numerical representation of the first ASCII character of this string.
Returns the position of the substring substr in this string.
Returns the substring starting at character position a and ending at position b - 1.
Returns the substring starting at character position i and ending at the end of the string.
Replaces the substring starting at character a and ending at character b - 1 with the new string slice.
Returns the string with all uppercase characters.
Returns the string with all lowercase characters.
Returns true if the string starts with substr.
Returns true if the string ends with substr.
Replaces all instances of a in the string with b.
Removes all instances of a in the string.
Bytes are lists that can only hold integers between 0 and 255.
Returns the number of items in the bytes list. Same as
Attaches b to the end of the bytes list. Same as
Returns the ith byte in the bytes list.
Set the ith byte in the bytes list to be equal to value.
Windows are rectangular frames used for drawing buttons and graphics.
Sets the size of the window to be a x b.
Makes the window visible.
Makes the window invisible.
Sets the window's title to be t.
Adjust the sizing and placement of the window and its contents.
Moves the window to (x, y).
Adds button b to this window.
Sets the background color of the window to rbg. rbg must be a list of three integers between 0 and 255.
Sets the drawing color of the window to rbg. rbg must be a list of three integers between 0 and 255.
Draws the shape s onto the window. Shapes can be arcs, lines, ovals, rectangles, or polygons.
Removes drawn shapes from the window.
Buttons are clickable widgets that can be placed into a window.
Allows the button to be clicked.
Prevents the button from being clicked.
Sets the display text of the button to t.
Sets the subprogram that will be executed when the button is clicked.
Sets the size of the button to be a x b.
Sets the position of the button to be (x, y) within the window.
Integers include the positive whole numbers, negative whole numbers, and zero. Methods can be called on integer literals, such as
Returns i + 1.
Returns i - 1.
Returns the number of base-10 digits this integer has, ignoring any negative sign.
Returns a string containing the binary representation of this integer.
Returns a Bytes object containing the 4 bytes of this 32-bit integer.
A rational number is any quotient of two integers. In Mint, rational numbers are constructed whenever two integers are divided. To avoid confusion, rational numbers are always printed as their decimal expansions, e.g. 1/3 is printed as 0.333333333333333... instead of "1/3". Use the .fraction() method on a rational number to override this behavior.
Returns this rational number as the string "a/b", where a is the numerator and b is the denominator. "25/48" is one example.
Returns the numerator of this rational number as an integer.
Returns the denominator of this rational number as an integer.
Real numbers come into play when rational numbers cannot represent the value given. Real numbers are implemented using double-precision floating point format.
Returns the integer part of this real number.
Returns the fractional part of this real number.
Previous Lesson: Documentation
Next Lesson: (None)
Table of Contents