Where’s MIT?

Use App Inventor 2 to search from the Big Bang to locate the Massachusetts Institute of Technology (MIT) within the Universe

June 2016

Sample run

Start at the Big Bang

Children of The Big Bang

After Picking Laniakea Super Cluster

Program Structure

Designer

Screen1.Initialize

Wheres_MIT.csv

File1.GotText

Global map and map_text

Stack and Root

Visit

Children

URL

Row

ListPicker1.AfterPicking

All the blocks

See this app in The Gallery:

See the next version of this project, using procedures instead of globals

More projects

Sample run

Start at the Big Bang

The Big Bang.png

We start with a Web Viewer pointing to a web page on The Big Bang, and a List Picker set to show the super clusters that resulted from The Big Bang .

Children of The Big Bang

After The Big Bang.png

This List Picker is loaded with the names of the major sub components of the item that was last picked, followed by the trail of prior items, to let the user go back from a poor choice.

After Picking Laniakea Super Cluster

Laniakea Supercluster.png

Here we have picked the Laniakea Super Cluster, and the Web Viewer and List Picker are reloaded to show our selection and its possible children.

Program Structure

Designer

Designer.png

There are only three components:

  1. A Web Viewer to show details of our choice
  2. A List Picker to show our navigation options
  3. A File for loading our navigation map.

Screen1.Initialize

Screen1_Initialize.png

At startup time, we start loading our csv formatted navigation map file from the Media Drawer.

Wheres_MIT.csv

Microsoft Excel - Wheres_MIT.csv.png

Spreadsheet programs make it easy to edit a navigational map file and export it in Comma Separated Value (CSV) format.  This map is set up with parent name in column 1, child name in column 2, and child URL in column 3.

Column 2 is our unique key to this table.

The first row is special in that I have coded the parent and child names on column 1 and 2 of row 1 so that the root of this tree is its own child, and also its own parent.

It’s like the Home Page of The Universe.

File1.GotText

File1_GotText.png

When the csv text map arrives, we save it into a global text variable, in case we need to diagnose it later.  Then we send it through a list from csv table block to convert it into a table (list of lists).

The first column of the first row is reserved for the starting point of our tour, the root.

We visit the root.

Global map and map_text

global map and map_text.png

Stack and Root

stack and root.png

The stack global will hold a list of all the names of places we have visited, starting at the root, newest at the front (position 1).

Visit

visit.png

Given the name of the item in our map we want to visit, we first extract the children of that key from our map.  We push our key onto our stack at slot 1, look up its URL in our map, and have the Web Viewer show it.  We then show our current key in the List Picker, as well as all its children in the stack and the List Picker Elements.

Children

children.png

This is a value procedure, returning a simple list of the text values in column 2 of our map where column 1 matches our key.

URL

URL.png

The URL of a key is the third column of the row in our map that belongs to that key.

Row

row.png

The row  value procedure returns a simple 3 element list containing a copy of the row in the map that matches the given key in column 2.

ListPicker1.AfterPicking

ListPicker1_AfterPicking.png

After the user selects a destination name from the List Picker, we visit that selection.

All the blocks

blocks.png

See this app in The Gallery:

ai2.appinventor.mit.edu/?galleryId=6367403443486720

See the next version of this project, using procedures instead of globals

https://drive.google.com/drive/folders/1RXAJlODImVYw9imsEQmu9N2gNPPimcr4?usp=sharing

More projects

https://docs.google.com/document/d/1acg2M5KdunKjJgM3Rxpy_Rf6vT6OozxdIWglgbmzroA/edit?usp=sharing