Message Boards Message Boards

2
|
1901 Views
|
0 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Documentation Roulette

Posted 10 years ago

A new way to learn Mathematica.... click on the button for a random system function's documentation page...

Button["Random Documentation",
 Quiet@Module[{choice, systemFunctions, messages},
    systemFunctions = Names["System`*"];
    messages = 
     CurrentValue[$FrontEnd, {MessageOptions, "ErrorAction"}];
    CurrentValue[$FrontEnd, {MessageOptions, "ErrorAction"}] = {};
    NestWhile[
     NotebookOpen[
       "paclet:ref/" <> 
        RandomChoice[systemFunctions]] &, $Failed, # === $Failed &];
    CurrentValue[$FrontEnd, {MessageOptions, "ErrorAction"}] = 
     messages]
 ]

Or, as a convenient instructional palette:

CreateWindow@PaletteNotebook[
  {Button["Random Documentation",
    Quiet@Module[{choice, systemFunctions, messages},
      systemFunctions = Names["System`*"];
      messages = 
       CurrentValue[$FrontEnd, {MessageOptions, "ErrorAction"}];
      CurrentValue[$FrontEnd, {MessageOptions, "ErrorAction"}] = {};
      NestWhile[
       NotebookOpen[
         "paclet:ref/" <> 
          RandomChoice[
           systemFunctions]] &, $Failed, # === $Failed &];
      CurrentValue[$FrontEnd, {MessageOptions, "ErrorAction"}] = 
       messages],
    Appearance -> "Palette",
    BaseStyle -> {FontFamily -> "Helvetica", 11, Bold}
    ]},
  WindowTitle -> "Documentation Roulette!"
  ]
POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract