If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
ifthenelse for arrays in ruby?
20 posts
• Page 1 of 2 • 1, 2
ifthenelse for arrays in ruby?
How to make ifthenelse for arrays in ruby?
-> Input array
-> equals
-> conditions array
-> things to send to output
-> Input array
-> equals
-> conditions array
-> things to send to output
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: ifthenelse for arrays in ruby?
...arrays...
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: ifthenelse for arrays in ruby?
I just would like to simplify this.
Basically there will be few of such units, each for different comparator. This is for splitting a list of strings according to numeric parameter placed within these strings.
Basically there will be few of such units, each for different comparator. This is for splitting a list of strings according to numeric parameter placed within these strings.
- Attachments
-
- Schematic1.fsm
- (591 Bytes) Downloaded 883 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: ifthenelse for arrays in ruby?
can you post a logical example of what you want?
- Tronic
- Posts: 539
- Joined: Wed Dec 21, 2011 12:59 pm
Re: ifthenelse for arrays in ruby?
You could use group_by.
- Attachments
-
- Schematic1_simple.fsm
- (616 Bytes) Downloaded 865 times
- TheOm
- Posts: 103
- Joined: Tue Jan 28, 2014 7:35 pm
- Location: Germany
Re: ifthenelse for arrays in ruby?
Hi @TheOm.
Your solution still refers to ranges. I'd like to compare the input array to single element (what I posted above was unmodified module, that operates on ranges). Or rather...
@Tronic.
Simple case scenario. Let say that I have an array:
a
a
b
a
c
b
c
Concept:
Produce arrays of indexes that refer to specific values.
indexes @a
0
1
3
indexes @b
2
5
indexes @c
4
6
indexes @N
...
...
*
I'm still defining the concept, but I hope I made this one clear this time.
Your solution still refers to ranges. I'd like to compare the input array to single element (what I posted above was unmodified module, that operates on ranges). Or rather...
@Tronic.
Simple case scenario. Let say that I have an array:
a
a
b
a
c
b
c
Concept:
Produce arrays of indexes that refer to specific values.
indexes @a
0
1
3
indexes @b
2
5
indexes @c
4
6
indexes @N
...
...
*
I'm still defining the concept, but I hope I made this one clear this time.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
20 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 69 guests