Function Repository Resource:

WolfieSay

Source Notebook

Have Wolfie say an expression

Contributed by: Richard Hennigan (Wolfram Research)

ResourceFunction["WolfieSay"][thing]

asks a cool wolf to say thing.

ResourceFunction["WolfieSay"][thing,pos]

positions the wolf according to the position specified by pos.

Details and Options

ResourceFunction["WolfieSay"] is a variation of the world-famous resource function BirdSay.

Examples

Basic Examples (4) 

Have a wolf say your output:

In[1]:=
ResourceFunction["WolfieSay"][Plot[Sin[x], {x, -5, 5}]]
Out[1]=

Position the wolf on the right:

In[2]:=
ResourceFunction["WolfieSay"][Plot[Sin[x], {x, -5, 5}], Right]
Out[2]=

WolfieSay a cool wolf:

In[3]:=
ResourceFunction["WolfieSay"][
 Labeled[Style[
   ResourceFunction["FromCharacterName"]["WolframLanguageLogo"], 100],
   "This is a pretty cool wolf", Top]]
Out[3]=

WolfieSay an even cooler wolf:

In[4]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/9ebc63cb-2f19-453f-926f-6af4710a0051"]
Out[4]=

Scope (3) 

Position at the top left:

In[5]:=
ResourceFunction["WolfieSay"]["top left", {Top, Left}]
Out[5]=

Position at the left top:

In[6]:=
ResourceFunction["WolfieSay"]["left top", {Left, Top}]
Out[6]=

See all valid positions:

In[7]:=
positions = Join[Tuples[#], Tuples[Reverse[#]]] &[{{Left, Right}, {Top, Bottom}}]
Out[7]=
In[8]:=
ResourceFunction["WolfieSay"][Row[#], #] & /@ positions
Out[8]=

Applications (1) 

Create a notebook that prints messages in a really cool way:

In[9]:=
wolfBox = Module[{expr},
   With[{b = ToBoxes[ResourceFunction["WolfieSay"][expr]]}, Replace[CurrentValue[{StyleDefinitions, "MessageTemplate", "TemplateBoxOptionsDisplayFunction"}], HoldPattern[e_ &] :> Function @@ {b /. SymbolName[expr] -> e}]]
   ];

nb = CreateDocument[{ExpressionCell[Defer[1/0], "Input"], ExpressionCell[Defer[First[x]], "Input"], ExpressionCell[Defer[ResourceFunction["WolfieSay"]["Neat!"]], "Input"]},
   StyleDefinitions -> Notebook[{Cell[StyleData["MessageTemplate"], "TemplateBoxOptionsDisplayFunction" -> wolfBox]}]];

NotebookEvaluate[nb, InsertResults -> True]
Out[10]=

Properties and Relations (4) 

WolfieSay can say a BirdSay:

In[11]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/8ac5798d-a3a3-4ec2-a6d9-6edcebde9421"]
Out[11]=

Similarly, BirdSay can say a WolfieSay:

In[12]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/b790a1b9-33bd-4340-9e8d-29f06a600a0b"]
Out[12]=

The output of WolfieSay is an Interpretation that can be copied and pasted:

In[13]:=
ResourceFunction["WolfieSay"][a + b]
Out[13]=

Copy and paste the output into another expression:

In[14]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/07073a09-347c-4f73-a3b1-9d533f4e5a4a"]
Out[14]=
In[15]:=
ResourceFunction["WolfieSay"][%]
Out[15]=

Say WolfieSay:

In[16]:=
AudioPlay[SpeechSynthesize["WolfieSay"]]
Out[16]=

WolfieSay what was just said:

In[17]:=
ResourceFunction["WolfieSay"][%]
Out[17]=

Possible Issues (1) 

It is very tempting to WolfieSay everything:

In[18]:=
$Post = ResourceFunction["WolfieSay"]
Out[18]=
In[19]:=
1 + 1
Out[19]=
In[20]:=
$Post =.

Neat Examples (6) 

WolfieSay a Wolfram:

In[21]:=
ResourceFunction["WolfieSay"][
Entity["Person", "StephenWolfram::j276d"][
EntityProperty["Person", "Image"]]]
Out[21]=

WolfieSay another wolfram:

In[22]:=
ResourceFunction["WolfieSay"][
Entity["Element", "Tungsten"][
EntityProperty["Element", "Image"]]]
Out[22]=

This one is probably a stretch:

In[23]:=
ResourceFunction["WolfieSay"][
 ImageAssemble[
  ConformImages[{Entity["Species", "Species:CanisLupus"][
EntityProperty["Species", "Image"]], Entity[
    "Species", "Species:OvisAries"][
EntityProperty["Species", "Image"]]}]]]
Out[23]=

WolfieSay a WolfieSay that is WolfieSaying a WolfieSay more times than you care to say WolfieSay:

In[24]:=
Nest[Function[
  ResourceFunction["WolfieSay"][
   ImageResize[
    ImageCrop[
     ImageRotate[Rasterize[#1], -Pi/26, Background -> White]], Scaled[3/4]]]], "", 20]
Out[24]=

Animate your WolfieSay:

In[25]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/b5dbb9f0-de99-44d9-bd81-0bf216fc81bb"]
Out[25]=

Act out a play:

In[26]:=
script = StringTake[ResourceData["Hamlet"], {828, 949}]
Out[26]=
In[27]:=
Grid[List /@ StringCases[
   StringReplace[script, "Bernardo" :> "Birdnardo"], {"Ber.\n" ~~ Shortest[line__] ~~ "\n" :> Item[ResourceFunction["BirdSay"][line], Alignment -> Left], "Fran.\n" ~~ Shortest[line__] ~~ "\n" :> Item[ResourceFunction["WolfieSay"][line, Right], Alignment -> Right]}]]
Out[27]=

Version History

  • 1.0.0 – 10 June 2019

Related Resources

License Information