Popfly Coin Flip Mashup Tutorial

Computer Science Teacher
Computer Science Teacher - Thoughts and Information from Alfred Thompson

Popfly Coin Flip Mashup Tutorial

  • Comments 3

This is a tutorial I put together to provide a hands on experience for some teachers I am doing a workshop for today. I did a copy from a Word document and paste into Windows Live Writer to see how it works as a blog post. Sorry about all the images if you are on a slow connection. I don't usually include much in the way of images.

Open Popfly – http://go.microsoft.com/?linkid=7193319

Sign in

Select Mashup from the Create Stuff menu

 clip_image002

Drag a Timer, Calculator, LessGreaterCompareClass, and SimpleImages blocks

Timer under Tools

Calculator under Tools

LessGreaterCompareClasss under Everything else

SimpleImages under Display

(Hint – use the search feature as a shortcut)

You should have something like this:

clip_image006

Connect the blocks with arrows by clicking first on a blue dot on the right of the input/sending block and then on the changing color dot on the left of the receiving block.

clip_image008

Note: The ! signs indicate that commands must be specified for those blocks.

clip_image010Set the Timer

Click on the wrench symbol to expand the block

1. Enter 0.5 for the Frequency

2. Enter 50 for the number of ticks

3. Click the wrench to return to normal

Set the Calculator to return a RandomWholeNumber with a maximum value of 2

clip_image012

Set the LessThenCompareClass block to Return coin images

clip_image014

1. Set the source for Item 1 to Calculator and the Value to [output integer] which is the default

2. Set the value for item2 to 1 so that the random number will be compared to see if it is equal to, less than, or greater than 1

3. Select a coin to flip from the list below and place one URL for equal and less results and the second image URL for resultIfGreater (Note: Images are from the US Mint for educational uses)

http://www.usmint.gov/kids/teachers/coinCurricula/images/01centCoin_obv.jpg (penny front)

http://www.usmint.gov/kids/teachers/coinCurricula/images/01centCoin_rev.jpg (penny back)

http://www.usmint.gov/kids/teachers/coinCurricula/images/05centCoinNew_obv.jpg (nickel front)

http://www.usmint.gov/kids/teachers/coinCurricula/images/05centCoinNew_rev.jpg (nickel back)

http://www.usmint.gov/kids/teachers/coinCurricula/images/10centCoin_obv.jpg (dime front)

http://www.usmint.gov/kids/teachers/coinCurricula/images/10centCoin_rev.jpg (dime back)

http://www.usmint.gov/kids/teachers/coinCurricula/images/25centCoin50sq_obv.jpg (quarter front)

http://www.usmint.gov/kids/teachers/coinCurricula/images/25centCoin50sqDE_rev.jpg (quarter back)

Set SimpleImages to get an imageURL from LessGreatorCompareClass

clip_image016

Select Preview clip_image018 to run your mashup

Done with pennies it should look something like this:

clip_image022

Select Customize to return to editing your mashup

Orclip_image020

Select Show Console to get a close look at what is going on behind the scenes

clip_image024

Use the Save As option at the top of the screen to save your mashup

 clip_image026

On your own:

1. Use the User Input block to let the user select the number of times to flip coins

2. Use the SimpleLight block to get randomly placed coins

Note: The original version of this mashup was by Mark Frydenberg of Bentley College http://cis.bentley.edu/mfrydenberg

Page 1 of 1 (3 items)