2016年7月20日星期三

Any Component - Abstraction of Computational Thinking

In App Inventor, we cannot copy components. So if there are a bunch of components that have same properties, you need to set them one by one, that really makes you frustrated.  So we look for the similarities between the components, figure out what things are different, remove out differences, that calls abstraction in Computational Thinking. We can use AnyComponent to fulfill it. Here are two examples:

Xylophone:


UI:

Before set the width, Fontsize and FontBold:


We have 8 same buttons. Set width, FontSize and FontBold to the button's properties.





















After the screen initialized:

 

 

 


















MoleMash:  

 

 

We have nine holes that has same size, same picture, and regular arrangement.


So we set it in blocks:



If you want to edit the properties of these components, you only do it at one time, one place. Cool, isn't it?