#### numeric functions
# max: float, float → float
# return the larger of two given numbers.
#
max( 7.0, 2.0 ) ⇒ 7.0
# min: float, float → float
# return the smaller of two given numbers.
#
min( 7.0, 2.0 ) ⇒ 2.0
# int : float1 → int
# Convert a float to an int:
#
int( 4.9 ) ⇒ 4
int( 15.0 ) ⇒ 15
int( -2.3 ) ⇒ -2
#### string functions
# str : float2 → string
# Convert a given number to a string
#
str(15) ⇒ "15"
# len : string → int
# Return the number of characters in a given string.
#
len("hello") ⇒ 5
# substring : string, int, int → string
# Given some text, a start-index, and a stop-index,
# return the characters of `txt` from `start` up until (but not including) `stop`.
# Indices are 0-based.
#
substring( "radford", 3, 6) ⇒ "for"
substring( "radford", 0, 3) ⇒ "rad"
#### File, Picture, Pixel functions
# pickAFile : None → string
# Return a filename as selected by the meatbag sitting at the keyboard.
#
pickAFile() ⇒ "C:/Users/CarnieTote/Documents/important file.docx"
pickAFile() ⇒ "C:/Users/CarnieTote/Documents/itec109/ufo.png"
# makePicture : string -> Picture
# Return a picture-object created from the provided filename.
#
makePicture( "ufo.png" ) ⇒ A picture with width 192 and height 47.
# show : Picture → None
# Display a Picture-object in a window on the screen.
#
show( makePicture("ufo.png") ) ⇒ None
# repaint : Picture → None
# Update the window where the indicated Picture-object has been previously displayed.
# Useful if any pixels have been modified since.
#
repaint( makePicture("ufo.png") ) ⇒ None
# explore : Picture → None
# Pull up a pixel-explorer tool for the indicated Picture-object.
#
explore( makePicture("ufo.png") ) ⇒ None
# getPixelAt : Picture, int, int → Pixel
# Return the individual pixel object at the specified (x,y) coordinates of the given Picture-object.
#
getPixelAt(makePicture("ufo.png"), 5, 5) ⇒ a Pixel with color=(255,255,0)
# getRed : Pixel → int
# getGreen : Pixel → int
# getBlue : Pixel → int
# Return a value in [0,256) — the redness/greenness/blueness of the given pixel.
#
getGreen( getPixelAt(makePicture("ufo.png"), 5, 5) ) ⇒ 255
# setRed : Pixel, int → None
# setGreen : Pixel, int → None
# setBlue : Pixel, int → None
# Change a pixel's red/green/blue to be the given number.
#
setBlue( getPixelAt(makePicture("ufo.png"), 5, 5), 22 ) ⇒ None
|