11-11-2015 05:25 PM
Hey Guy's
I want to iteratively fill an array of random integers between 0 and 100 in ascending order every 1 second then add a delay routine after which if no new value is displayed in the table the program displays a string indicator " elapsed time " .
Well i done the true case but i failed the rest ! 😕 can't find how to do it !
any idea !?
That's the True case:
But i don't know how to do the False Case:
11-11-2015 05:36 PM
11-11-2015 06:06 PM
In addition To Dennis's comment:
11-11-2015 06:24 PM
You aren't creating integers, you are creating an array of floating point values. If you want an integer between 0 and 100, you should multiply the random number by 101 and round down.
What happens if your very first number is picked as 100? There are no integers larger than that.
You said you want it to be ascending numbers, but if you are getting a larger number, you are putting it at the front of the array, Your resulting array will be descending numbers.
11-12-2015 12:35 AM
I want it to put in the array just the number that is great than the last number and ignore the number that is less than the previous number ! how do i wire the shift register ?
11-12-2015 12:39 AM
here how i want it:
- if the number generated is greater than the previous number, put it in the array
11-12-2015 12:40 AM
here how i want it:
- if the number generated is greater than the previous number, put it in the array
- else if the number is less than the previous number ignore it !
i want to know how to wire the shift register !
11-12-2015 05:56 AM - edited 11-12-2015 05:56 AM
When you say "previous number", do you mean the last number that was put in the array or the last number that was generated?
This snippet is based on the "previous number generated". The FALSE case just wires the array straight through.

11-12-2015 06:13 AM - edited 11-12-2015 06:21 AM
It's ok it work ! but i won't to add a delay if no number is added to the array within 5second the program print time elapsed !? how to do it ?
11-12-2015 08:03 AM
@MedAmine_07 wrote:
but i won't to add a delay if no number is added to the array within 5second the program print time elapsed !?
I have no clue what you are asking for here. What do you want with the 5 seconds?