Today i show you how to use “random random integer from” and “make a list” block. The aim of the program is, when i press to button1 i will get a random character from my list. And these characters will not repeat theirselves.
At the top block, i made my variable declarations. Variable bbb is for the maximum value of list’s index. indexno is for the index’s number and datass is my list. Index starts from 1, for example index number of a is 1, and the index number of e is 5.
At this section, when i press the button1 it checks the value of bbb is equal to 1? Reason of that when the value of bbb is 1 it means when we press again button1 there won’t be any element at list. So when it equals to 1 , i make it disable to press.
“Remove from list” takes the certain indexed element from list and places its place with the next one. For example if he function takes the element that has the index number as 2, 3rd element will be the new 2nd element and 4 to 3 and also 5 to 4.
Now, we have disabled press buton and when we press reset, all values will download to the list. Also the maximum value of index. Because there will be no element of my list at the end of the program.
At my this post, i will continue to use App inventor 2. This is the first time of using app inventor2 since it is updated at 28 Feb.
My aim is making a downcounter that counts from a number that is entered from the screen. Then it starts downcounting when we press start button. If i press to stop, it freezes at that current number. After that we press to start again, it continues to count from the last number until it arrives to zero or stopping again.
Now i will try to make downcounter at app inventor2.
At my first post about app inventor, i made button control.
In this application we will use it and we will create a downcounter.
We will use clock, button and label component.
When we push the start button, a counter will start to count from ten to zero..
I defined a variable named “value1” that has the value of ten. At the beginning -when screeen initialized- clock is disabled. When we push the button, value of the “value1” will decrease one-by-one until it reaches to zero. When the counter’s value is zero, button’s text will change to “finished”. Then it will wait for another input as pushing.
Hi, my second post will be about usage of slide component at app inventor 2.
Slider is a component that its value change by the position. We can define the max. and min. value.
I took a label and slider from user interface and put them in to a VerticalArrangement that taken from layout.
When we change the slide its value will change and then label will change. If the thumb position is lower than 25 label will be “b” and if the thumb position is higher than 25 label will be “a”
Program output at screen.