Motivation

I decided to try out Google App Inventor, being invited to the Beta. I wanted a simple enough project to get a feel for the process without becoming bogged down in complex logic or user interface (UI) design. It occurred to me that a random Oracle generator for the In A Wicked Age role-playing game by Vincent Baker would be interesting enough and maybe even useful to others.

The Application

The Logic

App Inventor uses OpenBlocks as a visual programming environment. Very cool for beginners, but also very mouse-intensive when one has repetitious tasks (like pasting in 208 lines of text!)—I’d have liked to be able to edit a TXT or XML file to populate the Oracles lists.

Here is an image of the basic logic for the Blood And Sex Oracles button:

Nothing too fancy going on here:

Copy the set-specific list to the OraclesCurrent temporary list.

Call the generic procedure that populates the Oracle labels:

Populate the first Oracle label element’s Text with a random Oracle from the list.

Set the second label’s text to the same value as the first.

While the second is the same as the first, populate the second with a random Oracle from the list.

Repeat Steps 2 and 3 for the remaining two label elements, checking them against all preceding labels.
Put another way, an Oracle label element can not contain the same Oracle text that is currently in any preceding label element.

The rest of the app is a simple UI of buttons for choosing an Oracle set (the BloodAndSex.Click event in the logic shown) and, of course, four global list variables (one-dimensional arrays) to hold the Oracle-set-specific text (the OraclesBloodAndSex in the logic shown).