# data[].attributes.attachment_link.readable_text
Follow
App Lab includes a list of featured datasets, such as information about planets, Spotify charts, sports and many more, that you can use to make your app! Or you can make your own data set .

You can find featured datasets by clicking on the Data tab in App Lab:

Click the Preview button to see what data is included in the table you've selected:

Click import to add this dataset to your app (you need to import in order to use any of the featured datasets in your app!)

Now go back to the Code tab in App Lab, and use the "getColumn" block to access the data in the table that you have imported:

Your first simple program can be to print out the contents of one of the columns in your table:

Make sure to update the name of the table to the one that you imported and the column name that you want to use (tip: every table has its own unique list of column names):

You can also store the content of the column of data in your table in a variable so you can reference it in other parts of your program:

Here, we are accessing and printing the first item in the "CountryNames" variable (which contains a list of all the Country Names in the "Countries and Territories" table):

You're now ready to start using datasets in your app.

Additional Information

Some of the datasets are "live" and are updated on a regular basis. You can see when a live dataset was last updated by the timestamp. If there is no timestamp included, this dataset is not being updated regularly:

Once you import a dataset, you can edit its content (such as: delete rows, add rows, rename columns, edit individual rows). Note: you cannot edit "live" datasets since these are being updated on a regular basis from an outside source

In addition to using the "getColumn" block, you can use "readRecords" to access data in your table. Here is information on using ReadRecords()

If you want to learn more about leveraging Lists and Traversals to use data in your app, this CS Principles lesson is a good introduction!

If you have ideas of additional datasets you think we should include in App Lab, please let us know.

Have more questions? Submit a request

# data[].attributes.attachment_link.description
Follow App Lab includes a list of featured datasets, such as information about planets, Spotify charts, sports and many more, that you can use to make your app! Or you can make your own data set .

# data[].attributes.attachment_link.description
The Denver Open Data Catalog provides open access to data managed by the City and County of Denver.

# data[].attributes.headline
Insanely complex Python pandemic simulator from GitHub

# data[].attributes.subject
Insanely complex Python pandemic simulator from GitHub

# data[].attributes.attachment_link.readable_text
You can't perform that action at this time.

You signed in with another tab or window. You signed out in another tab or window. Reload to refresh your session. Reload to refresh your session.

# data[].attributes.attachment_link.description
You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or window. Reload to refresh your session. Reload to refresh your session.

# data[].attributes.attachment_link.readable_text
Infection is a distributed game which simulates the spread of an illness. The goal is to stop the outbreak before every player dies!

Number of players: 1 Master and 4, or more, additional players. The Master and all other players need a micro:bit with battery pack.

In this game, a Master micro:bit infects a single, initial player ("patient zero") with the illness. The infected player is contagious immediately but won't show any signs sickness during the incubation time. The sickness gets transmitted when two micro:bits get close enough to each other to "contract the disease". After the incubation period, a sad face appears on the screen. After the sickness period, the player will eventually die and a skull displays on the screen. Dead players are out of the game.

If at least one player survives the outbreak, the game is won. Otherwise, try again!

How to play

