Mama’s Little Function
A function is like a blender: input goes in, output comes out.
Sung to the tune of Short’nin Bread — and yes, JavaScript is required.
A function is like a blender or an oven. It takes input, does some sort of action, and delivers output, hopefully delectible!
It's a super important idea in math and computer science, and to honor that concept, we dedicate this song, sung to the children's tune of 'Short'nin Bread'
We deliberately soft-petaled the Bootstrap in the song lyrics, preferring instead to use more traditional CSS.
Watch out though...
What if functions can't function? Perhaps some dodo disables JavaScript? What happens then? Try it and see!
Danger Will Robinson! If you disable JavaScript, be sure to reenable it when you're done field-testing!
If you care about such things, you'll notice that this page does not validate. We know. It's a compromise we made to illustrate how to alert a user about disabled JavaScript.
Mama's Little Function
Got a baby function
Named f(x)
He takes a '2' and adds 3x.
Give him a two, now the answer's great:
f(2), (y!), it equals 8!
Chorus:
Mama's little function eats xs, xs
Mama's little function yields f(x) (twice)
An x is in the oven,
Shut 'im in tight
(Quench my algebra appetite!)
When he finish cook'n
Whatcha got there?
Shut my mouth! An ordered pair!
Bring out the functions!
(Get out the lead!)
Gotta get these functions fed.
Whatcha gonna feed em?
Nothin else to choose
xs are what these functions use!
Chorus
Functions gobbled xs
From the domain
(Listen close to this refrain)
The xs it gobbled ~
WOW - what a change!
It spit out ys to make the range!
Cram it with xs
Grind out the ys
(You're in for quite a big surprise!)
Look at 'em closely...
Put on your specs
Whaddaya know - y! (It's f(x)!)
Chorus
Give f a function (g!)
(not an x) instead;
Function f will be well-fed!
The resulting composition
A wonder to see
A brand new function called f of g!