Press A+B to enter Master mode (there's only one Master in a game).

Wait for players to be paired. The number of paired players will display on the screen. When paired, a letter appears on the player's screen, this letter is the player's identity.

Once all of your players are registered, press A+B to start the infection game. The game randomly picks a player as patient zero.

A player will transmit the disease to another player if close enough (detecting a sufficient RSSI), and if a certain probability ( TRANSMISSIONPROB) of disease transfer is reached. During the incubation phase ( INCUBATION), the player does not show any sign of illness (happy face). After that phase, the player gets sick and shows a sad face on the screen. After the sick (sad) face, the player dies and a skull shows up.

Once the game is over, the micro:bit will show the player's id ( A, B, C ...), health, and the id of the player who infected them. The Master micro:bit will show the identity of patient zero.

Icons used in the game:

JavaScript code

/** * Infection game * * Flash all micro:bits with this script * * Press A+B to enter master mode (1 per game) * * Wait for players to be paired. The number of paired player will display on screen. * An icon will appear on player's screen. * * Press A+B to start the infection game. The master will pick a random * player as patient zero. * * A player will transmit the disease if close enough (RSSI) * and with a certain probability (TRANSMISSIONPROB). * During the incudation phase (INCUBATION), the player does not show any sign * of illness. After that phase, the sad face shows up. * * The game will automatically stop once all players are dead or healthy. The master can * also press A+B again to stop the game. * * Once the game is over, the micro:bit will show the player id (A,B,C...), health and * who infected him. * * Icons used in the game: * * Pairing: IconNames.Ghost * Paired: IconNames.Happy * Dead: IconNames.Skull * Sick: IconNames.Sad * Incubating: IconNames.Confused * Healthy: IconNames.Happy * */ const INCUBATION = 20000; // time before showing symptoms const DEATH = 40000; // time before dying off the disease const RSSI = -45; // db const TRANSMISSIONPROB = 40; // % probability to transfer disease enum GameState { Stopped, Pairing, Infecting, Running, Over } enum HealthState { Healthy, Incubating, Sick, Dead } enum MessageKind { PairRequest, PairConfirmation, HealthSet, HealthValue, InitialInfect, TransmitVirus, GameState } const GameIcons = { Pairing: IconNames.Ghost, Paired: IconNames.Happy, Dead: IconNames.Skull, Sick: IconNames.Sad, Incubating: IconNames.Confused, Healthy: IconNames.Happy } class Message { private _data: Buffer; constructor(input?: Buffer) { this._data = input || control.createBuffer(13); } get kind(): number { return this._data.getNumber(NumberFormat.Int8LE, 0); } set kind(x: number) { this._data.setNumber(NumberFormat.Int8LE, 0, x); } get fromSerialNumber(): number { return this._data.getNumber(NumberFormat.Int32LE, 1); } set fromSerialNumber(x: number) { this._data.setNumber(NumberFormat.Int32LE, 1, x); } get value(): number { return this._data.getNumber(NumberFormat.Int32LE, 5); } set value(x: number) { this._data.setNumber(NumberFormat.Int32LE, 5, x); } get toSerialNumber(): number { return this._data.getNumber(NumberFormat.Int32LE, 9); } set toSerialNumber(x: number) { this._data.setNumber(NumberFormat.Int32LE, 9, x); } send() { radio.sendBuffer(this._data); basic.pause(250); } } const playerIcons = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; class Player { id: number; icon: number; health: HealthState; show() { basic.showString(playerIcons[this.icon]); } } // common state let state = GameState.Stopped; // master state let master = false; let patientZero: Player; const players: Player[] = []; // player state let paired = false; let infectedBy = -1; // who infected (playerIcon) let infectedTime = 0; // local time when infection happened let playerIcon = -1; // player icon and identity let health = HealthState.Healthy; // get a player instance (creates one as needed) function player(id: number): Player { for (const p of players) if (p.id == id) return p; // add player to game let p = new Player(); p.id = id; p.icon = (players.length + 1) % playerIcons.length; p.health = HealthState.Healthy; players.push(p); serial.writeLine(`player ==> ${p.id}`) return p; } function allDead(): boolean { for (const p of players) if (p.health != HealthState.Dead) return false; return true; } function gameOver() { state = GameState.Over; if (patientZero) patientZero.show(); } function gameFace() { switch (state) { case GameState.Stopped: basic.showIcon(GameIcons.Pairing); break; case GameState.Pairing: if (playerIcon > -1) basic.showString(playerIcons[playerIcon]); else basic.showIcon(paired ? GameIcons.Paired : GameIcons.Pairing, 1); break; case GameState.Infecting: case GameState.Running: switch (health) { case HealthState.Dead: basic.showIcon(GameIcons.Dead, 1); break; case HealthState.Sick: basic.showIcon(GameIcons.Sick, 1); break; default: basic.showIcon(GameIcons.Healthy, 1); break; } break; case GameState.Over: // show id basic.showString(playerIcons[playerIcon]); basic.pause(2000); // show health switch (health) { case HealthState.Dead: basic.showIcon(GameIcons.Dead, 2000); break; case HealthState.Sick: basic.showIcon(GameIcons.Sick, 2000); break; case HealthState.Incubating: basic.showIcon(GameIcons.Incubating, 2000); break; default: basic.showIcon(GameIcons.Healthy, 2000); break; } // show how infected if (infectedBy > -1) { basic.showString(" INFECTED BY"); basic.showString(playerIcons[infectedBy]); basic.pause(2000); } else { basic.showString(" PATIENT ZERO"); basic.pause(2000); } // show score game.showScore(); basic.pause(1000); break; } } // master button controller input.onButtonPressed(Button.AB, () => { // register as master if (state == GameState.Stopped && !master) { master = true; paired = true; state = GameState.Pairing; serial.writeLine("registered as master"); radio.setTransmitPower(7); // beef up master signal basic.showString("0"); return; } if (!master) return; // master only beyond this // launch game if (state == GameState.Pairing) { // pick 1 player and infect him patientZero = players[randint(0, players.length - 1)]; // infecting message needs to be confirmed by // the player state = GameState.Infecting; serial.writeLine(`game started ${players.length} players`); } // end game else if (state == GameState.Running) { gameOver(); } }) radio.setGroup(42); radio.onReceivedBuffer(function (receivedBuffer: Buffer) { const incomingMessage = new Message(receivedBuffer); const signal = radio.receivedPacket(RadioPacketProperty.SignalStrength); if (master) { switch (incomingMessage.kind) { case MessageKind.PairRequest: // register player let n = players.length; player(incomingMessage.fromSerialNumber); // show player number if changed if (n != players.length) { basic.showNumber(players.length); } break; case MessageKind.HealthValue: let p = player(incomingMessage.fromSerialNumber); p.health = incomingMessage.value; // check if all infected if (allDead()) gameOver(); break; } } else { switch (incomingMessage.kind) { case MessageKind.GameState: // update game state state = incomingMessage.value as GameState; break; case MessageKind.InitialInfect: if (infectedBy < 0 && incomingMessage.toSerialNumber == control.deviceSerialNumber()) { // infected by master infectedBy = 0; // infected my master infectedTime = input.runningTime(); health = HealthState.Incubating; serial.writeLine(`infected ${control.deviceSerialNumber()}`); } break; case MessageKind.HealthSet: if (incomingMessage.toSerialNumber == control.deviceSerialNumber()) { const newHealth = incomingMessage.value; if (health < newHealth) { health = newHealth; } } break; case MessageKind.PairConfirmation: if (!paired && state == GameState.Pairing && incomingMessage.toSerialNumber == control.deviceSerialNumber()) { // paired! serial.writeLine(`player paired ==> ${control.deviceSerialNumber()}`) playerIcon = incomingMessage.value; paired = true; } break; case MessageKind.TransmitVirus: if (state == GameState.Running) { if (health == HealthState.Healthy) { serial.writeLine(`signal: ${signal}`); if (signal > RSSI && randint(0, 100) > TRANSMISSIONPROB) { infectedBy = incomingMessage.value; infectedTime = input.runningTime(); health = HealthState.Incubating; } } } break; case MessageKind.HealthValue: if (health != HealthState.Dead && signal > RSSI) { game.addScore(1); } break; } } }) // main game loop basic.forever(() => { let message: Message; if (master) { switch (state) { case GameState.Pairing: // tell each player they are registered for (const p of players) { message = new Message(); message.kind = MessageKind.PairConfirmation; message.value = p.icon; message.toSerialNumber = p.id; message.send(); } serial.writeLine(`pairing ${players.length} players`); basic.pause(500); break; case GameState.Infecting: if (patientZero.health == HealthState.Healthy) { message = new Message(); message.kind = MessageKind.InitialInfect; message.toSerialNumber = patientZero.id; message.send(); basic.pause(100); } else { serial.writeLine(`patient ${patientZero.id} infected`); // show startup basic.showIcon(GameIcons.Dead); state = GameState.Running; } break; case GameState.Running: for (const p of players) { message = new Message(); message.kind = MessageKind.HealthSet; message.value = p.health; message.toSerialNumber = p.id; message.send(); } break; case GameState.Over: if (patientZero) patientZero.show(); break; } message = new Message() message.kind = MessageKind.GameState; message.value = state; message.send(); } else { // player loop switch (state) { case GameState.Pairing: // broadcast player id if (playerIcon < 0) { message = new Message(); message.kind = MessageKind.PairRequest; message.fromSerialNumber = control.deviceSerialNumber(); message.send(); } else if (infectedBy > -1) { message = new Message(); message.kind = MessageKind.HealthValue; message.fromSerialNumber = control.deviceSerialNumber(); message.value = health; message.send(); } break; case GameState.Infecting: message = new Message(); message.kind = MessageKind.HealthValue; message.fromSerialNumber = control.deviceSerialNumber(); message.value = health; message.send(); break; case GameState.Running: // update health status if (health != HealthState.Healthy && input.runningTime() - infectedTime > DEATH) health = HealthState.Dead; else if (health != HealthState.Healthy && input.runningTime() - infectedTime > INCUBATION) health = HealthState.Sick; // transmit disease if (health == HealthState.Incubating || health == HealthState.Sick) { message = new Message(); message.kind = MessageKind.TransmitVirus; message.fromSerialNumber = control.deviceSerialNumber(); message.value = playerIcon; message.send(); } message = new Message(); message.kind = MessageKind.HealthValue; message.fromSerialNumber = control.deviceSerialNumber(); message.value = health; message.send(); break; } // show current animation gameFace(); } }) basic.showIcon(GameIcons.Pairing)

# data[].attributes.attachment_link.description
Infection is a distributed game which simulates the spread of an illness. The goal is to stop the outbreak before every player dies! Number of players: 1 Master and 4, or more, additional players. The Master and all other players need a micro:bit with battery pack.

# data[].attributes.attachment_link.title
Radio - BBC micro:bit MicroPython 1.0.1 documentation

# data[].attributes.headline
Warren Buffet: Buffet Index - predictive market graph

# data[].attributes.subject
Warren Buffet: Buffet Index - predictive market graph

# data[].attributes.attachment_link.readable_text
The Buffett Indicator is the ratio of total United States stock market valuation to GDP. As of June 24, 2021 we calculate the Buffett Indicator as:

Aggregate US Market Value: $53.2T

Annualized GDP: $22.5T

By our calculation that is currently 89% (or about 2.9 standard deviations) above the historical average, suggesting that the market is Strongly Overvalued. These are historical, all-time highs. However, with interest rates at historic lows, there is reason to suspect that "this time is different" may hold true.

The historical chart of the Buffett Indicator is shown below - for much more analysis and information on our data sources, methodology, and counterpoints, keep scrolling.

The Buffett Indicator is the ratio of total US stock market valuation to GDP. Named after Warren Buffett, who called the ratio "the best single measure of where valuations stand at any given moment". (Buffett has since walked back those comments, hesitating to endorse any single measure as either comprehensive or consistent over time, but this ratio remains credited to his name). To calculate the ratio, we need to get data for both metrics: Total Market Value and GDP.

Total Market Value

The most common measurement of the aggregate value of the US stock market is the Wilshire 5000. This is available directly from Wilshire (links to all data sources below), with monthly data starting in 1971, and daily measures beginning in 1980. The Wilshire index was created such that a 1-point increase in the index corresponds to a $1 billion increase in US market cap. Per Wilshire, that 1:1 ratio has drifted, and as of Dec 2013 a 1-point increase in the index corresponded to a $1.15 billion dollar increase. We adjust the data back to inception (and projected going forward) on a straight-line basis to compensate for this drift. For example, the Sep 2020 Wilshire Index of 35,807 corresponds to a total real market cap value of $42.27T USD.

For data prior to 1970 (where Wilshire data is not available) we use the Z.1 Financial Account - Nonfinancial corporate business; corporate equities; liability, Level, published by the Federal Reserve, which provides a quarterly estimate of total market value back to 1945. In order to integrate the datasets, we index the Z.1 data to match up to the 1970 Wilshire starting point.

Combined, these data make our Composite US Stock Market Value data series, shown below. Our current estimate of composite US stock market value is $53.2T.

GDP

The Gross Domestic Product (GDP) represents the total production of the US economy. This is measured quarterly by the US Government's Bureau of Economic Analysis. The GDP is a static measurement of prior economic activity - it does not forecast the future or include any expectation or valuation of future economic activity or economic growth. The GDP is calculated and published quarterly, several months in arrears, such that by the time the data is published it is several months old. In order to provide updated data for the most recent quarter we use the most recent GDPNow estimate published by the Federal Reserve Bank of Atlanta. Based on this, our current estimate of (annualized) GDP is $22.5T. A historical chart of GDP is shown below.

The Ratio of the Two

Given that the stock market value represents expectations of future economic activity, and the GDP is a measure of most recent actual economic activity, the ratio of these two data series represents expected future returns relative to current performance. This is similar in nature to how we think about the PE ratio of a particular stock. It stands to reason that this ratio would remain relatively stable over time, and increase slowly as technology allows for the same labor and capital to be used ever more efficiently.

Now, let's look at how the Buffett Indicator has changed in the last ~75 years.

The historic ratio of total market value to GDP (aka the Buffett Indicator) can be seen below.

In the chart above, the exponential regression line (labeled "Historical Trendline") shows the natural growth rate of the indicator. This shows the upward historical trend that expectations for future growth have risen faster over time than actual economic output. This makes sense, as technological progress drives exponential returns.

Detrending

To make the context of our current position more clear, we can re-draw the trend line horizontally and remap the data as the percentage above or below that historical average. This is shown below, along with band lines showing +/- a standard deviation. Generally speaking, about 70% of the time the Buffett Indicator should be within +/- 1 standard deviation from the average (labeled "Fairly Valued" in chart below), and 98% of the time it should be +/- 2 standard deviations from the average. We show the zone between 1-2 standard deviations as Over/Under Valued, and anything beyond that range (should be < 2% of observations) as Strongly Over/Under Valued.

And finally, below is the same chart, but with only the last twenty years of data, so that recent market activity can be seen more clearly.

Summary

The current market-to-GDP ratio is 89% above the historical average, and considered Strongly Overvalued (see our ratings guide for more information).

What can the Buffett Indicator tell us about future stock market returns? This is probably the most relevant question investors have when considering valuation models. While it is not possible to predict the future, it is easy enough to look at historical data to see how the market has performed after periods of high and low valuation per the model.

The above chart shows monthly datapoints from 1950 to 2016, mapping the relative value of our Buffett Indicator model (x-axis) against the subsequent 5 year S&P500 returns (y-axis). The colored, dashed vertical lines indicate the same under/overvaluation bands as shown in previous models (i.e., values to the right of the dark red line indicate datapoints that were > 2 standard deviations above the trendline, indicating the market was 'Strongly Overvalued').

As an example, the rightmost point on the chart (labeled as Example 2 in the chart) corresponds with March 2000. At this point the US aggregate stock market value was $15.5T, vs a GDP of $10.0T, giving a raw BI ratio of 155%. At the time, this value was 67% (2.2 standard deviations) above the long term BI trend. In March 2000 the S&P500 was at $1,499. Five years later, in March 2005, the S&P00 had fallen to $1,181. This was a 21% nominal decline, and a 30% 'real' decline after adjusting for inflation during the 5 years.

Overall, Figure 5 above shows that there is a slight correlation between BI valuation and subsequent S&P00 returns. The highest stock market returns tend to come after periods of undervaluation (left side of the chart). Periods of overvaluation (right side of the chart), particularly at the extreme, tend to be followed by negative S&P00 returns.

A few final comments on this:

The current BI value is 2.9 standard deviations above the trend, putting us way over on the right side of the chart. (Obviously, we won't know exactly where on the y-axis we'll fall for another 5 years...)

This chart shows correlation, but not causation. The trend here could be pretty quickly undone if the stock market continues its recent strong performance despite being so far above trend line BI values.

We show the regression line in the chart above to indicate the general trend of the data, but not as a claim of statistical significance. The r-squared value here is low, and time series data like this is vulnerable to autocorrelation, making results seem more significant than they really are.

It is important to call out that no single metric is illustrative of the entire market, of course. The primary criticism of using the Buffett Indicator as a valuation metric (and particularly in 2021 using it as a metric to justify the overvaluation of the market), is that it does not address the state of non-equity asset markets. In truth, investors have many different asset classes to consider and evaluate when considering portfolio distribution - e.g., corporate bonds, real estate, and commodities.

The proverbial elephant in the room here is the bond market, expressed as interest rates. Very generally speaking, bonds represent a lower-risk asset as an alternative to equity (stock) markets, and the two have a highly interdependent relationship.

The 50,000ft overview on interest rates is as follows. When interest rates are high, bonds pay a high return to investors, which lowers demand (and prices) of the riskier equities. Additionally, higher interest rates means it's more expensive for businesses to borrow money, making it harder to borrow cash as a way to finance growth. Which is to say any business that takes on debt will face relatively higher interest payments, and therefore less profits. And again, less profits means lower stock prices. The corollary to all this is also true. Low interest rates means bonds pay less to investors, which lowers demand for them, which raises stock prices in relation to bonds. Low interest rates make it easy for corporations to borrow cash cheaply to finance growth. Corporate interest payments will be low, making profits high. This is all to say, if interest rates are high, stocks go down. If interest rates are low, stocks go up.

Interest rates today are lower than they've ever been. Below is a chart showing the interest rate of the 10Year US Treasury Bond. This is the most vanilla bond there is, and over the last 50 years the interest rate on it has averaged 6%. Back during the peak of the .com bubble (when the Buffett Indicator was very high), the 10Y Treasury rate was a bit higher than average, around 6.5%, showing that low interest rates weren't juicing the stock market. Today the Buffett Indicator is roughly the same distance above its historical average as it was during the .com bubble, but interest rates are at an all time low, near 1%. This can be interpreted to mean that during the .com bubble, equity investors had other good options for their money - but they still piled recklessly into stocks. Whereas today, investing in bonds returns so little that you may actually lose money to inflation. Today's investors need to seek a return from somewhere, and low interest rates are forcing them to seek that return from riskier assets, effectively pumping up the stock market. While this doesn't justify the high Buffett Indicator on any fundamental basis, it does suggest that the market today is less likely to quickly collapse like it did in 2000, and that it may have reason to stay abnormally high for as long as interest rates are abnormally low.

For additional detail on the effect interest rates have on stock prices, view our Interest Rate Model.

Below are some classics on fundamentals-based value investing. While these aren't specifically about the Buffett Indicator, they espouse similar ideas, and are strongly recommended resources.

The below table cites all data and sources used in constructing the charts, or otherwise referred to, on this page.

# data[].attributes.attachment_link.title
Buffett Indicator Shows Stock Market is Strongly Overvalued

# data[].attributes.attachment_link.description
The Buffett Indicator is the ratio of total US stock market valuation to GDP. As of June 24, 2021 we calculate the Buffett Indicator as 236%, which is about 2.9 standard deviations above the historical average, suggesting that the US stock market is Strongly Overvalued.

# data[].attributes.body
I'm excited to apply what we've learned today as my students collect data from the Micro:Bits, both in MakeCode and in Python (my MakeCode trainers didn't seem well-versed in migrating data from the microbit to a computer, so this information will help on many fronts). I'm eager to investigate using Google Sheets to display data, especially now that I know Python coding can be used to create graphs within Sheets.

# data[].attributes.headline
Weather, Sports, and School Crowdsource data

# data[].attributes.subject
Weather, Sports, and School Crowdsource data

# data[].attributes.body
Collecting sports or weather data from the internet could be applicable. Perhaps the BLS to get information about certain sectors? (clothing, makeup, hardware companies). You really can collect data from many sources and make those sources diverse ie sports and cosmetics data. I find there is a fantastic opportunity to bring elevated experiences to all sorts of clubs on campus. Weather data extraction for bio club, stats visualization for volleyball and basketball sports clubs -- soo many opportunities to boost many clubs and interests through computing

# data[].attributes.body
Giving students access to data sets that are related to their interests is still key to make any data study effective in MS/HS.

it would be cool to team up with Math and/or Science teachers to do a data collection, analysis, and visualizing multi-genre unit.

# data[].attributes.body
The possibilities seem endless -- I'd like students to collect a reasonably large dataset using the micro:bit sensors and analyze the data using visualization tools to make some sort of decision --
- Collecting light data in variety of locations to determine where to place solar panels on a roof, to determining if shade/sun loving plants should go in a specific location.
- Collection temp data throughout the day to see how much the temperature varies in a location.
- Connect other sensor data to make a decision with the goal of making the problem as authentic as possible.

# data[].attributes.attachment_link.readable_text
Printables

Classroom resources

Learning outcomes

Students will be able to:

Key questions

Who designs programming languages for computers?

Lesson starter

Notes on resources

The resources we listed are for groups of 3 students.

Today we are going to write our own unplugged fitness app. Before we start we need to design a programming language so that we know what to do.

Lesson activities

1. Brainstorm as a class all the different fitness exercises you could have in your programming language.

Ideas to get you started include:

Running on the spot

Star jumps

Ski jumps

Catching bean bags

2. Work in your groups and draw on each of the cards. You should design:

A "GO" card to show the start of the program

4 cards, each with a different exercise depicted on it

A card that depicts how you should finish. Ideas could be:

Strike a pose

Sit with your arms crossed

Stand as straight as you can

3. Now place your cards in a row with the GO card first, then with each picture and how you should finish last. (There should be no numbers to indicate how many times you should do the exercise - that will come later.)

4. Each group goes around and tries to work out what each of the cards mean from the other groups.

5. Come together and discuss what was the same, and for which cards you had to "learn" because you weren't sure what it was.

6. This is the same with computer programming languages. You can learn to program with different languages, and some things seem similar in a new language, while other things you have to learn as it isn't clear how to use a particular command.

7. Now put out 6 whiteboards and the hula hoop like this:

8. Have one group put their Go card on the first whiteboard

9. Now have them put their exercises cards out on the whiteboards shown. Explain that whatever is in the hula hoop will be repeated (it's a loop!)

10. We need to set the parameters. A parameter tells us how long to do something or how many times to do something. Here we know to Go, To do star jumps (but not how many), to do ski jumps (but not how many), to catch a bean bag (but not how many) and that we should repeat the ski jumps and catch a bean bag, (but not how many times).

11. With your whiteboard pens, write in the number of times each exercise should be done. (Encourage the students to choose realistic numbers; the number on the hula hoop multiplies the ones inside.) For the exercises in the hula hoop, you need to repeat both of them how many times? (In the example, the sequence of 10 ski jumps and 5 catches is repeated 3 times, so it would be 10 ski, 5 catch, 10 ski, 5 catch, 10 ski, 5 catch).

12. The last piece of programming is to show how we will end when we have finished our fitness app workout.

13. Now we have built up our fitness app, it's time to test it. The Programmer watches to see if everyone is doing it correctly. The Tester is looking for if there are any numbers to change or if the activities need further instructions. When the Tester says "Go" start following your fitness app.

14. The Programmer asks the Tester if they saw anything they thought could be changed or improved.

Applying what we have just learnt

Getting the sequence right for programming is very important. If any detail is missing then your program won't run how you expected it. A loop in programming is when you repeat the instructions inside of it, until a certain condition is met (in this case each exercise is completed a certain number of times). A loop can get a lot of instructions to happen with a relatively short program.

Lesson reflection

Discuss all the areas where you needed to collaborate together. What skills did you need to apply when discussing what should be programmed.

Do you think this is a way you could set up fitness for your class?

Do you have ideas for writing different fitness programs this way?

Throughout the lessons there are links to computational thinking. Below we've noted some general links that apply to this content.

Teaching computational thinking through CSUnplugged activities supports students to learn how to describe a problem, identify what are the important details they need to solve this problem, and break it down into small, logical steps so that they can then create a process which solves the problem, and then evaluate this process. These skills are transferable to any other curriculum area, but are particularly relevant to developing digital systems and solving problems using the capabilities of computers.

These Computational Thinking concepts are all connected to each other and support each other, but it's important to note that not all aspects of Computational Thinking happen in every unit or lesson. We've highlighted the important connections for you to observe your students in action. For more background information on what our definition of Computational Thinking is see our notes about computational thinking.

Many of the Computational Thinking connections in this lesson are the same as for lesson 1 and 2, so we have just included the additional ones specific to this lesson.

Abstraction

The symbols on the cards represented the physical actions students needed to perform; they were an abstract representation.

Abstraction was also used to simplify things when the hula hoop was used as a loop.

Examples of what you could look for:

Were the students able to work with the symbols?

# data[].attributes.attachment_link.description
Learning outcomes Students will be able to: Who designs programming languages for computers? Notes on resources The resources we listed are for groups of 3 students. Today we are going to write our own unplugged fitness app. Before we start we need to design a programming language so that we know what to do.

# data[].attributes.body
This is a simple game of Stackr that mostly works!

# data[].attributes.attachment_link.readable_text
# This code displays temp and light readings in Serial
from microbit import *


while True:
    print("tempC", temperature()) #celcius
    sleep(1000)
    print("tempF", temperature()*9.0/5.0 + 32) #fahrenheit
    sleep(1000)
    print("light", display.read_light_level())
    sleep(1000)

# data[].attributes.body
This compass will hit all of the directions. It uses a list of dictionaries to be as flexible as possible.

# data[].attributes.body
if not compass.is_calibrated():
    compass.calibrate()

while True:
    heading=compass.heading()
    if heading >=338 or heading <23:
        display.show("N")
    elif heading >= 68 and heading <113:
        display.show ("E")
    elif heading >=248 and heading <293:
        display.show ("W")
    elif heading >=158 and heading <203:
        display.show ("S")

# data[].attributes.body
Here's a generic program to animate a series of frames only if the touch bar is pressed. (this one runs the frames forward and then when it reaches the end, it reverses them instead of looping). You can use this and just replace the list of images with your own.

# data[].attributes.attachment_link.readable_text
# Add your Python code here. E.g.
from microbit import *

    # create a list of images
frames = [
            Image('99999:00000:00000:00000:00000'),
            Image('00000:99999:00000:00000:00000'),
            Image('00000:00000:99999:00000:00000'),
            Image('00000:00000:00000:99999:00000'),
            Image('00000:00000:00000:00000:99999'),    
        ]
    # the current frame to show
currentFrame = 0
dx = 1
while True:
        # while the icon is being held down 
        # animate
    while pin_logo.is_touched():
        display.show(frames[currentFrame])
        sleep(50)
            # move the frame
        currentFrame += dx
            # if we're out of bounds, change direction
            # and correct course
        if currentFrame < 0 or currentFrame >= len(frames):
            dx *= -1
            currentFrame += dx
        
            

    

# data[].attributes.body
Allow students have a creative day. A more  industry setting which is part of PM, SCRUM style

# data[].attributes.body
During a 90-minute block period, I make sure we break to show off what we've done as well as to share challenges that learners are having.

# data[].attributes.body
On index cards, have students write down the names of 3 or 4 other students in the class they would like to work with (and anyone they DONT want to work with). Take the cards and create groups based on these.

# data[].attributes.body
I think that with the right influences from instructors and peers, as well as in being honest and direct with your students -- you can build trust that they can handle the machines responsibly. I personally have not dealt with a horror story of a broken microprocessors!

# data[].attributes.body
Have students create a management
scheme

# data[].attributes.body
I want to design multi-curricular actives with Math and Science classes where students apply CS skills to real-world projects, such as tracking moisture or water levels in the nearby open space.

# data[].attributes.body
I think its a great idea to give kids their own project to work on that they are interested in, it gives them a lot more buy in and helps keep them engaged.

# data[].attributes.body
have students take inventory with an "unboxing" lesson and "getting to know the micro:bit" lessons to make sure they know what belongs in the kit.  It also helps to purchase better containers (little plastic hardware storage bins work good, but are pricey)
NUMBER the bins
Make students sign an agreement to keep their kits together, make them aware that they will have to replace any parts that they lose

# data[].attributes.body
I think labeling each micro:bit and associated peripherals helps increase accountability: students are assigned to a micro:bit and they're responsible for ensuring that it gets back to the check-in box in shape.

# data[].attributes.body
I will be using micro:bits to provide differentiated student-driven learning. I plan to make challenge cards that my 5th and 6th graders can work towards while I work with other students (my students will attend my class in multiage groups (1st, 2nd, and 3rd graders together; 4th, 5th, and 6th grades together).

# data[].attributes.body
When working with students, I feel it is important that students have the opportunity to test things out as they are learning.
I like to give them some basics and then provide them with a challenge. The challenge allows students to test their skills and to collaborate with one another. This fosters a safe learning environment where students are able to fail and then try again.